- Timestamp:
- 10/11/13 13:44:19 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/supervisor/src/main/java/omq/server/RemoteObject.java
r100 r101 35 35 private transient RemoteThreadPool pool; 36 36 private transient Map<String, List<Class<?>>> params; 37 private transient List<InvocationThread> invocationList;38 37 39 38 private static final Map<String, Class<?>> primitiveClasses = new HashMap<String, Class<?>>(); … … 74 73 } 75 74 76 // Get num threads to use 77 int numThreads = Integer.parseInt(env.getProperty(ParameterQueue.NUM_THREADS, "1")); 78 invocationList = new ArrayList<InvocationThread>(numThreads); 79 80 // Start invocation threads 81 for (int i = 0; i < numThreads; i++) { 82 InvocationThread iThread = new InvocationThread(this, broker); 83 invocationList.add(iThread); 84 iThread.start(); 85 } 86 75 // Get pool information 76 int minPoolThreads = Integer.parseInt(env.getProperty(ParameterQueue.MIN_POOL_THREADS, "1")); 77 int maxPoolThreads = Integer.parseInt(env.getProperty(ParameterQueue.MAX_POOL_THREADS, "1")); 78 long refresh = Long.parseLong(env.getProperty(ParameterQueue.POOL_REFRESH_TIME, "60000")); 79 long keepAliveTime = Long.parseLong(env.getProperty(ParameterQueue.KEEP_ALIVE_TIME, "30000")); 80 int maxMessagesPerThread = Integer.parseInt(env.getProperty(ParameterQueue.MAX_MESSAGES_PER_THREAD, "5")); 81 82 // Create the pool & start it 83 pool = new RemoteThreadPool(minPoolThreads, maxPoolThreads, refresh, keepAliveTime, maxMessagesPerThread, this, broker); 84 pool.start(); 87 85 } 88 86 … … 100 98 public void kill() throws IOException { 101 99 logger.info("Killing objectmq: " + this.getRef()); 102 for (InvocationThread iThread : invocationList) { 103 iThread.kill(); 104 } 100 pool.kill(); 105 101 } 106 102 … … 205 201 } 206 202 203 public RemoteThreadPool getPool() { 204 return pool; 205 } 206 207 207 public Properties getEnv() { 208 208 return env;
Note: See TracChangeset
for help on using the changeset viewer.