- Timestamp:
- 10/01/13 19:28:26 (11 years ago)
- Location:
- branches/supervisor
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/supervisor/src/main/java/omq/supervisor/SupervisorImpl.java
r93 r94 91 91 if (broker.hasObject(reference) && (numObjects - 1) >= minObjects) { 92 92 broker.deleteObject(reference); 93 break; 93 94 } 94 95 } … … 96 97 } catch (Exception io) { 97 98 // The queue doesn't exist & the channel has been closed 98 }99 100 for (RemoteBroker broker : brokers) {101 if (!broker.hasObject(reference) && minObjects >= numObjects) {102 broker.spawnObject(reference, settings.getClassName(), settings.getProps());103 numObjects++;104 if (minObjects >= numObjects) {105 break;106 }107 }108 99 } 109 100 } -
branches/supervisor/src/main/java/omq/supervisor/SupervisorThread.java
r93 r94 55 55 System.out.println("Num Consumers: " + numConsumers + ", num Messages: " + numMessages); 56 56 57 if (maxMessages < numMessages || minObjects < numConsumers) {57 if (maxMessages < numMessages || numConsumers < minObjects ) { 58 58 System.out.println("SPAWN TIME!!"); 59 59 supervisor.spawnObject(settings); 60 60 // spawn: 61 // pregunta a tots i qui no té l'objecte li poses 62 } else if (numMessages < minMessages && minObjects > numConsumers) { 61 // pregunta a tots i qui no t�� l'objecte li poses 62 } else if (numMessages < minMessages && minObjects < numConsumers) { 63 System.out.println("Unbinding object!!!"); 63 64 supervisor.unbindObject(settings); 64 65 // delete: 65 // pregunta a tots i qui t él'objecte li treus66 // pregunta a tots i qui t�� l'objecte li treus 66 67 } 67 68 } -
branches/supervisor/src/test/java/omq/test/supervisor/SleepTest.java
r93 r94 60 60 Supervisor supervisor = broker.lookup("supervisor", Supervisor.class); 61 61 62 OmqSettings settings = new OmqSettings("sleep", SleepImpl.class.getName(), env, 20, 20, 2);62 OmqSettings settings = new OmqSettings("sleep", SleepImpl.class.getName(), env, 1, 20, 20); 63 63 supervisor.spawnObject(settings); 64 64
Note: See TracChangeset
for help on using the changeset viewer.