/** * Clears all connections from this reactor. This is not used in normal circumstances, but is * made available for libraries which build on react and need a way to forcibly disconnect all * connections to reactive state. * * @throws IllegalStateException if this reactor is in the middle of dispatching an event. */ public synchronized void clearConnections () { if (isDispatching()) throw new IllegalStateException( "Cannot clear connections while dispatching."); assert _pendingRuns == null; _listeners = null; }
/** * Clears all connections from this reactor. This is not used in normal circumstances, but is * made available for libraries which build on react and need a way to forcibly disconnect all * connections to reactive state. * * @throws IllegalStateException if this reactor is in the middle of dispatching an event. */ public synchronized void clearConnections () { if (isDispatching()) throw new IllegalStateException( "Cannot clear connections while dispatching."); assert _pendingRuns == null; _listeners = null; }
protected synchronized Cons addCons (final Cons cons) { if (isDispatching()) { _pendingRuns = append(_pendingRuns, new Runs() { public void run () { _listeners = Cons.insert(_listeners, cons); connectionAdded(); } }); } else { _listeners = Cons.insert(_listeners, cons); connectionAdded(); } return cons; }
protected synchronized void disconnect (final Cons cons) { if (isDispatching()) { _pendingRuns = append(_pendingRuns, new Runs() { public void run () { _listeners = Cons.remove(_listeners, cons); connectionRemoved(); } }); } else { _listeners = Cons.remove(_listeners, cons); connectionRemoved(); } }
protected synchronized void removeConnection (final RListener listener) { if (isDispatching()) { _pendingRuns = append(_pendingRuns, new Runs() { public void run () { _listeners = Cons.removeAll(_listeners, listener); connectionRemoved(); } }); } else { _listeners = Cons.removeAll(_listeners, listener); connectionRemoved(); } }
protected synchronized void removeConnection (final RListener listener) { if (isDispatching()) { _pendingRuns = append(_pendingRuns, new Runs() { public void run () { _listeners = Cons.removeAll(_listeners, listener); connectionRemoved(); } }); } else { _listeners = Cons.removeAll(_listeners, listener); connectionRemoved(); } }
protected synchronized void disconnect (final Cons cons) { if (isDispatching()) { _pendingRuns = append(_pendingRuns, new Runs() { public void run () { _listeners = Cons.remove(_listeners, cons); connectionRemoved(); } }); } else { _listeners = Cons.remove(_listeners, cons); connectionRemoved(); } }
protected synchronized Cons addCons (final Cons cons) { if (isDispatching()) { _pendingRuns = append(_pendingRuns, new Runs() { public void run () { _listeners = Cons.insert(_listeners, cons); connectionAdded(); } }); } else { _listeners = Cons.insert(_listeners, cons); connectionAdded(); } return cons; }