Example usage for java.util.concurrent ConcurrentLinkedQueue ConcurrentLinkedQueue

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

Introduction

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

Prototype

public ConcurrentLinkedQueue() 

Source Link

Document

Creates a ConcurrentLinkedQueue that is initially empty.

Usage

From source file:org.craftercms.deployer.impl.TargetImpl.java

public TargetImpl(String env, String siteName, DeploymentPipeline deploymentPipeline, File configurationFile,
        Configuration configuration, ConfigurableApplicationContext applicationContext) {
    this.env = env;
    this.siteName = siteName;
    this.deploymentPipeline = deploymentPipeline;
    this.configurationFile = configurationFile;
    this.configuration = configuration;
    this.applicationContext = applicationContext;
    this.loadDate = ZonedDateTime.now();
    this.deploymentExecutor = Executors.newSingleThreadExecutor();
    this.pendingDeployments = new ConcurrentLinkedQueue<>();
}

From source file:com.ibm.mobilefirstplatform.clientsdk.android.security.mca.internal.AuthorizationProcessManager.java

public AuthorizationProcessManager(Context context, AuthorizationManagerPreferences preferences) {
    this.logger = Logger.getLogger(Logger.INTERNAL_PREFIX + AuthorizationProcessManager.class.getSimpleName());

    this.preferences = preferences;
    this.authorizationQueue = new ConcurrentLinkedQueue<>();
    this.jsonSigner = new DefaultJSONSigner();

    File keyStoreFile = new File(context.getFilesDir().getAbsolutePath(), "mfp.keystore");
    String uuid = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
    certificateStore = new CertificateStore(keyStoreFile, uuid);

    //case where the shared preferences were deleted but the certificate is saved in the keystore
    if (preferences.clientId.get() == null && certificateStore.isCertificateStored()) {
        try {/*from w  w  w.j a va 2  s .co m*/
            X509Certificate certificate = certificateStore.getCertificate();
            preferences.clientId.set(CertificatesUtility.getClientIdFromCertificate(certificate));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    //generate new random session id
    sessionId = UUID.randomUUID().toString();
}

From source file:net.spy.memcached.CouchbaseConnection.java

public CouchbaseConnection(CouchbaseConnectionFactory cf, List<InetSocketAddress> addrs,
        Collection<ConnectionObserver> obs) throws IOException {
    shutDown = false;/*  w w w .  j  a va2  s.  c  o m*/
    connFactory = cf;
    nodesToShutdown = new ConcurrentLinkedQueue<CouchbaseNode>();
    connObservers.addAll(obs);
    nodes = createConnections(addrs);
    nextNode = 0;
    start();
}

From source file:org.apache.tajo.rpc.RpcChannelFactory.java

protected static Queue<EventLoopGroup> createClientEventloopGroups(ClientChannelId clientId, int workerNum) {
    int defaultMaxObjectCount = defaultMaxKeyPoolCount.get(clientId);
    Queue<EventLoopGroup> loopGroupQueue = new ConcurrentLinkedQueue<EventLoopGroup>();
    eventLoopGroupPool.put(clientId, loopGroupQueue);

    for (int objectIdx = 0; objectIdx < defaultMaxObjectCount; objectIdx++) {
        loopGroupQueue.add(createClientEventloopGroup(clientId.name(), workerNum));
    }//  w  w w . j a  va 2 s  .  c o  m

    return loopGroupQueue;
}

From source file:org.apache.hama.bsp.ResourceManager.java

/**
 * Constructor for the mesos resource manager
 * /*from   w  w  w.j a v  a 2s  .  co  m*/
 * @param conf The configuration options for hama
 * @param serverManager A reference to the groom server manager
 * @param driver The mesos driver. This is required to terminate tasks
 */
public ResourceManager(Configuration conf, AtomicReference<GroomServerManager> serverManager,
        SchedulerDriver driver) {
    tasksToRunByGroom = new ConcurrentHashMap<String, java.util.Queue<TaskInProgress>>();
    tasksToRunByGroom.put(anyGroomServer, new ConcurrentLinkedQueue<TaskInProgress>());
    tasksToRun = new HashSet<TaskInProgress>();

    slotMemory = parseMemory(conf);

    taskDelegator = new TaskDelegator(serverManager, driver, recoveryTasks);
    serverManager.get().addGroomStatusListener(taskDelegator);
    this.conf = conf;

    groomCpus = conf.getInt("hama.mesos.groom.cpu", 0);
    groomMem = conf.getInt("hama.mesos.groom.mem", 200);
    groomDisk = conf.getInt("hama.mesos.groom.disk", 0);
}

From source file:org.apache.juddi.replication.ReplicationNotifier.java

/**
 * default constructor// w ww  .  j  av a 2 s . com
 *
 * @throws ConfigurationException
 */
public ReplicationNotifier() throws ConfigurationException {
    super();
    timer = new Timer(true);
    startBuffer = AppConfig.getConfiguration().getLong(Property.JUDDI_REPLICATION_START_BUFFER, 5000l);
    interval = AppConfig.getConfiguration().getLong(Property.JUDDI_REPLICATION_INTERVAL, 5000l);
    timer.scheduleAtFixedRate(this, startBuffer, interval);
    if (queue == null) {
        queue = new ConcurrentLinkedQueue();
    }
    node = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID, "UNDEFINED_NODE_NAME");
}

From source file:org.ramidore.logic.system.PointBattleLogic.java

/**
 * ./*from  w  ww .ja v a  2 s.  c o m*/
 */
public PointBattleLogic() {

    currentStat = new PbStatTable();

    for (int i = 0; i < 6; i++) {
        chartDataQList.add(new ConcurrentLinkedQueue<>());
    }

    pointMap.put(0, 0);

    dupChecker = new DuplicateChecker();
}

From source file:org.datacleaner.components.machinelearning.MLClassificationTrainingAnalyzer.java

@Initialize
public void init() {
    recordCounter = new AtomicInteger();
    trainingRecords = new ConcurrentLinkedQueue<>();
    crossValidationRecords = new ConcurrentLinkedQueue<>();
    featureModifierBuilders = new ArrayList<>(featureModifierTypes.length);

    final int maxFeatures = maxFeaturesGeneratedPerColumn == null ? -1 : maxFeaturesGeneratedPerColumn;
    final MLTrainingConstraints constraints = new MLTrainingConstraints(maxFeatures,
            includeUniqueValueFeatures);
    for (MLFeatureModifierType featureModifierType : featureModifierTypes) {
        final MLFeatureModifierBuilder featureModifierBuilder = featureModifierBuilderFactory
                .create(featureModifierType, constraints);
        featureModifierBuilders.add(featureModifierBuilder);
    }//from   ww  w.  ja  va  2 s .  co  m
}

From source file:net.opentsdb.search.ElasticSearch.java

/**
 * Default constructor//from   w  ww.  ja  va2s  .  co  m
 */
public ElasticSearch() {
    tsuids = new ConcurrentLinkedQueue<TSMeta>();
    tsuids_delete = new ConcurrentLinkedQueue<String>();
    uids = new ConcurrentLinkedQueue<UIDMeta>();
    uids_delete = new ConcurrentLinkedQueue<UIDMeta>();
    annotations = new ConcurrentLinkedQueue<Annotation>();
    annotations_delete = new ConcurrentLinkedQueue<Annotation>();
}

From source file:org.rhq.enterprise.server.plugins.alertSnmp.SnmpSenderTest.java

@BeforeMethod
public void setUp() throws Exception {
    receivedTraps = new ConcurrentLinkedQueue<PDU>();

    snmp = new Snmp(new DefaultUdpTransportMapping());
    Address targetAddress = new UdpAddress(getTestPort());
    boolean installedTrapListener = snmp.addNotificationListener(targetAddress, new CommandResponder() {
        @Override/*www  .  ja v a 2  s  .  c o  m*/
        public void processPdu(CommandResponderEvent event) {
            receivedTraps.offer(event.getPDU());
        }
    });
    if (!installedTrapListener) {
        throw new RuntimeException("Could not install trap listener");
    }

    MockitoAnnotations.initMocks(this);

    pluginConfiguration = new Configuration();
    pluginConfiguration.setSimpleValue("snmpVersion", "2c");
    pluginConfiguration.setSimpleValue("trapOid", TEST_TRAP_OID_PLUGIN_CONFIG);
    pluginConfiguration.setSimpleValue("community", "public");
    snmpSender = new TestSnmpSender(resourceManager, alertManager, pluginConfiguration);
}