Examples of Executor


Examples of java.util.concurrent.Executor

public class AHessianJmxServer
{
  public AHessianJmxServer(MBeanServer mbeanServer, String ipFilter, String serviceDiscoveryName, int port, Logger log)
  {
    Executor executor = Executors.newFixedThreadPool(10);

    // Configure the server.
    ServerBootstrap bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(executor, executor));

    bootstrap
View Full Code Here

Examples of java.util.concurrent.Executor

    {
      e.printStackTrace();
    }
    InputStreamReader isr = new InputStreamReader(reader);
    final BufferedReader br = new BufferedReader(isr);
    Executor executor = Executors.newCachedThreadPool(new DaemonThreadFactory("test"));
    executor.execute(new Runnable()
    {

      public void run()
      {
        String line = null;
View Full Code Here

Examples of java.util.concurrent.Executor

  };

  HubServiceServer(int port, String acl, HashMap<String, AsyncServiceManagerServer>proxies)
  {
    _proxies = proxies;
        Executor executor = Executors.newFixedThreadPool(200);

        // Configure the server.
        ServerBootstrap bootstrap = new ServerBootstrap(
                new OioServerSocketChannelFactory(
                    executor,
View Full Code Here

Examples of java.util.concurrent.Executor

      FSDataInputStream is = fs.open(path);
      long fileSize = fs.getFileStatus(path).getLen();
      HFileBlock.FSReader hbr = new HFileBlock.FSReaderV2(is, compressAlgo,
          fileSize);

      Executor exec = Executors.newFixedThreadPool(NUM_READER_THREADS);
      ExecutorCompletionService<Boolean> ecs =
          new ExecutorCompletionService<Boolean>(exec);

      for (int i = 0; i < NUM_READER_THREADS; ++i) {
        ecs.submit(new BlockReaderThread("reader_" + (char) ('A' + i), hbr,
View Full Code Here

Examples of java.util.concurrent.Executor

*/
public class PollingIoProcessorTest {
    @Ignore
    @Test
    public void testExceptionOnWrite() throws Exception {
        final Executor ex = Executors.newFixedThreadPool(1);

        IoConnector connector = new NioSocketConnector(
                new AbstractPollingIoProcessor<NioSession>(ex) {

                    private NioProcessor proc = new NioProcessor(ex);
View Full Code Here

Examples of java.util.concurrent.Executor

                    @Override
                    protected void doSetAll(IoSessionConfig config) {
                        // Do nothing
                    }
                },
                new Executor() {
                    public void execute(Runnable command) {
                        // Do nothing
                    }
                }) {
View Full Code Here

Examples of java.util.concurrent.Executor

           
            public int getCount() {
                return count.get();
            }
        }
        Executor executor = new TestExecutor();
        service.setExecutor(executor);
        assertNotNull(service);
        assertSame(executor, service.getExecutor());
       
       
View Full Code Here

Examples of java.util.concurrent.Executor

            };
            HTTPClientPolicy policy = getClient(outMessage);
            boolean exceptionSet = outMessage.getContent(Exception.class) != null;
            if (!exceptionSet) {
                try {
                    Executor ex = outMessage.getExchange().get(Executor.class);
                    if (forceWQ && ex != null) {
                        final Executor ex2 = ex;
                        final Runnable origRunnable = runnable;
                        runnable = new Runnable() {
                            public void run() {
                                outMessage.getExchange().put(Executor.class.getName()
                                                             + ".USING_SPECIFIED", Boolean.TRUE);
                                ex2.execute(origRunnable);
                            }
                        };
                    }
                    if (ex == null || forceWQ) {
                        WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
View Full Code Here

Examples of java.util.concurrent.Executor

                }
            }

        };
       
        Executor executor = getExecutor(endpoint);
        Executor executor2 = exchange.get(Executor.class);
        if (executor2 == executor || executor == null) {
            // already executing on the appropriate executor
            invocation.run();
        } else {
            exchange.put(Executor.class, executor);
View Full Code Here

Examples of java.util.concurrent.Executor

    public DefaultArtifactResolver()
    {
        int threads = Integer.getInteger( "maven.artifact.threads", 5 ).intValue();
        if ( threads <= 1 )
        {
            executor = new Executor()
            {
                public void execute( Runnable command )
                {
                    command.run();
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.