1 22 package org.jboss.aspects.asynch; 23 24 import org.jboss.aop.proxy.ClassProxy; 25 import org.jboss.aop.proxy.ClassProxyFactory; 26 import org.jboss.aop.proxy.ProxyMixin; 27 import org.jboss.aspects.remoting.Remoting; 28 import org.jboss.remoting.InvokerLocator; 29 30 36 public class AsynchRemoting 37 { 38 public static ClassProxy createRemoteProxy(Object objectId, Class clazz, InvokerLocator locator) 39 throws Exception 40 { 41 AsynchMixin mixin = new AsynchMixin(); 42 AsynchProxyInterceptor interceptor = new AsynchProxyInterceptor(mixin); 43 Class [] mixInterfaces = {AsynchProvider.class}; 44 ProxyMixin[] mixins = {new ProxyMixin(mixin, mixInterfaces)}; 45 ClassProxy proxy = ClassProxyFactory.newInstance(clazz, mixins); 46 proxy._getInstanceAdvisor().insertInterceptor(interceptor); 47 Remoting.makeRemotable(proxy, locator, objectId); 48 return proxy; 49 } 50 51 } 52 | Popular Tags |