org.jboss.aop.joinpoint
Class CallerInvocation

java.lang.Object
  extended by org.jboss.aop.joinpoint.InvocationBase
      extended by org.jboss.aop.joinpoint.CallerInvocation
All Implemented Interfaces:
Serializable, Invocation
Direct Known Subclasses:
ConstructorCalledByConstructorInvocation, ConstructorCalledByMethodInvocation, MethodCalledByConstructorInvocation, MethodCalledByMethodInvocation

public abstract class CallerInvocation
extends InvocationBase

Version:
$Revision: 60466 $
Author:
Kabir Khan
See Also:
Serialized Form

Field Summary
protected  Object[] arguments
           
protected  Object callingObject
           
 
Fields inherited from class org.jboss.aop.joinpoint.InvocationBase
advisor, currentInterceptor, instanceResolver, interceptors, metadata, responseContextInfo, targetObject
 
Constructor Summary
CallerInvocation(Advisor advisor, Object callingObject, Interceptor[] interceptors)
           
CallerInvocation(Object callingObject, Interceptor[] interceptors)
           
 
Method Summary
 Object[] getArguments()
          Returns a non-null array containing all call arguments.
 Object getCallingObject()
          Returns the caller object.
 void setArguments(Object[] arguments)
          Replaces call argument values by the ones contained in arguments.
 
Methods inherited from class org.jboss.aop.joinpoint.InvocationBase
addResponseAttachment, getAdvisor, getCurrentInterceptor, getInstanceResolver, getInterceptors, getMetaData, getMetaData, getResponseAttachment, getResponseContextInfo, getTargetObject, invokeNext, invokeNext, invokeTarget, resolveAnnotation, resolveAnnotation, resolveClassAnnotation, resolveClassMetaData, resolveTypedAnnotation, resolveTypedAnnotation, resolveTypedClassAnnotation, setAdvisor, setInstanceResolver, setMetaData, setResponseContextInfo, setTargetObject
 
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

callingObject

protected Object callingObject

arguments

protected Object[] arguments
Constructor Detail

CallerInvocation

public CallerInvocation(Advisor advisor,
                        Object callingObject,
                        Interceptor[] interceptors)

CallerInvocation

public CallerInvocation(Object callingObject,
                        Interceptor[] interceptors)
Method Detail

getCallingObject

public Object getCallingObject()
Returns the caller object.

Returns:
the caller object

getArguments

public Object[] getArguments()
Returns a non-null array containing all call arguments.

The returned array can be changed by the advice or interceptor accordingly. All changes are reflected on joinpoint execution, and are noticed as well by other advices and interceptors that are executed after the current one.
However, changes to this array are limited to the scope of current advice execution, and must be performed before execution of InvocationBase.invokeNext(), InvocationBase.invokeNext(Interceptor[]), or InvocationBase.invokeTarget() method. Otherwise, inconsistency on joinpoint argument values may be noticed.

Returns:
the call arguments

setArguments

public void setArguments(Object[] arguments)
Replaces call argument values by the ones contained in arguments.

Advices and interceptors must be aware that, for performance reasons, this array does not get copied across; its reference is directly used instead. Hence, changes to arguments array after this method being called are forbidden. Otherwise, inconsistency on joinpoint argument values may be noticed.

Parameters:
arguments - a non-null array containing the new values of call arguments. The size of this array must be the same as the one of getArguments(), as well as the element types.


Copyright © 2008 JBoss, a division of Red Hat, Inc.. All Rights Reserved.