Ignore:
Timestamp:
07/16/13 23:31:35 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

for Joinables running

CHANGELOG:
Add WorkPackageLogic? and classes representing prime experiment state.

Add classes for PrimeExperiment? state.

Extract single netload routine in Simulator.

Working netload with dummy content in PrimeExperiment?.

More development with NetLoadSaveLogic? and PrimeExperiment?.

Improvement around prime.

Improve BufferedDispatcher?.isActive logic.

Add prime-all.xml configuration.

Manual connecting to existing simulators from GUI.

Guard in SimulatorConnector? against expdef mismatch.

Guard against empty target dispatcher in BufferedDispatcher?.

Make BufferedDispatcher? a Dispatcher (and Joinable).

Minor improvements.

Done StackedJoinable?, improve Experiment.

Develop StackedJoinable?.

Add StackedJoinable? utility joinables controller.

Add dependency on apache-commons-lang.

Add ready ListChange? on Simulators.

Improve hints in ListChange?.

Several improvements.

Found bug with dispatching in Experiment.

Minor improvements.

Fix bug with early finishing Server.

Many changes in Dispatching.

Fix bug with connection.

Do not obfuscate log with socket related exceptions.

Add SocketClosedException?.

Add SimulatorConnector?.

Work out conception of experiment composing of logics building blocks.

Rename SinkInterface? to Sink.

Move saving of Accesses into AccessOperations?.

Some improvements to Experiment.

Improve joinables.

Fix issue with joinables closing.

Add direct and managed consoles to popup menu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/util/dispatching/JoinableCollection.java

    r101 r102  
    2121        protected final Set<T> joinables = new HashSet<T>();
    2222
    23         protected boolean finishIfOne;
     23        public static enum FinishPolicy {
     24                Never,
     25                OnFirst,
     26                OnAll
     27        };
     28
     29        protected final FinishPolicy finishPolicy;
    2430
    2531        protected String observableName;
    2632
    2733        public JoinableCollection() {
    28                 this(false);
    29         }
    30 
    31         public JoinableCollection(boolean finishIfOne) {
    32                 this.finishIfOne = finishIfOne;
     34                this(FinishPolicy.OnAll);
     35        }
     36
     37
     38        /**
     39         * @param finishPolicy
     40         */
     41        public JoinableCollection(FinishPolicy finishPolicy) {
     42                this.finishPolicy = finishPolicy;
    3343        }
    3444
     
    95105
    96106        protected JoinableState getNextState() {
    97                 if (joinables.isEmpty()) {
     107                if ((finishPolicy == FinishPolicy.Never && state == JoinableState.RUNNING) || joinables.isEmpty()) {
    98108                        return state;
    99109                }
    100                 JoinableState result = finishIfOne ? JoinableState.INITILIAZED : JoinableState.JOINED;
     110                boolean oneIsEnough = (finishPolicy == FinishPolicy.OnFirst);
     111                JoinableState result = oneIsEnough ? JoinableState.INITILIAZED : JoinableState.JOINED;
    101112                for (Joinable j : joinables) {
    102113                        JoinableState s = j.getState();
    103                         if (finishIfOne) {
     114                        if (oneIsEnough) {
    104115                                if (s.ordinal() > result.ordinal()) {
    105116                                        result = s;
Note: See TracChangeset for help on using the changeset viewer.