FileDocCategorySizeDatePackage
StatelessLocalProxy.javaAPI DocJBoss 4.2.13566Fri Jul 13 20:53:52 BST 2007org.jboss.ejb3.stateless

StatelessLocalProxy

public class StatelessLocalProxy extends org.jboss.ejb3.LocalProxy
Comment
author
Bill Burke
version
$Revision: 60233 $

Fields Summary
private static final long
serialVersionUID
org.jboss.aspects.asynch.AsynchProvider
provider
Constructors Summary
public StatelessLocalProxy()


    
   
   
public StatelessLocalProxy(org.jboss.ejb3.Container container)

      super(container);
   
public StatelessLocalProxy(org.jboss.aspects.asynch.AsynchProvider provider, org.jboss.ejb3.Container container)

      super(container);
      this.provider = provider;
   
Methods Summary
public java.lang.ObjectgetAsynchronousProxy(java.lang.Object proxy)

      Class[] infs = proxy.getClass().getInterfaces();
      if (!ProxyUtils.isAsynchronous(infs))
      {
         Class[] interfaces = ProxyUtils.addAsynchProviderInterface(infs);
         AsynchMixin mixin = new AsynchMixin();
         StatelessLocalProxy handler = new StatelessLocalProxy(mixin, container);
         return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, handler);
      }

      //I was already asynchronous
      return proxy;
   
public java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)

      if (method.getDeclaringClass() == AsynchProvider.class)
      {
         return provider.getFuture();
      }

      Object ret = ProxyUtils.handleCallLocally(proxy, this, method, args);
      if (ret != null)
      {
         return ret;
      }
      
      if (container == null)
         throw new EJBException("Invalid invocation of local interface (null container)");

      StatelessContainer stateless = (StatelessContainer) container;

      return stateless.localInvoke(method, args, (FutureHolder) provider);
   
public java.lang.StringtoString()

      return container.getEjbName().toString();