Search in sources :

Example 26 with LinkedBlockingQueue

use of java.util.concurrent.LinkedBlockingQueue in project druid by druid-io.

the class IrcFirehoseFactory method connect.

@Override
public Firehose connect(final IrcInputRowParser firehoseParser) throws IOException {
    final IRCApi irc = new IRCApiImpl(false);
    final LinkedBlockingQueue<Pair<DateTime, ChannelPrivMsg>> queue = new LinkedBlockingQueue<Pair<DateTime, ChannelPrivMsg>>();
    irc.addListener(new VariousMessageListenerAdapter() {

        @Override
        public void onChannelMessage(ChannelPrivMsg aMsg) {
            try {
                queue.put(Pair.of(DateTime.now(), aMsg));
            } catch (InterruptedException e) {
                throw new RuntimeException("interrupted adding message to queue", e);
            }
        }
    });
    log.info("connecting to irc server [%s]", host);
    irc.connect(new IServerParameters() {

        @Override
        public String getNickname() {
            return nick;
        }

        @Override
        public List<String> getAlternativeNicknames() {
            return Lists.newArrayList(nick + UUID.randomUUID(), nick + UUID.randomUUID(), nick + UUID.randomUUID());
        }

        @Override
        public String getIdent() {
            return "druid";
        }

        @Override
        public String getRealname() {
            return nick;
        }

        @Override
        public IRCServer getServer() {
            return new IRCServer(host, false);
        }
    }, new Callback<IIRCState>() {

        @Override
        public void onSuccess(IIRCState aObject) {
            log.info("irc connection to server [%s] established", host);
            for (String chan : channels) {
                log.info("Joining channel %s", chan);
                irc.joinChannel(chan);
            }
        }

        @Override
        public void onFailure(Exception e) {
            log.error(e, "Unable to connect to irc server [%s]", host);
            throw new RuntimeException("Unable to connect to server", e);
        }
    });
    closed = false;
    return new Firehose() {

        InputRow nextRow = null;

        @Override
        public boolean hasMore() {
            try {
                while (true) {
                    Pair<DateTime, ChannelPrivMsg> nextMsg = queue.poll(100, TimeUnit.MILLISECONDS);
                    if (closed) {
                        return false;
                    }
                    if (nextMsg == null) {
                        continue;
                    }
                    try {
                        nextRow = firehoseParser.parse(nextMsg);
                        if (nextRow != null) {
                            return true;
                        }
                    } catch (IllegalArgumentException iae) {
                        log.debug("ignoring invalid message in channel [%s]", nextMsg.rhs.getChannelName());
                    }
                }
            } catch (InterruptedException e) {
                Thread.interrupted();
                throw new RuntimeException("interrupted retrieving elements from queue", e);
            }
        }

        @Override
        public InputRow nextRow() {
            return nextRow;
        }

        @Override
        public Runnable commit() {
            return new Runnable() {

                @Override
                public void run() {
                // nothing to see here
                }
            };
        }

        @Override
        public void close() throws IOException {
            try {
                log.info("disconnecting from irc server [%s]", host);
                irc.disconnect("");
            } finally {
                closed = true;
            }
        }
    };
}
Also used : VariousMessageListenerAdapter(com.ircclouds.irc.api.listeners.VariousMessageListenerAdapter) Firehose(io.druid.data.input.Firehose) IRCApiImpl(com.ircclouds.irc.api.IRCApiImpl) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) DateTime(org.joda.time.DateTime) ChannelPrivMsg(com.ircclouds.irc.api.domain.messages.ChannelPrivMsg) IOException(java.io.IOException) IRCServer(com.ircclouds.irc.api.domain.IRCServer) IRCApi(com.ircclouds.irc.api.IRCApi) IIRCState(com.ircclouds.irc.api.state.IIRCState) InputRow(io.druid.data.input.InputRow) IServerParameters(com.ircclouds.irc.api.IServerParameters) List(java.util.List) Pair(io.druid.java.util.common.Pair)

Example 27 with LinkedBlockingQueue

use of java.util.concurrent.LinkedBlockingQueue in project jetty.project by eclipse.

the class OverlayedAppProviderTest method testTriageURI.

@Test
public void testTriageURI() throws Exception {
    final BlockingQueue<String> scanned = new LinkedBlockingQueue<String>();
    OverlayedAppProvider provider = new OverlayedAppProvider() {

        protected void removeInstance(String name) {
            scanned.add("removeInstance " + name);
        }

        protected Instance loadInstance(String name, File origin) {
            scanned.add("loadInstance " + name);
            scanned.add(origin.getAbsolutePath());
            return null;
        }

        protected void removeNode() {
            scanned.add("removeNode");
        }

        protected Node loadNode(File origin) {
            scanned.add("loadNode");
            scanned.add(origin.getAbsolutePath());
            return null;
        }

        protected void removeTemplate(String name) {
            scanned.add("removeTemplate " + name);
        }

        protected Template loadTemplate(String name, File origin) {
            scanned.add("loadTemplate " + name);
            scanned.add(origin.getAbsolutePath());
            return null;
        }

        protected void removeWebapp(String name) {
            scanned.add("removeWebapp " + name);
        }

        protected Webapp loadWebapp(String name, File origin) {
            scanned.add("loadWebapp " + name);
            scanned.add(origin.getAbsolutePath());
            return null;
        }

        protected void redeploy() {
        }
    };
    provider.setScanInterval(0);
    provider.setNodeName("nodeA");
    provider.setScanDir(_scan);
    provider.start();
    provider.scan();
    assertTrue(scanned.isEmpty());
    // Add a war
    File war = new File(_webapps, "foo-1.2.3.war");
    touch(war);
    provider.scan();
    provider.scan();
    assertEquals("loadWebapp foo-1.2.3", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals(war.getAbsolutePath(), scanned.poll(1, TimeUnit.SECONDS));
    // Add a template
    File template = new File(_templates, "foo=foo-1.2.3.war");
    touch(template);
    provider.scan();
    provider.scan();
    assertEquals("loadTemplate foo=foo-1.2.3", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals(template.getAbsolutePath(), scanned.poll(1, TimeUnit.SECONDS));
    // Add a node
    File nodeA = new File(_nodes, "nodeA.war");
    touch(nodeA);
    provider.scan();
    provider.scan();
    assertEquals("loadNode", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals(nodeA.getAbsolutePath(), scanned.poll(1, TimeUnit.SECONDS));
    // Add another node
    File nodeB = new File(_nodes, "nodeB.war");
    provider.scan();
    provider.scan();
    assertTrue(scanned.isEmpty());
    // Add an instance
    File instance = new File(_instances, "foo=instance.war");
    touch(instance);
    provider.scan();
    provider.scan();
    assertEquals("loadInstance foo=instance", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals(instance.getAbsolutePath(), scanned.poll(1, TimeUnit.SECONDS));
    // Add a war dir
    File warDir = new File(_webapps, "foo-1.2.3");
    warDir.mkdir();
    File warDirWI = new File(warDir, "WEB-INF");
    warDirWI.mkdir();
    touch(warDirWI, "web.xml");
    provider.scan();
    provider.scan();
    assertEquals("loadWebapp foo-1.2.3", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals(warDir.getAbsolutePath(), scanned.poll(1, TimeUnit.SECONDS));
    // Add a template dir
    File templateDir = new File(_templates, "foo=foo-1.2.3");
    templateDir.mkdir();
    File templateDirWI = new File(templateDir, "WEB-INF");
    templateDirWI.mkdir();
    touch(templateDirWI, "web.xml");
    provider.scan();
    provider.scan();
    assertEquals("loadTemplate foo=foo-1.2.3", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals(templateDir.getAbsolutePath(), scanned.poll(1, TimeUnit.SECONDS));
    // Add a node dir
    File nodeADir = new File(_nodes, "nodeA");
    nodeADir.mkdir();
    File nodeADirWI = new File(nodeADir, "WEB-INF");
    nodeADirWI.mkdir();
    touch(nodeADirWI, "web.xml");
    provider.scan();
    provider.scan();
    assertEquals("loadNode", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals(nodeADir.getAbsolutePath(), scanned.poll(1, TimeUnit.SECONDS));
    // Add another node dir
    File nodeBDir = new File(_nodes, "nodeB");
    nodeBDir.mkdir();
    File nodeBDirWI = new File(nodeBDir, "WEB-INF");
    nodeBDirWI.mkdir();
    touch(nodeBDirWI, "web.xml");
    provider.scan();
    provider.scan();
    assertTrue(scanned.isEmpty());
    // Add an instance dir
    File instanceDir = new File(_instances, "foo=instance");
    instanceDir.mkdir();
    File instanceDirWI = new File(instanceDir, "WEB-INF");
    instanceDirWI.mkdir();
    touch(instanceDirWI, "web.xml");
    provider.scan();
    provider.scan();
    assertEquals("loadInstance foo=instance", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals(instanceDir.getAbsolutePath(), scanned.poll(1, TimeUnit.SECONDS));
    // touch archives will be ignored.
    Thread.sleep(1000);
    touch(war);
    touch(template);
    touch(nodeA);
    touch(nodeB);
    touch(instance);
    provider.scan();
    provider.scan();
    assertTrue(scanned.isEmpty());
    // Touch directories
    for (File d : new File[] { warDir, templateDir, nodeADir, nodeBDir, instanceDir }) touch(d, "WEB-INF/web.xml");
    provider.scan();
    provider.scan();
    assertEquals(8, scanned.size());
    scanned.clear();
    // Remove web dir
    IO.delete(warDir);
    provider.scan();
    provider.scan();
    assertEquals("removeWebapp foo-1.2.3", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals("loadWebapp foo-1.2.3", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals(war.getAbsolutePath(), scanned.poll(1, TimeUnit.SECONDS));
    // Remove template dir
    IO.delete(templateDir);
    provider.scan();
    provider.scan();
    assertEquals("removeTemplate foo=foo-1.2.3", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals("loadTemplate foo=foo-1.2.3", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals(template.getAbsolutePath(), scanned.poll(1, TimeUnit.SECONDS));
    // Remove nodeA dir
    IO.delete(nodeADir);
    provider.scan();
    provider.scan();
    assertEquals("removeNode", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals("loadNode", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals(nodeA.getAbsolutePath(), scanned.poll(1, TimeUnit.SECONDS));
    // Remove nodeB dir
    IO.delete(nodeBDir);
    provider.scan();
    provider.scan();
    assertTrue(scanned.isEmpty());
    // Remove instance dir
    IO.delete(instanceDir);
    provider.scan();
    provider.scan();
    assertEquals("removeInstance foo=instance", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals("loadInstance foo=instance", scanned.poll(1, TimeUnit.SECONDS));
    assertEquals(instance.getAbsolutePath(), scanned.poll(1, TimeUnit.SECONDS));
    // Remove web
    IO.delete(war);
    provider.scan();
    provider.scan();
    assertEquals("removeWebapp foo-1.2.3", scanned.poll(1, TimeUnit.SECONDS));
    // Remove template
    IO.delete(template);
    provider.scan();
    provider.scan();
    assertEquals("removeTemplate foo=foo-1.2.3", scanned.poll(1, TimeUnit.SECONDS));
    // Remove nodeA dir
    IO.delete(nodeA);
    provider.scan();
    provider.scan();
    assertEquals("removeNode", scanned.poll(1, TimeUnit.SECONDS));
    // Remove nodeB dir
    IO.delete(nodeB);
    provider.scan();
    provider.scan();
    assertTrue(scanned.isEmpty());
    // Remove instance dir
    IO.delete(instance);
    provider.scan();
    provider.scan();
    assertEquals("removeInstance foo=instance", scanned.poll(1, TimeUnit.SECONDS));
    provider.scan();
    provider.scan();
    assertTrue(scanned.isEmpty());
}
Also used : LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) File(java.io.File) Test(org.junit.Test)

Example 28 with LinkedBlockingQueue

use of java.util.concurrent.LinkedBlockingQueue in project jetty.project by eclipse.

the class ServerTimeoutsTest method testBlockingTimeoutSmallerThanIdleTimeoutBlockingWriteBlockingTimeoutFires.

@Test
public void testBlockingTimeoutSmallerThanIdleTimeoutBlockingWriteBlockingTimeoutFires() throws Exception {
    long blockingTimeout = 2500;
    httpConfig.setBlockingTimeout(blockingTimeout);
    CountDownLatch handlerLatch = new CountDownLatch(1);
    start(new BlockingWriteHandler(handlerLatch));
    long idleTimeout = 3 * blockingTimeout;
    setServerIdleTimeout(idleTimeout);
    try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class)) {
        BlockingQueue<Callback> callbacks = new LinkedBlockingQueue<>();
        CountDownLatch resultLatch = new CountDownLatch(1);
        client.newRequest(newURI()).onResponseContentAsync((response, content, callback) -> {
            // Do not succeed the callback so the server will block writing.
            callbacks.offer(callback);
        }).send(result -> {
            if (result.isFailed())
                resultLatch.countDown();
        });
        // Blocking write should timeout.
        Assert.assertTrue(handlerLatch.await(2 * blockingTimeout, TimeUnit.MILLISECONDS));
        // After the server stopped sending, consume on the client to read the early EOF.
        while (true) {
            Callback callback = callbacks.poll(1, TimeUnit.SECONDS);
            if (callback == null)
                break;
            callback.succeeded();
        }
        Assert.assertTrue(resultLatch.await(5, TimeUnit.SECONDS));
    }
}
Also used : BadMessageException(org.eclipse.jetty.http.BadMessageException) Request(org.eclipse.jetty.server.Request) ServletException(javax.servlet.ServletException) HttpChannel(org.eclipse.jetty.server.HttpChannel) AbstractHandler(org.eclipse.jetty.server.handler.AbstractHandler) ServletInputStream(javax.servlet.ServletInputStream) AbstractHTTP2ServerConnectionFactory(org.eclipse.jetty.http2.server.AbstractHTTP2ServerConnectionFactory) TimeoutException(java.util.concurrent.TimeoutException) ByteBuffer(java.nio.ByteBuffer) AsyncContext(javax.servlet.AsyncContext) HttpServletRequest(javax.servlet.http.HttpServletRequest) ServletOutputStream(javax.servlet.ServletOutputStream) WriteListener(javax.servlet.WriteListener) DeferredContentProvider(org.eclipse.jetty.client.util.DeferredContentProvider) HttpStatus(org.eclipse.jetty.http.HttpStatus) Callback(org.eclipse.jetty.util.Callback) HttpServletResponse(javax.servlet.http.HttpServletResponse) IOException(java.io.IOException) BlockingQueue(java.util.concurrent.BlockingQueue) Test(org.junit.Test) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) TimeUnit(java.util.concurrent.TimeUnit) CountDownLatch(java.util.concurrent.CountDownLatch) ReadListener(javax.servlet.ReadListener) StacklessLogging(org.eclipse.jetty.util.log.StacklessLogging) Assert(org.junit.Assert) Callback(org.eclipse.jetty.util.Callback) StacklessLogging(org.eclipse.jetty.util.log.StacklessLogging) CountDownLatch(java.util.concurrent.CountDownLatch) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) Test(org.junit.Test)

Example 29 with LinkedBlockingQueue

use of java.util.concurrent.LinkedBlockingQueue in project jetty.project by eclipse.

the class ServerTimeoutsTest method testAsyncWriteIdleTimeoutFires.

@Test
public void testAsyncWriteIdleTimeoutFires() throws Exception {
    CountDownLatch handlerLatch = new CountDownLatch(1);
    start(new AbstractHandler() {

        @Override
        public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
            baseRequest.setHandled(true);
            AsyncContext asyncContext = request.startAsync();
            asyncContext.setTimeout(0);
            ServletOutputStream output = response.getOutputStream();
            output.setWriteListener(new WriteListener() {

                @Override
                public void onWritePossible() throws IOException {
                    output.write(new byte[64 * 1024 * 1024]);
                }

                @Override
                public void onError(Throwable failure) {
                    if (failure instanceof TimeoutException) {
                        asyncContext.complete();
                        handlerLatch.countDown();
                    }
                }
            });
        }
    });
    long idleTimeout = 2500;
    setServerIdleTimeout(idleTimeout);
    BlockingQueue<Callback> callbacks = new LinkedBlockingQueue<>();
    CountDownLatch resultLatch = new CountDownLatch(1);
    client.newRequest(newURI()).onResponseContentAsync((response, content, callback) -> {
        // Do not succeed the callback so the server will block writing.
        callbacks.offer(callback);
    }).send(result -> {
        if (result.isFailed())
            resultLatch.countDown();
    });
    // Async write should timeout.
    Assert.assertTrue(handlerLatch.await(2 * idleTimeout, TimeUnit.MILLISECONDS));
    // After the server stopped sending, consume on the client to read the early EOF.
    while (true) {
        Callback callback = callbacks.poll(1, TimeUnit.SECONDS);
        if (callback == null)
            break;
        callback.succeeded();
    }
    Assert.assertTrue(resultLatch.await(5, TimeUnit.SECONDS));
}
Also used : BadMessageException(org.eclipse.jetty.http.BadMessageException) Request(org.eclipse.jetty.server.Request) ServletException(javax.servlet.ServletException) HttpChannel(org.eclipse.jetty.server.HttpChannel) AbstractHandler(org.eclipse.jetty.server.handler.AbstractHandler) ServletInputStream(javax.servlet.ServletInputStream) AbstractHTTP2ServerConnectionFactory(org.eclipse.jetty.http2.server.AbstractHTTP2ServerConnectionFactory) TimeoutException(java.util.concurrent.TimeoutException) ByteBuffer(java.nio.ByteBuffer) AsyncContext(javax.servlet.AsyncContext) HttpServletRequest(javax.servlet.http.HttpServletRequest) ServletOutputStream(javax.servlet.ServletOutputStream) WriteListener(javax.servlet.WriteListener) DeferredContentProvider(org.eclipse.jetty.client.util.DeferredContentProvider) HttpStatus(org.eclipse.jetty.http.HttpStatus) Callback(org.eclipse.jetty.util.Callback) HttpServletResponse(javax.servlet.http.HttpServletResponse) IOException(java.io.IOException) BlockingQueue(java.util.concurrent.BlockingQueue) Test(org.junit.Test) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) TimeUnit(java.util.concurrent.TimeUnit) CountDownLatch(java.util.concurrent.CountDownLatch) ReadListener(javax.servlet.ReadListener) StacklessLogging(org.eclipse.jetty.util.log.StacklessLogging) Assert(org.junit.Assert) ServletOutputStream(javax.servlet.ServletOutputStream) Request(org.eclipse.jetty.server.Request) HttpServletRequest(javax.servlet.http.HttpServletRequest) HttpServletResponse(javax.servlet.http.HttpServletResponse) AsyncContext(javax.servlet.AsyncContext) IOException(java.io.IOException) CountDownLatch(java.util.concurrent.CountDownLatch) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) AbstractHandler(org.eclipse.jetty.server.handler.AbstractHandler) HttpServletRequest(javax.servlet.http.HttpServletRequest) ServletException(javax.servlet.ServletException) Callback(org.eclipse.jetty.util.Callback) WriteListener(javax.servlet.WriteListener) TimeoutException(java.util.concurrent.TimeoutException) Test(org.junit.Test)

Example 30 with LinkedBlockingQueue

use of java.util.concurrent.LinkedBlockingQueue in project jetty.project by eclipse.

the class ServerTimeoutsTest method testBlockingTimeoutLargerThanIdleTimeoutBlockingWriteIdleTimeoutFires.

@Test
public void testBlockingTimeoutLargerThanIdleTimeoutBlockingWriteIdleTimeoutFires() throws Exception {
    long idleTimeout = 2500;
    long blockingTimeout = 3 * idleTimeout;
    httpConfig.setBlockingTimeout(blockingTimeout);
    CountDownLatch handlerLatch = new CountDownLatch(1);
    start(new BlockingWriteHandler(handlerLatch));
    setServerIdleTimeout(idleTimeout);
    try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class)) {
        BlockingQueue<Callback> callbacks = new LinkedBlockingQueue<>();
        CountDownLatch resultLatch = new CountDownLatch(1);
        client.newRequest(newURI()).onResponseContentAsync((response, content, callback) -> {
            // Do not succeed the callback so the server will block writing.
            callbacks.offer(callback);
        }).send(result -> {
            if (result.isFailed())
                resultLatch.countDown();
        });
        // Blocking read should timeout.
        Assert.assertTrue(handlerLatch.await(2 * idleTimeout, TimeUnit.MILLISECONDS));
        // After the server stopped sending, consume on the client to read the early EOF.
        while (true) {
            Callback callback = callbacks.poll(1, TimeUnit.SECONDS);
            if (callback == null)
                break;
            callback.succeeded();
        }
        Assert.assertTrue(resultLatch.await(5, TimeUnit.SECONDS));
    }
}
Also used : BadMessageException(org.eclipse.jetty.http.BadMessageException) Request(org.eclipse.jetty.server.Request) ServletException(javax.servlet.ServletException) HttpChannel(org.eclipse.jetty.server.HttpChannel) AbstractHandler(org.eclipse.jetty.server.handler.AbstractHandler) ServletInputStream(javax.servlet.ServletInputStream) AbstractHTTP2ServerConnectionFactory(org.eclipse.jetty.http2.server.AbstractHTTP2ServerConnectionFactory) TimeoutException(java.util.concurrent.TimeoutException) ByteBuffer(java.nio.ByteBuffer) AsyncContext(javax.servlet.AsyncContext) HttpServletRequest(javax.servlet.http.HttpServletRequest) ServletOutputStream(javax.servlet.ServletOutputStream) WriteListener(javax.servlet.WriteListener) DeferredContentProvider(org.eclipse.jetty.client.util.DeferredContentProvider) HttpStatus(org.eclipse.jetty.http.HttpStatus) Callback(org.eclipse.jetty.util.Callback) HttpServletResponse(javax.servlet.http.HttpServletResponse) IOException(java.io.IOException) BlockingQueue(java.util.concurrent.BlockingQueue) Test(org.junit.Test) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) TimeUnit(java.util.concurrent.TimeUnit) CountDownLatch(java.util.concurrent.CountDownLatch) ReadListener(javax.servlet.ReadListener) StacklessLogging(org.eclipse.jetty.util.log.StacklessLogging) Assert(org.junit.Assert) Callback(org.eclipse.jetty.util.Callback) StacklessLogging(org.eclipse.jetty.util.log.StacklessLogging) CountDownLatch(java.util.concurrent.CountDownLatch) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) Test(org.junit.Test)

Aggregations

LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)233 Test (org.junit.Test)79 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)58 IOException (java.io.IOException)22 Emitter (io.socket.emitter.Emitter)19 ArrayList (java.util.ArrayList)19 JSONObject (org.json.JSONObject)19 CountDownLatch (java.util.concurrent.CountDownLatch)18 ThreadFactory (java.util.concurrent.ThreadFactory)14 ExecutorService (java.util.concurrent.ExecutorService)13 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)13 URI (java.net.URI)11 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)11 Intent (android.content.Intent)9 BlockingQueue (java.util.concurrent.BlockingQueue)9 HashMap (java.util.HashMap)8 AtomicLong (java.util.concurrent.atomic.AtomicLong)8 PendingIntent (android.app.PendingIntent)7 ComponentName (android.content.ComponentName)7 ServiceConnection (android.content.ServiceConnection)7