if (log.isTraceEnabled()) { log.trace("client is null"); }
   public Object invoke(Invocation invocation) throws Throwable   {      Client client = (Client)invocation.getMetaData(REMOTING, CLIENT);            if (log.isTraceEnabled()) { log.trace("In RemotingClientInterceptor"); }      if (client == null)      {         //We shouldn't have to do this programmatically - it should pick it up from the params         //on the locator uri, but that doesn't seem to work         Marshaller marshaller = new org.jboss.invocation.unified.marshall.InvocationMarshaller();         UnMarshaller unmarshaller = new org.jboss.invocation.unified.marshall.InvocationUnMarshaller();         MarshalFactory.addMarshaller("invocation", marshaller, unmarshaller);                           if (log.isTraceEnabled()) { log.trace("client is null"); }         InvokerLocator locator = (InvokerLocator)invocation.getMetaData(REMOTING, INVOKER_LOCATOR);         if (locator == null)         {            throw new RuntimeException("No InvokerLocator supplied.  Can't invoke remotely!");         }         if (log.isTraceEnabled()) { log.trace("Locator is:" + locator); }         String subsystem = (String)invocation.getMetaData(REMOTING, SUBSYSTEM);         if (subsystem == null)         {            throw new RuntimeException("No subsystem supplied.  Can't invoke remotely!");         }         if (log.isTraceEnabled()) { log.trace("Subsystem is:" + subsystem); }         client = new Client(locator, subsystem);         if (log.isTraceEnabled()) { log.trace("Created client"); }                        invocation.getMetaData().addMetaData(REMOTING, CLIENT, client, PayloadKey.TRANSIENT);         getHandler(invocation).metadata.addMetaData(REMOTING, CLIENT, client, PayloadKey.TRANSIENT);      }      return invocation.invokeNext();   }