org.jboss.aop.joinpoint
Class MethodCalledByConstructorInvocation

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

public class MethodCalledByConstructorInvocation
extends CallerInvocation

This is a helper wrapper class for an Invocation object. It is used to add or get values or metadata that pertains to an AOP method invocation.

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

Field Summary
protected  Constructor<?> calling
           
protected  Method method
           
 
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
MethodCalledByConstructorInvocation(Advisor advisor, Constructor<?> calling, Method method, Object callingObject, Object target, Object[] args, Interceptor[] interceptors)
           
MethodCalledByConstructorInvocation(MethodByConInfo info, Object callingObject, Object target, Interceptor[] interceptors)
           
MethodCalledByConstructorInvocation(MethodByConInfo info, Object callingObject, Object target, Object[] args, Interceptor[] interceptors)
           
MethodCalledByConstructorInvocation(Object callingObject, Interceptor[] interceptors)
           
 
Method Summary
 Invocation copy()
          Copies complete state of Invocation object.
 Method getCalledMethod()
           
 Constructor<?> getCalling()
          The constructor that is calling the method
 Object getMetaData(Object group, Object attr)
          This method resolves metadata based on the context of the invocation.
 Invocation getWrapper(Interceptor[] newchain)
          Returns a wrapper invocation object that can insert a new chain of interceptors at runtime to the invocation flow.
 Object invokeNext()
          Invoke on the next interceptor in the chain.
 Object invokeTarget()
          Invokes the target joinpoint for this invocation skipping any subsequent interceptors in the chain.
 
Methods inherited from class org.jboss.aop.joinpoint.CallerInvocation
getArguments, getCallingObject, setArguments
 
Methods inherited from class org.jboss.aop.joinpoint.InvocationBase
addResponseAttachment, getAdvisor, getCurrentInterceptor, getInstanceResolver, getInterceptors, getMetaData, getResponseAttachment, getResponseContextInfo, getTargetObject, invokeNext, 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
 

Field Detail

calling

protected Constructor<?> calling

method

protected Method method
Constructor Detail

MethodCalledByConstructorInvocation

public MethodCalledByConstructorInvocation(MethodByConInfo info,
                                           Object callingObject,
                                           Object target,
                                           Object[] args,
                                           Interceptor[] interceptors)

MethodCalledByConstructorInvocation

public MethodCalledByConstructorInvocation(MethodByConInfo info,
                                           Object callingObject,
                                           Object target,
                                           Interceptor[] interceptors)

MethodCalledByConstructorInvocation

public MethodCalledByConstructorInvocation(Advisor advisor,
                                           Constructor<?> calling,
                                           Method method,
                                           Object callingObject,
                                           Object target,
                                           Object[] args,
                                           Interceptor[] interceptors)

MethodCalledByConstructorInvocation

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

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
Overrides:
invokeNext in class InvocationBase
Throws:
Throwable

invokeTarget

public Object invokeTarget()
                    throws Throwable
Invokes the target joinpoint for this invocation skipping any subsequent interceptors in the chain.

Specified by:
invokeTarget in interface Invocation
Overrides:
invokeTarget in class InvocationBase
Throws:
Throwable

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
Overrides:
getMetaData in class InvocationBase

getWrapper

public Invocation getWrapper(Interceptor[] newchain)
Returns a wrapper invocation object that can insert a new chain of interceptors at runtime to the invocation flow. CFlow makes use of this. When the wrapper object finishes its invocation chain it delegates back to the wrapped invocation.

Parameters:
newchain - chain of interceptors to be inserted on invocation
Returns:
an invocation wrapper

copy

public Invocation copy()
Copies complete state of Invocation object.

Returns:
a copy of this instance

getCalling

public Constructor<?> getCalling()
The constructor that is calling the method

Returns:
The constructor that is calling the method

getCalledMethod

public Method getCalledMethod()
Returns:
the method that is being called


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