1 7 package org.jboss.aspects.remoting.interceptors.transport; 8 9 import org.jboss.aop.advice.Interceptor; 10 import org.jboss.aop.joinpoint.Invocation; 11 import org.jboss.aspects.remoting.interceptors.invoker.RemotingInterceptorFactory; 12 import org.jboss.remoting.Client; 13 import org.jboss.remoting.marshal.Marshaller; 14 15 18 public class TransportInterceptor implements Interceptor 19 { 20 private Client client; 21 22 public TransportInterceptor(Client client) 23 { 24 this.client = client; 25 } 26 27 public String getName() 28 { 29 return "TransportInterceptor"; 30 } 31 32 public Object invoke(Invocation invocation) throws Throwable 33 { 34 Marshaller marshaller = (Marshaller) invocation.getMetaData().getMetaData(RemotingInterceptorFactory.REMOTING, 36 RemotingInterceptorFactory.MARSHALLER); 37 38 if (marshaller != null) 39 { 40 client.setMarshaller(marshaller); 41 } 42 43 return client.invoke(invocation, null); 44 45 } 46 } | Popular Tags |