org.jboss.aop.joinpoint
Class ConstructorCalledByConstructorInvocationWrapper

java.lang.Object
  extended by org.jboss.aop.joinpoint.InvocationBase
      extended by org.jboss.aop.joinpoint.CallerInvocation
          extended by org.jboss.aop.joinpoint.ConstructorCalledByConstructorInvocation
              extended by org.jboss.aop.joinpoint.ConstructorCalledByConstructorInvocationWrapper
All Implemented Interfaces:
Serializable, Invocation

public class ConstructorCalledByConstructorInvocationWrapper
extends ConstructorCalledByConstructorInvocation

Comment

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

Field Summary
 
Fields inherited from class org.jboss.aop.joinpoint.ConstructorCalledByConstructorInvocation
calling, constructor, wrappingMethod
 
Fields inherited from class org.jboss.aop.joinpoint.CallerInvocation
arguments, callingObject
 
Fields inherited from class org.jboss.aop.joinpoint.InvocationBase
advisor, currentInterceptor, instanceResolver, interceptors, metadata, responseContextInfo, targetObject
 
Constructor Summary
ConstructorCalledByConstructorInvocationWrapper(ConstructorCalledByConstructorInvocation wrapped, Interceptor[] interceptors)
           
 
Method Summary
 void addResponseAttachment(Object key, Object val)
           
 Invocation copy()
          Copies complete state of Invocation object.
 Advisor getAdvisor()
           
 Object[] getArguments()
          Returns a non-null array containing all call arguments.
 Constructor<?> getCalledConstructor()
           
 Constructor<?> getCallingConstructor()
           
 MetaDataResolver getInstanceResolver()
           
 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<Object,Object> getResponseContextInfo()
           
 Object getTargetObject()
           
 Method getWrappingMethod()
          Is the called constructor aspectized? If so then this method returns the method that wraps the constructor.
 Object invokeNext()
          Invoke on the next interceptor in the chain.
 boolean isWrapped()
          Is the called constructor aspectized? If so then there is a wrapping method that must be called.
 void setArguments(Object[] arguments)
          Replaces call argument values by the ones contained in arguments.
 void setMetaData(SimpleMetaData data)
          Set all the contextual data attached to this invocation
 void setResponseContextInfo(Map<Object,Object> responseContextInfo)
           
 void setTargetObject(Object targetObject)
           
 
Methods inherited from class org.jboss.aop.joinpoint.ConstructorCalledByConstructorInvocation
getWrapper, invokeTarget
 
Methods inherited from class org.jboss.aop.joinpoint.CallerInvocation
getCallingObject
 
Methods inherited from class org.jboss.aop.joinpoint.InvocationBase
getCurrentInterceptor, getInterceptors, invokeNext, resolveAnnotation, resolveAnnotation, resolveClassAnnotation, resolveClassMetaData, resolveTypedAnnotation, resolveTypedAnnotation, resolveTypedClassAnnotation, setAdvisor, setInstanceResolver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstructorCalledByConstructorInvocationWrapper

public ConstructorCalledByConstructorInvocationWrapper(ConstructorCalledByConstructorInvocation wrapped,
                                                       Interceptor[] interceptors)
Method Detail

getMetaData

public Object getMetaData(Object group,
                          Object attr)
Description copied from class: ConstructorCalledByConstructorInvocation
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
Overrides:
getMetaData in class ConstructorCalledByConstructorInvocation

invokeNext

public Object invokeNext()
                  throws Throwable
Description copied from class: ConstructorCalledByConstructorInvocation
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
Overrides:
invokeNext in class ConstructorCalledByConstructorInvocation
Throws:
Throwable

getInstanceResolver

public MetaDataResolver getInstanceResolver()
Overrides:
getInstanceResolver in class InvocationBase

getArguments

public Object[] getArguments()
Description copied from class: CallerInvocation
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.

Overrides:
getArguments in class CallerInvocation
Returns:
the call arguments

setArguments

public void setArguments(Object[] arguments)
Description copied from class: CallerInvocation
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.

Overrides:
setArguments in class CallerInvocation
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 CallerInvocation.getArguments(), as well as the element types.

getCallingConstructor

public Constructor<?> getCallingConstructor()
Overrides:
getCallingConstructor in class ConstructorCalledByConstructorInvocation
Returns:
the constructor that is calling the called constructor

getCalledConstructor

public Constructor<?> getCalledConstructor()
Overrides:
getCalledConstructor in class ConstructorCalledByConstructorInvocation
Returns:
the constructor call being executed by the calling method

isWrapped

public boolean isWrapped()
Description copied from class: ConstructorCalledByConstructorInvocation
Is the called constructor aspectized? If so then there is a wrapping method that must be called.

Overrides:
isWrapped in class ConstructorCalledByConstructorInvocation
Returns:
true if the constructor is wrapped

getWrappingMethod

public Method getWrappingMethod()
Description copied from class: ConstructorCalledByConstructorInvocation
Is the called constructor aspectized? If so then this method returns the method that wraps the constructor.

Overrides:
getWrappingMethod in class ConstructorCalledByConstructorInvocation
Returns:
the method that wraps the constructor if ConstructorCalledByConstructorInvocation.isWrapped() returns true; null otherwise.

copy

public Invocation copy()
Description copied from class: ConstructorCalledByConstructorInvocation
Copies complete state of Invocation object.

Specified by:
copy in interface Invocation
Overrides:
copy in class ConstructorCalledByConstructorInvocation
Returns:
a copy of this instance

getResponseContextInfo

public Map<Object,Object> getResponseContextInfo()
Specified by:
getResponseContextInfo in interface Invocation
Overrides:
getResponseContextInfo in class InvocationBase

addResponseAttachment

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

setResponseContextInfo

public void setResponseContextInfo(Map<Object,Object> responseContextInfo)
Specified by:
setResponseContextInfo in interface Invocation
Overrides:
setResponseContextInfo in class InvocationBase

getResponseAttachment

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

getMetaData

public SimpleMetaData getMetaData()
Description copied from class: InvocationBase
Return all the contextual data attached to this invocation

Specified by:
getMetaData in interface Invocation
Overrides:
getMetaData in class InvocationBase

setMetaData

public void setMetaData(SimpleMetaData data)
Description copied from class: InvocationBase
Set all the contextual data attached to this invocation

Specified by:
setMetaData in interface Invocation
Overrides:
setMetaData in class InvocationBase

getAdvisor

public Advisor getAdvisor()
Specified by:
getAdvisor in interface Invocation
Overrides:
getAdvisor in class InvocationBase

getTargetObject

public Object getTargetObject()
Specified by:
getTargetObject in interface Invocation
Overrides:
getTargetObject in class InvocationBase

setTargetObject

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


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