Esempio n. 1
0
 /** Signals that no further connections will be added. */
 public void noFurtherConnections() {
   lock.lock();
   try {
     connections.noFurtherConnections();
   } finally {
     lock.unlock();
   }
 }
Esempio n. 2
0
 /**
  * Requests that this message hub commence shutting down. Does the following:
  *
  * <ul>
  *   <li>Stops accepting any further outgoing messages.
  *   <li>If no connections are available, dispatches queued messages to any handlers that
  *       implement {@link RejectedMessageListener}.
  * </ul>
  */
 public void requestStop() {
   lock.lock();
   try {
     if (state != State.Running) {
       return;
     }
     try {
       outgoingQueue.endOutput();
       connections.noFurtherConnections();
     } finally {
       state = State.Stopping;
     }
   } finally {
     lock.unlock();
   }
 }