Temporarily stops a connection's delivery of incoming messages. Delivery can be restarted using the connection's
start
method. When the connection is stopped, delivery to all the connection's message consumers is inhibited: synchronous receives block, and messages are not delivered to message listeners.
This call blocks until receives and/or message listeners in progress have completed.
Stopping a connection has no effect on its ability to send messages. A call to stop
on a connection that has already been stopped is ignored.
A call to stop
must not return until delivery of messages has paused. This means that a client can rely on the fact that none of its message listeners will be called and that all threads of control waiting for receive
calls to return will not return with a message until the connection is restarted. The receive timers for a stopped connection continue to advance, so receives may time out while the connection is stopped.
If message listeners are running when stop
is invoked, the stop
call must wait until all of them have returned before it may return. While these message listeners are completing, they must have the full services of the connection available to them.
@throws JMSException if the JMS provider fails to stop message deliverydue to some internal error.
@see javax.jms.Connection#start()