Package java.util.concurrent

Examples of java.util.concurrent.ThreadPoolExecutor.execute()


              index.hasPositions, index.termProcessor, index.field, ( documentSizes ? new RemoteSizeList( localSocketAddress, index.numberOfDocuments ) : null ), index.properties ), dos );
        dos.flush();
        break;
     
      case GET_INDEX_READER:
        threadPool.execute( new RemoteIndexReader.ServerThread( socket, index ) );
        break;

     
      case GET_TERM_MAP:
        threadPool.execute( new RemoteTermMap.ServerThread( socket, ((BitStreamIndex)index).termMap ) );
View Full Code Here


        threadPool.execute( new RemoteIndexReader.ServerThread( socket, index ) );
        break;

     
      case GET_TERM_MAP:
        threadPool.execute( new RemoteTermMap.ServerThread( socket, ((BitStreamIndex)index).termMap ) );
        break;

      case GET_PREFIX_MAP:
        threadPool.execute( new RemotePrefixMap.ServerThread( socket, ((BitStreamIndex)index).prefixMap ) );
        break;
View Full Code Here

      case GET_TERM_MAP:
        threadPool.execute( new RemoteTermMap.ServerThread( socket, ((BitStreamIndex)index).termMap ) );
        break;

      case GET_PREFIX_MAP:
        threadPool.execute( new RemotePrefixMap.ServerThread( socket, ((BitStreamIndex)index).prefixMap ) );
        break;

      case GET_SIZE_LIST:
        threadPool.execute( new RemoteSizeList.ServerThread( socket, index.sizes ) );
        break;
View Full Code Here

      case GET_PREFIX_MAP:
        threadPool.execute( new RemotePrefixMap.ServerThread( socket, ((BitStreamIndex)index).prefixMap ) );
        break;

      case GET_SIZE_LIST:
        threadPool.execute( new RemoteSizeList.ServerThread( socket, index.sizes ) );
        break;
       
      case GET_OFFSET_LIST:
        threadPool.execute( new RemoteOffsetList.ServerThread( socket, ((BitStreamIndex)index).offsets ) );
        break;
View Full Code Here

      case GET_SIZE_LIST:
        threadPool.execute( new RemoteSizeList.ServerThread( socket, index.sizes ) );
        break;
       
      case GET_OFFSET_LIST:
        threadPool.execute( new RemoteOffsetList.ServerThread( socket, ((BitStreamIndex)index).offsets ) );
        break;
       
      case GET_CLIENT_INPUT_STREAM:
        threadPool.execute( new RemoteInputStream.ServerThread( socket, ((BitStreamIndex)index).getInputStream() ) );
        break;
View Full Code Here

        new LinkedBlockingQueue<Runnable>());
      NamedThreadFactory threadFactory = new NamedThreadFactory("Thread_Pool_"+poolName);
      threadPoolExecutor.setThreadFactory(threadFactory);
      poolMap.put(poolName, threadPoolExecutor);
    }
    threadPoolExecutor.execute(task);
  }
 
  public static ThreadPoolExecutor getPool(String poolName) {
    return (ThreadPoolExecutor) poolMap.get(poolName);
  }
View Full Code Here

            results.add(e);
          }
        }
      };
     
      threadPool.execute(r);
    }

    threadPool.shutdown();
    try {
      threadPool.awaitTermination(Integer.MAX_VALUE, TimeUnit.DAYS);
View Full Code Here

                        runnable.setTestMode(true);
                        runnable.setTestExitValue(EXIT_VAL_CMDEXEC_INTERRUPTED);
                        runnable.setTestOutput(new Vector<String>());
                        try {
                            Debug.trace("Cancel task: " + runnable.getTaskName());
                            tmp.execute(runnable);
                            tmp.remove(runnable);
                        } catch (Exception e) {
                            Debug.error("Failed to cancel task: " + runnable.getTaskName());
                        }
                    }
View Full Code Here

    ThreadPoolExecutor executor = executors.get(root);
    if (executor == null) {
      throw new RuntimeException("Cannot find root " + root
          + " for execution of task " + task);
    } else {
      executor.execute(task);
    }
  }
 
  /**
   * Gracefully start the shut down of all ThreadPools.
View Full Code Here

                                                             new ArrayBlockingQueue<Runnable>(6));
        CountDownLatch startSignal = new CountDownLatch(1);
        CountDownLatch controlDoneSignal = new CountDownLatch(5);
        CountDownLatch helloDoneSignal = new CountDownLatch(5);
       
        executor.execute(new ControlWorker(helloPort, "Fred", startSignal, controlDoneSignal));
        executor.execute(new HelloWorker(helloPort, "Fred", "", startSignal, helloDoneSignal));
       
        executor.execute(new ControlWorker(helloPort, "Barry", startSignal, controlDoneSignal));
        executor.execute(new HelloWorker(helloPort, "Barry", "Jameson", startSignal, helloDoneSignal));
       
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.