Changeset 102 for branches/supervisor/src/main
- Timestamp:
- 10/14/13 16:38:34 (11 years ago)
- Location:
- branches/supervisor/src/main/java/omq
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/supervisor/src/main/java/omq/common/util/OmqConnectionFactory.java
r83 r102 57 57 working = true; 58 58 } catch (Exception e) { 59 // e.printStackTrace(); 59 60 logger.error(e); 60 61 long milis = 2000; -
branches/supervisor/src/main/java/omq/common/util/ParameterQueue.java
r101 r102 132 132 */ 133 133 134 /**135 * Set how many threads will be created to invoke remote methods136 */137 public static String NUM_THREADS = "omq.num_threads";138 134 139 135 /** -
branches/supervisor/src/main/java/omq/server/InvocationThread.java
r101 r102 157 157 158 158 } 159 logger.info("ObjectMQ ('" + obj.getRef() + "') InvocationThread " + Thread.currentThread().getId() + " is killed"); 159 160 } 160 161 -
branches/supervisor/src/main/java/omq/server/RemoteThreadPool.java
r101 r102 4 4 import java.util.ArrayList; 5 5 import java.util.List; 6 import java.util.ListIterator; 6 7 import java.util.concurrent.atomic.AtomicInteger; 7 8 … … 102 103 long now = System.currentTimeMillis(); 103 104 104 int i = 0; 105 for (InvocationThread worker : workers) { 106 // Ensure there are at least minThreads available 107 if (workers.size() == minPoolThreads) { 108 break; 109 } 105 ListIterator<InvocationThread> lIter = workers.listIterator(); 106 while (workers.size() > minPoolThreads && lIter.hasNext()) { 107 InvocationThread worker = lIter.next(); 110 108 long lastExec = worker.getLastExecution(); 111 109 System.out.println("last - now = " + (now - lastExec) + " keep alive = " + keepAliveTime); … … 114 112 try { 115 113 worker.kill(); 116 workers.remove(i);114 lIter.remove(); 117 115 } catch (IOException e) { 118 // TODO Auto-generated catch block 119 e.printStackTrace(); 116 logger.error(e); 120 117 } 121 118 122 119 } 123 i++;124 120 } 125 121 }
Note: See TracChangeset
for help on using the changeset viewer.