org.jboss.aop.joinpoint
Class InvocationBase

java.lang.Object
  extended byorg.jboss.aop.joinpoint.InvocationBase
All Implemented Interfaces:
Invocation, Serializable
Direct Known Subclasses:
CallerInvocation, ConstructionInvocation, ConstructorInvocation, FieldInvocation, MethodInvocation

public abstract class InvocationBase
extends Object
implements Serializable, Invocation

This is a generic object that is used in intercepted invocations on field access, constructor, and methods

Version:
$Revision: 1.11 $
Author:
Bill Burke
See Also:
Serialized Form

Field Summary
protected  Advisor advisor
           
protected  int currentInterceptor
           
protected  MetaDataResolver instanceResolver
           
protected  Interceptor[] interceptors
           
protected  SimpleMetaData metadata
           
protected  Map responseContextInfo
           
protected  Object targetObject
           
 
Constructor Summary
InvocationBase()
           
InvocationBase(Interceptor[] interceptors)
           
InvocationBase(Interceptor[] interceptors, SimpleMetaData meta)
           
InvocationBase(Invocation invocation)
          Copy constructor.
 
Method Summary
 void addResponseAttachment(Object key, Object val)
           
 Advisor getAdvisor()
           
 int getCurrentInterceptor()
           
 MetaDataResolver getInstanceResolver()
           
 Interceptor[] getInterceptors()
          This used to be final, but I had to get rid of that since I need to lazily initialise the interceptors from the generated joinpoint/invocation classes
 SimpleMetaData getMetaData()
          Return all the contextual data attached to this invocation
 Object getMetaData(Object group, Object attr)
          This method resolves metadata based on the context of the invocation.
 Object getResponseAttachment(Object key)
           
 Map getResponseContextInfo()
           
 Object getTargetObject()
           
 Object invokeNext()
          Invoke on the next interceptor in the chain.
 Object invokeNext(Interceptor[] newInterceptors)
          Invoke on the next interceptor in the chain.
 Object resolveAnnotation(Class annotation)
          Abstraction for resolving an annotation so that it can be overriden from the Method, Constructor, Field, etc.
 Object resolveAnnotation(Class[] annotations)
          Abstraction for resolving an annotation so that it can be overriden from the Method, Constructor, Field, etc.
 Object resolveClassAnnotation(Class annotation)
          Abstraction for resolving an annotation so that it can be overriden from the Class
 Object resolveClassMetaData(Object key, Object attr)
          Resolve class level untyped metadata based on a key and the attribute of the key
 void setAdvisor(Advisor advisor)
           
 void setInstanceResolver(MetaDataResolver instanceResolver)
           
 void setMetaData(SimpleMetaData data)
          Set all the contextual data attached to this invocation
 void setResponseContextInfo(Map responseContextInfo)
           
 void setTargetObject(Object targetObject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.aop.joinpoint.Invocation
copy, getWrapper
 

Field Detail

metadata

protected SimpleMetaData metadata

currentInterceptor

protected transient int currentInterceptor

interceptors

protected transient Interceptor[] interceptors

advisor

protected transient Advisor advisor

responseContextInfo

protected transient Map responseContextInfo

targetObject

protected transient Object targetObject

instanceResolver

protected transient MetaDataResolver instanceResolver
Constructor Detail

InvocationBase

public InvocationBase(Interceptor[] interceptors)

InvocationBase

public InvocationBase(Interceptor[] interceptors,
                      SimpleMetaData meta)

InvocationBase

public InvocationBase(Invocation invocation)
Copy constructor.


InvocationBase

public InvocationBase()
Method Detail

getResponseContextInfo

public Map getResponseContextInfo()
Specified by:
getResponseContextInfo in interface Invocation

setResponseContextInfo

public void setResponseContextInfo(Map responseContextInfo)
Specified by:
setResponseContextInfo in interface Invocation

addResponseAttachment

public void addResponseAttachment(Object key,
                                  Object val)
Specified by:
addResponseAttachment in interface Invocation

getResponseAttachment

public Object getResponseAttachment(Object key)
Specified by:
getResponseAttachment in interface Invocation

getMetaData

public SimpleMetaData getMetaData()
Return all the contextual data attached to this invocation

Specified by:
getMetaData in interface Invocation

setMetaData

public void setMetaData(SimpleMetaData data)
Set all the contextual data attached to this invocation

Specified by:
setMetaData in interface Invocation

resolveClassMetaData

public Object resolveClassMetaData(Object key,
                                   Object attr)
Description copied from interface: Invocation
Resolve class level untyped metadata based on a key and the attribute of the key

Specified by:
resolveClassMetaData in interface Invocation
Parameters:
key -
attr -
Returns:

getCurrentInterceptor

public int getCurrentInterceptor()

invokeNext

public Object invokeNext()
                  throws Throwable
Invoke on the next interceptor in the chain. If this is already the end of the chain, reflection will call the constructor, field, or method you are invoking on.

Specified by:
invokeNext in interface Invocation
Throws:
Throwable

invokeNext

public Object invokeNext(Interceptor[] newInterceptors)
                  throws Throwable
Invoke on the next interceptor in the chain. If this is already the end of the chain, reflection will call the constructor, field, or method you are invoking on.

The Invocation will use a new set of interceptors to do the invocation

Specified by:
invokeNext in interface Invocation
Throws:
Throwable

getInterceptors

public Interceptor[] getInterceptors()
This used to be final, but I had to get rid of that since I need to lazily initialise the interceptors from the generated joinpoint/invocation classes

Specified by:
getInterceptors in interface Invocation

resolveClassAnnotation

public Object resolveClassAnnotation(Class annotation)
Description copied from interface: Invocation
Abstraction for resolving an annotation so that it can be overriden from the Class

Specified by:
resolveClassAnnotation in interface Invocation
Parameters:
annotation -
Returns:

resolveAnnotation

public Object resolveAnnotation(Class annotation)
Description copied from interface: Invocation
Abstraction for resolving an annotation so that it can be overriden from the Method, Constructor, Field, etc.

Specified by:
resolveAnnotation in interface Invocation
Parameters:
annotation -
Returns:

resolveAnnotation

public Object resolveAnnotation(Class[] annotations)
Description copied from interface: Invocation
Abstraction for resolving an annotation so that it can be overriden from the Method, Constructor, Field, etc.

Specified by:
resolveAnnotation in interface Invocation
Parameters:
annotations -
Returns:

getMetaData

public Object getMetaData(Object group,
                          Object attr)
This method resolves metadata based on the context of the invocation. It iterates through its list of MetaDataResolvers to find out the value of the metadata desired.

This list usually is ThreadMetaData, InstanceAdvisor.getMetaData ClassAdvisor.getMethodMetaData (or field, or constructor) ClassAdvisor.getDefaultMetaData

Specified by:
getMetaData in interface Invocation

getInstanceResolver

public MetaDataResolver getInstanceResolver()

getAdvisor

public Advisor getAdvisor()
Specified by:
getAdvisor in interface Invocation

getTargetObject

public Object getTargetObject()
Specified by:
getTargetObject in interface Invocation

setTargetObject

public void setTargetObject(Object targetObject)
Specified by:
setTargetObject in interface Invocation

setAdvisor

public void setAdvisor(Advisor advisor)

setInstanceResolver

public void setInstanceResolver(MetaDataResolver instanceResolver)


Copyright © 2004 JBoss Inc. All Rights Reserved.