FileDocCategorySizeDatePackage
Remoting.javaAPI DocJBoss 4.2.13650Fri Jul 13 21:02:26 BST 2007org.jboss.aspects.remoting

Remoting

public class Remoting extends Object
author
Bill Burke
version
$Revision: 57186 $

Fields Summary
Constructors Summary
Methods Summary
public static java.lang.ObjectcreatePojiProxy(java.lang.Object oid, java.lang.Class[] interfaces, java.lang.String uri)
Does'nt propagate security/tx

param
oid
param
interfaces
param
uri
return
throws
Exception

      InvokerLocator locator = new InvokerLocator(uri);
      Interceptor[] interceptors = {IsLocalInterceptor.singleton, InvokeRemoteInterceptor.singleton};
      PojiProxy proxy = new PojiProxy(oid, locator, interceptors);
      return Proxy.newProxyInstance(interfaces[0].getClassLoader(), interfaces, proxy);

   
public static org.jboss.aop.proxy.ClassProxycreateRemoteProxy(java.lang.Object objectId, java.lang.Class clazz, java.lang.String uri)

      return createRemoteProxy(objectId, clazz, new InvokerLocator(uri));
   
public static org.jboss.aop.proxy.ClassProxycreateRemoteProxy(java.lang.Object objectId, java.lang.Class clazz, org.jboss.remoting.InvokerLocator locator)

      ClassProxy proxy = ClassProxyFactory.newInstance(clazz);
      makeRemotable(proxy, locator, objectId);

      return proxy;
   
public static voidmakeRemotable(org.jboss.aop.InstanceAdvised proxy, org.jboss.remoting.InvokerLocator locator, java.lang.Object objectId)

      InstanceAdvisor advisor = proxy._getInstanceAdvisor();
      advisor.insertInterceptor(IsLocalInterceptor.singleton);
      advisor.insertInterceptor(SecurityClientInterceptor.singleton);
      advisor.insertInterceptor(ClientTxPropagationInterceptor.singleton);
      advisor.insertInterceptor(MergeMetaDataInterceptor.singleton);
      advisor.insertInterceptor(InvokeRemoteInterceptor.singleton);
      advisor.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING,
      InvokeRemoteInterceptor.INVOKER_LOCATOR,
      locator,
      PayloadKey.AS_IS);
      advisor.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING,
      InvokeRemoteInterceptor.SUBSYSTEM,
      "AOP",
      PayloadKey.AS_IS);

      advisor.getMetaData().addMetaData(Dispatcher.DISPATCHER,
      Dispatcher.OID,
      objectId,
      PayloadKey.AS_IS);