List of usage examples for java.util.concurrent ConcurrentLinkedQueue ConcurrentLinkedQueue
public ConcurrentLinkedQueue()
From source file:com.p000ison.dev.simpleclans2.exceptions.handling.ExceptionReporterTask.java
public ExceptionReporterTask() { this.queue = new ConcurrentLinkedQueue<ExceptionReport>(); }
From source file:com.gistlabs.mechanize.cache.HttpCacheFilterTest.java
@Test public void confirmConcurrentLinkedQueueOfferSemantics() { ConcurrentLinkedQueue<String> queue = new ConcurrentLinkedQueue<String>(); assertTrue(queue.offer("a")); assertEquals(1, queue.size());//from w ww . j a v a 2 s. co m assertTrue(queue.offer("b")); assertEquals(2, queue.size()); assertEquals("a", queue.peek()); assertTrue(queue.offer("a")); //assertEquals(2, queue.size()); //assertEquals("b", queue.peek()); assertEquals(3, queue.size()); assertEquals("a", queue.peek()); }
From source file:org.apache.streams.console.ConsolePersistWriter.java
public ConsolePersistWriter() { this.persistQueue = new ConcurrentLinkedQueue<StreamsDatum>(); }
From source file:edu.cornell.mannlib.vitro.webapp.reasoner.SimpleReasonerTBoxListener.java
public SimpleReasonerTBoxListener(SimpleReasoner simpleReasoner, String name) { this.simpleReasoner = simpleReasoner; this.name = name; this.stopRequested = false; this.modelUpdates = new ConcurrentLinkedQueue<ModelUpdate>(); this.processingUpdates = false; }
From source file:resourceMonitor.Main.java
@Override public void start() throws Exception { logger.debug("Executing start"); ConcurrentLinkedQueue<AggregatedResults> resultQueue = new ConcurrentLinkedQueue<AggregatedResults>(); Configuration configuration = new Configuration(new SystemInfo()); MonitorResults results = new MonitorResults(resultQueue); logger.debug("Starting monitoring and update result timers and tasks"); this.monitoringTask = new MonitoringTask(configuration, results); this.monitoringTimer.schedule(this.monitoringTask, 0l, (configuration.getCollectionPeriod())); this.uploadResultsTimer.schedule((new UploadResultsTask(configuration, resultQueue)), 0l, (configuration.getUploadResultsPeriod())); }
From source file:motej.OutgoingThread.java
protected OutgoingThread(String btaddress) throws IOException, InterruptedException { super("OutgoingWiimoteThread:" + btaddress); outgoing = (L2CAPConnection) Connector.open( "btl2cap://" + btaddress + ":11;authenticate=false;encrypt=false;master=false", Connector.WRITE); requestQueue = new ConcurrentLinkedQueue<MoteRequest>(); Thread.sleep(THREAD_SLEEP);//from www .j a va2 s. co m active = true; }
From source file:org.apache.streams.console.ConsolePersistReader.java
public ConsolePersistReader() { this.persistQueue = new ConcurrentLinkedQueue<StreamsDatum>(); }
From source file:net.jmhertlein.mcanalytics.plugin.daemon.request.RequestDispatcher.java
public RequestDispatcher(PrivateKey serverKey, X509Certificate serverCert, ClientMonitor owner, DataSource connections, StatementProvider stmts, ExecutorService workers) { this.serverKey = serverKey; this.serverCert = serverCert; this.client = owner; this.workers = workers; writeQueue = new ConcurrentLinkedQueue<>(); this.connections = connections; this.stmts = stmts; }
From source file:br.com.uol.runas.classloader.ClassLoaderGC.java
public ClassLoaderGC() { this.classLoaders = new ConcurrentLinkedQueue<>(); this.executor = Executors.newSingleThreadExecutor(); }
From source file:es.udc.robotcontrol.testapp.comunication.RobotCommController.java
public RobotCommController(Context ctx) { this.ctx = ctx; Log.i(Constantes.TAG_SERVICIO, "Servicio robot creado"); comandos = new ConcurrentLinkedQueue<Comando>(); setReadSleepTime(1000);/*w w w . j ava 2 s.c o m*/ setWriteSleepTime(1000); Toast.makeText(ctx, R.string.robot_service_created, Toast.LENGTH_SHORT).show(); }