JMSRemotingConnection connection = new JMSRemotingConnection(serverLocatorURI);
JMSRemotingConnection connection = getRemotingConnection(); nextConnection = null;
   public Object invoke(Invocation invocation) throws Throwable   {      if (log.isTraceEnabled()) { log.trace("invoking " + ((MethodInvocation)invocation).getMethod().getName() + " on server"); }            String methodName = ((MethodInvocation)invocation).getMethod().getName();            Object ret = null;            invocation.getMetaData().addMetaData(Dispatcher.DISPATCHER,            Dispatcher.OID,            new Integer(id), PayloadKey.AS_IS);                        if ("createConnectionDelegate".equals(methodName))      {                  // this must be invoked on the same connection subsequently used by the created JMS         // connection         JMSRemotingConnection connection = new JMSRemotingConnection(serverLocatorURI);                  MethodInvocation mi = (MethodInvocation)invocation;                  Client client = connection.getInvokingClient();                     mi.getMetaData().addMetaData(MetaDataConstants.JMS,                                      MetaDataConstants.REMOTING_SESSION_ID,                                      client.getSessionId(), PayloadKey.AS_IS);                  mi.getMetaData().addMetaData(MetaDataConstants.JMS,                                      MetaDataConstants.JMS_CLIENT_ID,                                      JMSClientIdentifier.instance, PayloadKey.AS_IS);                      try         {                        MessagingMarshallable mm =               (MessagingMarshallable)client.invoke(new MessagingMarshallable(getVersionToUse().getProviderIncrementingVersion(), mi), null);                         ret = mm.getLoad();                        ClientConnectionDelegate delegate = (ClientConnectionDelegate)ret;                        delegate.setConnnectionState(connection);         }         catch (Throwable t)         {            connection.close();                        throw t;         }       }      else      {                  byte v = getVersionToUse().getProviderIncrementingVersion();                     MessagingMarshallable mm = (MessagingMarshallable)            getClient().invoke(new MessagingMarshallable(v, invocation), null);                  ret = mm.getLoad();                                 }      if (log.isTraceEnabled()) { log.trace("got server response for " + ((MethodInvocation)invocation).getMethod().getName()); }      return ret;   }