- Timestamp:
- 07/04/13 20:29:50 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/util/dispatching/AbstractJoinable.java
r90 r96 14 14 import com.framsticks.util.FramsticksException; 15 15 16 17 18 16 public abstract class AbstractJoinable implements Joinable { 17 19 18 private static final Logger log = Logger.getLogger(AbstractJoinable.class); 20 21 19 22 20 protected final Set<JoinableParent> owners = new HashSet<JoinableParent>(); … … 25 23 protected static final Set<AbstractJoinable> joinablesRegistry = Collections.synchronizedSet(new HashSet<AbstractJoinable>()); 26 24 27 JoinableState state = JoinableState.INITILIAZED; 25 protected JoinableState state = JoinableState.INITILIAZED; 26 protected JoinableParent parent; 27 protected Monitor monitor; 28 28 29 29 /** … … 53 53 this.state = state; 54 54 55 synchronized (this) { 56 log.debug(this + " is notifying " + joinableListeners.size() + " parents"); 57 58 List<JoinableParent> parents = new LinkedList<>(); 59 CollectionUtils.addAll(parents, joinableListeners.iterator()); 60 61 for (JoinableParent p : parents) { 62 if (p != null) { 63 Dispatching.childChangedState(p, this, state); 64 } 65 } 66 this.notifyAll(); 67 } 55 log.debug(this + " is notifying " + joinableListeners.size() + " parents"); 56 57 List<JoinableParent> parents = new LinkedList<>(); 58 CollectionUtils.addAll(parents, joinableListeners.iterator()); 59 60 for (JoinableParent p : parents) { 61 if (p != null) { 62 Dispatching.childChangedState(p, this, state); 63 } 64 } 65 this.notifyAll(); 66 68 67 report(); 69 68 … … 145 144 } 146 145 if (start) { 146 assert monitor == null; 147 monitor = owner.getMonitor(); 147 148 return this.start(); 148 149 } … … 185 186 } 186 187 188 protected boolean isRunning() { 189 return state.equals(JoinableState.RUNNING); 190 } 191 192 @Override 193 public String toString() { 194 return getName(); 195 } 196 197 // @Override 198 public Monitor getMonitor() { 199 return monitor; 200 } 201 187 202 188 203 }
Note: See TracChangeset
for help on using the changeset viewer.