endpoint.setRemotingClientSessionId(sessionId);
String jmsClientID = (String)mi.getMetaData(MetaDataConstants.JMS, MetaDataConstants.JMS_CLIENT_ID);  if (jmsClientID == null) { throw new IllegalStateException("Can't find jms client id"); }  endpoint.setRemotingInformation(jmsClientID, sessionId);
    public Object handleCreateConnectionDelegate(Invocation invocation) throws Throwable    {       MethodInvocation mi = (MethodInvocation)invocation;              //First we inject the callback client for the connection              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());              //Then we inject the remoting session id of the client       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);              //Then we inject the version number from to be used              Byte ver =          (Byte)mi.getMetaData(MetaDataConstants.JMS,                                 MetaDataConstants.VERSION_NUMBER);              if (ver == null)       {          throw new IllegalStateException("Can't find version");       }              endpoint.setUsingVersion(ver.byteValue());              return del;    }