String sessionId = (String)mi.getMetaData(MetaDataConstants.JMS, MetaDataConstants.REMOTING_SESSION_ID);  if (sessionId == null) { throw new IllegalStateException("Can't find session id"); }  endpoint.setRemotingClientSessionId(sessionId);
    public Object handleCreateConnectionDelegate(Invocation invocation) throws Throwable    {       MethodInvocation mi = (MethodInvocation)invocation;              ServerInvokerCallbackHandler handler =          (ServerInvokerCallbackHandler)mi.getMetaData(MetaDataConstants.JMS,                                                 MetaDataConstants.CALLBACK_HANDLER);              if (handler == null)       {          throw new IllegalStateException("Can't find handler");       }              ClientConnectionDelegate del = (ClientConnectionDelegate)invocation.invokeNext();              ConnectionAdvised advised =           (ConnectionAdvised)JMSDispatcher.instance.getRegistered(new Integer(del.getID()));              ServerConnectionEndpoint endpoint = (ServerConnectionEndpoint)advised.getEndpoint();              endpoint.setCallbackClient(handler.getCallbackClient());              return del;    }