FileDocCategorySizeDatePackage
EJBInvocation.javaAPI DocJBoss 4.2.14551Fri Jul 13 20:53:58 BST 2007org.jboss.ejb3

EJBInvocation

public abstract class EJBInvocation extends Object implements org.jboss.aop.joinpoint.Invocation
Comment
author
Bill Burke
version
$Revision: 57207 $

Fields Summary
private static final Logger
log
protected transient org.jboss.aop.advice.Interceptor[]
interceptors
protected long
methodHash
protected transient int
currentInterceptor
protected transient Method
method
protected Object[]
arguments
protected org.jboss.aop.metadata.SimpleMetaData
metadata
protected transient Map
responseContextInfo
Constructors Summary
protected EJBInvocation(Method method, long methodHash, Object[] arguments, org.jboss.aop.advice.Interceptor[] interceptors)


           
   
      this.method = method;
      this.methodHash = methodHash;
      this.arguments = arguments;
      this.interceptors = interceptors;
   
protected EJBInvocation()

   
Methods Summary
public voidaddResponseAttachment(java.lang.Object key, java.lang.Object val)

      if (responseContextInfo == null) responseContextInfo = new HashMap();
      responseContextInfo.put(key, val);
   
public java.lang.Object[]getArguments()

      return arguments;
   
public org.jboss.aop.advice.Interceptor[]getInterceptors()

      return interceptors;
   
public java.lang.ObjectgetMetaData(java.lang.Object key, java.lang.Object attr)

      // todo: set up the chain for metadata resolving
      Object value = null;
      if (metadata != null) value = metadata.getMetaData(key, attr);
      if (value != null) return value;
      value = ThreadMetaData.instance().getMetaData(key, attr);
      return value;
   
public org.jboss.aop.metadata.SimpleMetaDatagetMetaData()

      if (metadata == null) metadata = new SimpleMetaData();
      return metadata;
   
public java.lang.reflect.MethodgetMethod()

      return method;
   
public longgetMethodHash()

      return methodHash;
   
public java.lang.ObjectgetResponseAttachment(java.lang.Object key)

      if (responseContextInfo == null) return null;
      return responseContextInfo.get(key);
   
public java.util.MapgetResponseContextInfo()

      return responseContextInfo;
   
public java.lang.ObjectinvokeNext(org.jboss.aop.advice.Interceptor[] newInterceptors)

      throw new RuntimeException("NOT IMPLEMENTED");
   
public java.lang.ObjectinvokeNext()

      if (currentInterceptor < interceptors.length)
      {
         try
         {
            return interceptors[currentInterceptor++].invoke(this);
         }
         finally
         {
            // so that interceptors like clustering can reinvoke down the chain
            currentInterceptor--;
         }
      }
      try
      {
         return method.invoke(getTargetObject(), getArguments());
      }
      catch (InvocationTargetException e)
      {
         throw e.getTargetException();
      }
   
public voidsetArguments(java.lang.Object[] args)

      this.arguments = args;
   
public voidsetInterceptors(org.jboss.aop.advice.Interceptor[] interceptors)

      this.interceptors = interceptors;
   
public voidsetMetaData(org.jboss.aop.metadata.SimpleMetaData data)

      this.metadata = data;
   
public voidsetResponseContextInfo(java.util.Map responseContextInfo)

      this.responseContextInfo = responseContextInfo;