theState.setCallbackClient(client);
   public Object handleCreateConsumerDelegate(Invocation invocation) throws Throwable   {      MethodInvocation mi = (MethodInvocation)invocation;            boolean isCC = ((Boolean)mi.getArguments()[4]).booleanValue();      //Create the message handler      SessionState sessState =         (SessionState)((DelegateSupport)invocation.getTargetObject()).getState();            ConnectionState connState = (ConnectionState)sessState.getParent();            MessageCallbackHandler messageHandler =         new MessageCallbackHandler(isCC, sessState.getAcknowledgeMode(),                                    sessState.getExecutor(), connState.getPooledExecutor());      Client client = connState.getRemotingConnection().registerCallbackHandler(messageHandler);      log.debug("listener added");      // I will need this on the server-side to create the ConsumerDelegate instance      invocation.getMetaData().addMetaData(MetaDataConstants.JMS,                                           MetaDataConstants.REMOTING_SESSION_ID,                                           client.getSessionId(), PayloadKey.AS_IS);      ConsumerDelegate consumerDelegate = (ConsumerDelegate)invocation.invokeNext();            SessionDelegate del = (SessionDelegate)invocation.getTargetObject();      ConsumerState theState = (ConsumerState)((DelegateSupport)consumerDelegate).getState();               messageHandler.setSessionDelegate(del);      messageHandler.setConsumerDelegate(consumerDelegate);      messageHandler.setConsumerID(theState.getConsumerID());        theState.setMessageCallbackHandler(messageHandler);      theState.setCallbackClient(client);            return consumerDelegate;   }