Identify the client side of a callback connection
The client side of a callback connection is identified in one of two ways, according to whether there is a callback Connector associated with the connection. If the connection has a callback Connector, then it is identifed by the combination of the Connector and the InvokerCallbackHandler. It follows that if an InvokerCallbackHandler is registered twice with the same Connector (through a call to Client.addListener()), only a single callback connection is created. That is, the second call has no effect. If there is no callback Connector, which is the case for pull callbacks and simulated push callbacks (see Section Registering callback handlers), then the callback connection is identified by the combination of the Client on which addListener() was invoked and the InvokerCallbackHandler. It follows that if an InvokerCallbackHandler is registered twice with the same Client for pull or simulated push callbacks, only a single callback connection is created. That is, the second call has no effect. Each callback connection is tagged with a unique identifier, which can be retrieved from the InvokerCallbackHandler passed to ServerInvocationHandler.addListener() by casting it to type org.jboss.remoting.callback.ServerInvokerCallbackHandler and calling getCallbackSessionId(). It is also possible to retrieve the unique identifier of the Client upon which addListener() was invoked by casting the InvokerCallbackHandler to type ServerInvokerCallbackHandler and calling getClientSessionId().