Ignore:
Timestamp:
10/21/13 15:27:22 (11 years ago)
Author:
stoda
Message:

Refactoring to enable multinvocation thread done.
Now there's a multiinvocation thread which listens to the multiqueue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/supervisor/src/main/java/omq/server/RemoteThreadPool.java

    r102 r108  
    2323        private static final Logger logger = Logger.getLogger(RemoteThreadPool.class.getName());
    2424        private List<InvocationThread> workers;
     25        private MultiInvocationThread multiWorker;
    2526        private AtomicInteger busy;
    2627        private int minPoolThreads;
     
    3435        private boolean killed = false;
    3536
    36         public RemoteThreadPool(int minPoolThreads, int maxPoolThreads, long refresh, long keepAliveTime, int maxMessagesPerThread, RemoteObject obj, Broker broker) {
     37        public RemoteThreadPool(int minPoolThreads, int maxPoolThreads, long refresh, long keepAliveTime, int maxMessagesPerThread,
     38                        RemoteObject obj, Broker broker) {
    3739                this.minPoolThreads = minPoolThreads;
    3840                this.maxPoolThreads = maxPoolThreads;
     
    5355                 * Create and start minPoolThreads
    5456                 */
    55                 logger.info("ObjectMQ reference: " + obj.getRef() + ", creating: " + minPoolThreads + ", maxPoolThreads: " + maxPoolThreads + ", refresh time: "
    56                                 + refresh + ", keepAlive: " + keepAliveTime + ", maxMessagesPerThread: " + maxMessagesPerThread);
     57                logger.info("ObjectMQ reference: " + obj.getRef() + ", creating: " + minPoolThreads + ", maxPoolThreads: " + maxPoolThreads
     58                                + ", refresh time: " + refresh + ", keepAlive: " + keepAliveTime + ", maxMessagesPerThread: " + maxMessagesPerThread);
     59
     60                try {
     61                        multiWorker = new MultiInvocationThread(obj);
     62                        multiWorker.start();
     63                } catch (Exception e1) {
     64                        // TODO Auto-generated catch block
     65                        e1.printStackTrace();
     66                }
    5767
    5868                for (int i = 0; i < minPoolThreads; i++) {
     
    8696                                } else if (numWorkers > minPoolThreads && busy.get() < numWorkers) {
    8797                                        // Kill idle threads
    88                                         System.out.println("Kill lazy workers, numWorkers = " + numWorkers + ", minPool = " + minPoolThreads + ", busy = " + busy.get());
     98                                        System.out.println("Kill lazy workers, numWorkers = " + numWorkers + ", minPool = " + minPoolThreads + ", busy = "
     99                                                        + busy.get());
    89100                                        stopIdleThreads();
    90101                                }
Note: See TracChangeset for help on using the changeset viewer.