Register callback handlers with pull callbacks
A pull callback connection is implemented by an object (an org.jboss.remoting.callback.ServerInvokerCallbackHandler) on the server side which stores information that is generated asynchronously on the server and subsequently retrieved by the client. It is set up by invoking one of the following overloaded addListener() methods in the Client class: public void addListener( InvokerCallbackHandler) throws Throwable; public void addListener( InvokerCallbackHandler callbackHandler, InvokerLocator clientLocator) throws Throwable; public void addListener( InvokerCallbackHandler callbackHandler, InvokerLocator clientLocator, Object callbackHandlerObject) throws Throwable; where, in the latter two cases, the clientLocator parameter is set to null. The callbacks stored for a pull callback connection may be retrieved by calling the public List getCallbacks(InvokerCallbackHandler callbackHandler) throws Throwable method of the Client class. Note that for pull callbacks, the InvokerCallbackHandler registered on the client side doesn't really participate in the handling of callbacks. However, when client.getCallbacks(callbackHandler) is called for a particular Client and InvokerCallbackHandler, the two objects together identify a particular callback connection. Note. As of Remoting version 2.4 there are two versions of pull callbacks: non-blocking (original) and blocking (new). [The new version has been ported to Remoting release 2.2.2.GA, so it exists in later versions of the 2.2 family]. In the original, non-blocking mode, a call to Client.getCallbacks() will return more or less immediately, whether or not any callbacks are waiting on the server side. In the new, blocking mode, the call will block on the server side until either it times out or a callback becomes available. The blocking mode eliminates the overhead of busy polling. Blocking and non-blocking mode are configured on a per-invocation basis by setting org.jboss.remoting.ServerInvoker.BLOCKING_MODE (actual value "blockingMode") to either ServerInvoker.BLOCKING (actual value "blocking") or ServerInvoker.NONBLOCKING (actual value "nonblocking") in the metadata map passed to public List getCallbacks( InvokerCallbackHandler callbackHandler, Map metadata) throws Throwable; in org.jboss.remoting.Client. The default value is ServerInvoker.NONBLOCKING. The blocking timeout value may be configured in two ways: the Connector can be configured with a default value; and a per-invocation timeout value can be configured with the key ServerInvoker.BLOCKING_TIMEOUT in the metadata map passed to Client.getCallbacks(). In the absence of any configured timeout, the default value is 5000 ms.