Example usage for java.util.concurrent CopyOnWriteArrayList CopyOnWriteArrayList

List of usage examples for java.util.concurrent CopyOnWriteArrayList CopyOnWriteArrayList

Introduction

In this page you can find the example usage for java.util.concurrent CopyOnWriteArrayList CopyOnWriteArrayList.

Prototype

public CopyOnWriteArrayList() 

Source Link

Document

Creates an empty list.

Usage

From source file:org.springframework.data.hadoop.mapreduce.JobRunner.java

@Override
public void afterPropertiesSet() throws Exception {
    Assert.notEmpty(jobs, "at least one job needs to be specified");

    runningJobs = new CopyOnWriteArrayList<RunningJob>();
    if (runAtStartup) {
        getObject();/*from   w ww.  j a  v a2 s.  c  o m*/
    }
}

From source file:net.big_oh.algorithms.graph.clique.BronKerboschMaximalCliqueFinder.java

public BronKerboschMaximalCliqueFinder() {
    // Use CopyOnWriteArrayList to support dynamic listeners w/o incurring
    // synchronization overhead
    eventListeners = new CopyOnWriteArrayList<MaximalCliqueFinderEventListener<V>>();
}

From source file:org.wso2.carbon.event.stream.core.internal.EventJunction.java

public EventJunction(StreamDefinition streamDefinition) {
    this.streamDefinition = streamDefinition;
    this.producers = new CopyOnWriteArrayList<EventProducer>();
    this.siddhiEventConsumers = new CopyOnWriteArrayList<SiddhiEventConsumer>();
    this.wso2EventConsumers = new CopyOnWriteArrayList<WSO2EventConsumer>();
    this.wso2EventListConsumers = new CopyOnWriteArrayList<WSO2EventListConsumer>();
    populateEventTemplate(streamDefinition);
}

From source file:de.kaiserpfalzEdv.commons.jee.spring.ServiceLoggingTest.java

@DataProvider(name = "arguments")
protected Iterator<Object[]> arguments() {
    List<Object[]> result = new CopyOnWriteArrayList<>();

    result.add(new Object[] { "random-all-null", null, null, null, null });

    result.add(new Object[] { "uuid1", UUID_OBJECT_ARRAY1.toString(), UUID_OBJECT_ARRAY0.toString(),
            UUID_OBJECT_ARRAY1, "uuid1" });
    result.add(new Object[] { "uuid2", UUID_OBJECT_ARRAY2.toString(), null, UUID_OBJECT_ARRAY2, "uuid2" });
    result.add(new Object[] { "uuid3", UUID_OBJECT_ARRAY3.toString(), "UUIDObjectArray", UUID_OBJECT_ARRAY3,
            "uuid3" });
    result.add(//from w w  w.  j  a v  a 2 s .com
            new Object[] { "uuid4", UUID_OBJECT_ARRAY4.toString(), UUID_OBJECT_ARRAY4.toString(), null, null });
    result.add(
            new Object[] { "uuid5", UUID_OBJECT_ARRAY5.toString(), UUID_OBJECT_ARRAY5.toString(), null, null });
    result.add(new Object[] { "uuid6", UUID_OBJECT_ARRAY6.toString(), null, UUID_OBJECT_ARRAY6,
            UUID_OBJECT_ARRAY0 });

    result.add(new Object[] { "string-null-args", "nullObjectArray", "nullObjectArray", null, null });
    result.add(new Object[] { "string-empty-args", "emptyObjectArray", "emptyObjectArray", null, null });

    return result.iterator();
}

From source file:org.wso2.carbon.event.stream.core.internal.stream.EventJunction.java

public EventJunction(StreamDefinition streamDefinition) {
    this.streamDefinition = streamDefinition;
    this.producers = new CopyOnWriteArrayList<EventProducer>();
    this.rawEventConsumers = new CopyOnWriteArrayList<RawEventConsumer>();
    this.siddhiEventConsumers = new CopyOnWriteArrayList<SiddhiEventConsumer>();
    this.wso2EventConsumers = new CopyOnWriteArrayList<WSO2EventConsumer>();
    this.wso2EventListConsumers = new CopyOnWriteArrayList<WSO2EventListConsumer>();
    populateEventTemplate(streamDefinition);
}

From source file:freed.cam.apis.basecamera.CameraFragmentAbstract.java

public CameraFragmentAbstract() {
    cameraChangedListners = new CopyOnWriteArrayList<>();
    uiHandler = new Handler(Looper.getMainLooper());
}

From source file:org.apache.axis2.engine.Phase.java

/**
 * Create a named Phase/* ww w .  ja v a 2  s.  c  om*/
 *
 * @param phaseName the name for this Phase
 */
public Phase(String phaseName) {
    handlers = new CopyOnWriteArrayList<Handler>();
    this.phaseName = phaseName;
}

From source file:sachin.spider.SpiderConfig.java

/**
 * Constructor of the SpiderConfig Class
 *
 * @param url String parameter for the site which is going to be crawled.
 *///  w  ww.  ja  va 2 s  . c  om

public SpiderConfig(String url) {
    url = URLCanonicalizer.getCanonicalURL(url);
    try {
        host = new URL(url).getHost().replaceAll("www.", "");
    } catch (MalformedURLException ex) {
        Logger.getLogger(SpiderConfig.class.getName()).log(Level.SEVERE, null, ex);
    }
    links = new CopyOnWriteArrayList<WebURL>();
    this.setSiteName(url);
    links.add(new WebURL(getSiteName()));
    modifiedSiteName = handleRedirect(url);
    WebURL redirectLocation = new WebURL(modifiedSiteName);
    if (!links.contains(redirectLocation)) {
        links.add(0, redirectLocation);
    }
}

From source file:com.impetus.client.cassandra.service.CassandraHostConfiguration.java

protected void buildHosts(List<Server> servers, List<Host> hostsList) {
    List<CassandraHost> cassandraHosts = new CopyOnWriteArrayList<CassandraHost>();
    for (Server server : servers) {
        String host = server.getHost().trim();
        String portAsString = server.getPort().trim();
        onValidation(host, portAsString);
        Properties serverProperties = server.getProperties();
        CassandraHost cassandraHost = new CassandraHost(host, Integer.parseInt(portAsString));
        setConfig(cassandraHost, null, serverProperties);
        cassandraHosts.add(cassandraHost);
        hostsList.add(cassandraHost);//ww w  .j  a v a 2s . com
    }
}

From source file:com.app.server.XMLDeploymentScanner.java

public void init(Vector serviceList, ServerConfig serverConfig, MBeanServer mbeanServer) {
    this.serviceList = serviceList;
    this.serverConfig = serverConfig;
    this.mbeanServer = mbeanServer;
    this.userLibDir = serverConfig.getServiceslibdirectory();
    File userLibJars = new File(userLibDir);
    CopyOnWriteArrayList<String> jarList = new CopyOnWriteArrayList();
    getUsersJars(userLibJars, jarList);//from ww  w . j a v  a  2  s  . co  m
    URLClassLoader loader = (URLClassLoader) ClassLoader.getSystemClassLoader();
    userLibJarLoader = new WebClassLoader(loader.getURLs());
    for (String jarFilePath : jarList) {
        try {
            userLibJarLoader.addURL(new URL("file:/" + jarFilePath.replace("\\", "/")));
        } catch (Exception e) {
            log.error("Error in url " + "file:/" + jarFilePath.replace("\\", "/"), e);
            //e2.printStackTrace();            
        }
    }

    DigesterLoader xmlDigesterLoader = DigesterLoader.newLoader(new FromXmlRulesModule() {

        protected void loadRules() {

            try {
                loadXMLRules(new InputSource(new FileInputStream("./config/datasource-rules.xml")));
            } catch (Exception e) {
                log.error("Error in loading config rules ./config/datasource-rules.xml", e);
                //e.printStackTrace();
            }

        }
    });
    xmlDigester = xmlDigesterLoader.newDigester();
    try {
        ic = new InitialContext();
        ic.createSubcontext("java:");
    } catch (Exception e) {
        log.error("Error in creating subcontext", e);
    }
    log.info("initialized");
    // TODO Auto-generated constructor stub
}