@Override public Connection atPrio (int priority) { if (_owner == null) throw new IllegalStateException( "Cannot change priority of disconnected connection."); _owner.disconnect(this); next = null; _priority = priority; _owner.addCons(this); return this; }
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 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; }
@Override public void close () { // multiple disconnects are OK, we just NOOP after the first one if (_owner != null) { _ref.defang(_owner.placeholderListener()); _owner.disconnect(this); _owner = null; } }
public void run () { _listeners = Cons.remove(_listeners, cons); connectionRemoved(); } });
public void run () { Reactor.this.notify(notifier, a1, a2, a3); } });
protected static Runs append (Runs head, Runs action) { if (head == null) return action; head.next = append(head.next, action); return head; }
/** * 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 addConnection (RListener listener) { if (listener == null) throw new NullPointerException("Null listener"); return addCons(new Cons(this, listener)); }
public void run () { _listeners = Cons.insert(_listeners, cons); connectionAdded(); } });
@Override public void close () { // multiple disconnects are OK, we just NOOP after the first one if (_owner != null) { _ref.defang(_owner.placeholderListener()); _owner.disconnect(this); _owner = null; } }
public void run () { _listeners = Cons.remove(_listeners, cons); connectionRemoved(); } });
public void run () { Reactor.this.notify(notifier, a1, a2, a3); } });
protected static Runs append (Runs head, Runs action) { if (head == null) return action; head.next = append(head.next, action); return head; }
/** * 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 addConnection (RListener listener) { if (listener == null) throw new NullPointerException("Null listener"); return addCons(new Cons(this, listener)); }
public void run () { _listeners = Cons.insert(_listeners, cons); connectionAdded(); } });
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(); } }