- Timestamp:
- 10/09/13 17:35:41 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/supervisor/src/main/java/omq/server/InvocationThread.java
r96 r100 37 37 private String UID; 38 38 private Properties env; 39 private boolean idle; 40 private long lastExec; 41 42 private RemoteThreadPool pool; // TODO posar això bé 39 43 40 44 // Broker … … 54 58 this.broker = broker; 55 59 this.serializer = broker.getSerializer(); 60 this.lastExec = 0; 61 this.idle = true; 56 62 } 57 63 … … 73 79 // Get the delivery 74 80 Delivery delivery = consumer.nextDelivery(); 81 82 // This thread gets busy 83 pool.getBusy().incrementAndGet(); 84 idle = false; 75 85 76 86 String serializerType = delivery.getProperties().getType(); … … 112 122 113 123 channel.basicAck(delivery.getEnvelope().getDeliveryTag(), false); 124 125 // The thread is now idle 126 lastExec = System.currentTimeMillis(); 127 idle = true; 128 pool.getBusy().decrementAndGet(); 129 114 130 } catch (InterruptedException i) { 115 131 logger.error(i); … … 231 247 } 232 248 249 public long getLastExecution() { 250 return lastExec; 251 } 252 253 public boolean isIdle() { 254 return idle; 255 } 256 233 257 }
Note: See TracChangeset
for help on using the changeset viewer.