package org.jboss.proxy.ejb;
import java.lang.reflect.Method;
import javax.ejb.EJBHome;
import javax.ejb.EJBMetaData;
import javax.ejb.RemoveException;
import javax.ejb.Handle;
import javax.ejb.EJBHome;
import javax.ejb.EJBObject;
import javax.ejb.HomeHandle;
import org.jboss.proxy.ejb.handle.HomeHandleImpl;
import org.jboss.invocation.Invocation;
import org.jboss.invocation.InvocationContext;
import org.jboss.invocation.InvocationKey;
import org.jboss.invocation.InvocationType;
public class StatelessSessionHomeInterceptor
extends HomeInterceptor
{
private static final long serialVersionUID = 1333656107035759719L;
Object cached;
public StatelessSessionHomeInterceptor() {}
public Object invoke(Invocation invocation)
throws Throwable
{
boolean create = invocation.getMethod().getName().equals("create");
if (create && cached != null)
return cached;
Object result = super.invoke(invocation);
if (create)
cached = result;
return result;
}
}