- Timestamp:
- 07/16/13 23:31:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/util/dispatching/AbstractJoinable.java
r101 r102 18 18 19 19 private static final Logger log = LogManager.getLogger(AbstractJoinable.class); 20 private static final Logger reportLog = LogManager.getLogger(AbstractJoinable.class.getName() + ".Report"); 20 21 21 22 protected final Set<JoinableParent> owners = new HashSet<JoinableParent>(); … … 35 36 } 36 37 38 39 37 40 public static void report() { 41 if (!reportLog.isDebugEnabled()) { 42 return; 43 } 38 44 StringBuilder b = new StringBuilder(); 39 45 synchronized (joinablesRegistry) { … … 42 48 } 43 49 } 44 log.debug("state: {}", b);50 reportLog.debug("state: {}", b); 45 51 } 46 52 … … 53 59 } 54 60 this.state = state; 55 56 log.debug("{} is notifying {} parents", this, joinableListeners.size()); 61 log.debug("{} changed state to {}", this, state); 62 57 63 58 64 List<JoinableParent> parents = new LinkedList<>(); … … 61 67 for (JoinableParent p : parents) { 62 68 if (p != null) { 69 log.debug("{} is notifying parent {} about change to {}", this, p, state); 63 70 Dispatching.childChangedState(p, this, state); 64 71 } … … 110 117 } 111 118 joinableJoin(); 112 synchronized (this) { 113 this.state = JoinableState.JOINED; 114 } 119 changeState(JoinableState.JOINED); 120 // synchronized (this) { 121 // this.state = JoinableState.JOINED; 122 // } 115 123 } 116 124 … … 158 166 synchronized (this) { 159 167 if (!owners.contains(owner)) { 160 return false; 161 // throw new FramsticksException().msg("object is not owning that joinable").arg("joinable", this).arg("object", owner); 168 // log.error("owner {} is not owning that joinable {}", owner, this); 169 // return false; 170 throw new FramsticksException().msg("object is not owning that joinable").arg("joinable", this).arg("object", owner); 162 171 } 163 172 // assert owners.containsKey(owner); 164 log.debug("{} is droping {}", owner, this);165 173 owners.remove(owner); 166 174 stop = owners.isEmpty(); 175 log.debug("{} is droping {} (users remaining: {})", owner, this, owners); 167 176 } 168 177 if (stop) { … … 195 204 @Override 196 205 public String toString() { 197 return get Name();206 return getClass().getSimpleName() + "(" + getName() + ")"; 198 207 } 199 208 … … 203 212 } 204 213 205 206 214 }
Note: See TracChangeset
for help on using the changeset viewer.