public class ConstructionInvocation extends InvocationBase
Modifier and Type | Field and Description |
---|---|
protected Object[] |
arguments |
protected Constructor<?> |
constructor |
advisor, currentInterceptor, instanceResolver, interceptors, metadata, responseContextInfo, targetObject
Constructor and Description |
---|
ConstructionInvocation(ConstructionInfo info,
Interceptor[] interceptors) |
ConstructionInvocation(Interceptor[] interceptors,
Constructor<?> con) |
ConstructionInvocation(Interceptor[] interceptors,
Constructor<?> con,
Object[] args) |
Modifier and Type | Method and Description |
---|---|
Invocation |
copy()
Copies complete state of Invocation object.
|
Object[] |
getArguments()
Returns a non-null array containing all constructor arguments.
|
Constructor<?> |
getConstructor() |
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.
|
Object |
resolveAnnotation(Class<? extends Annotation> annotation)
This method resolves an annotation based on the context of the invocation.
|
<T extends Annotation> |
resolveTypedAnnotation(Class<T> annotation)
Abstraction for resolving an annotation so that
it can be overriden from the Method, Constructor, Field, etc.
|
void |
setArguments(Object[] arguments)
Replaces constructor argument values by the ones contained in
arguments . |
void |
setConstructor(Constructor<?> constructor) |
String |
toString() |
addResponseAttachment, getAdvisor, getCurrentInterceptor, getInstanceResolver, getInterceptors, getMetaData, getResponseAttachment, getResponseContextInfo, getTargetObject, invokeNext, resolveAnnotation, resolveClassAnnotation, resolveClassMetaData, resolveTypedAnnotation, resolveTypedClassAnnotation, setAdvisor, setInstanceResolver, setMetaData, setResponseContextInfo, setTargetObject
protected Object[] arguments
protected transient Constructor<?> constructor
public ConstructionInvocation(Interceptor[] interceptors, Constructor<?> con, Object[] args)
public ConstructionInvocation(Interceptor[] interceptors, Constructor<?> con)
public ConstructionInvocation(ConstructionInfo info, Interceptor[] interceptors)
public Object invokeNext() throws Throwable
invokeNext
in interface Invocation
invokeNext
in class InvocationBase
Throwable
public Object invokeTarget() throws Throwable
invokeTarget
in interface Invocation
invokeTarget
in class InvocationBase
Throwable
public Object resolveAnnotation(Class<? extends Annotation> annotation)
resolveAnnotation
in interface Invocation
resolveAnnotation
in class InvocationBase
public <T extends Annotation> T resolveTypedAnnotation(Class<T> annotation)
Invocation
resolveTypedAnnotation
in interface Invocation
resolveTypedAnnotation
in class InvocationBase
public Object getMetaData(Object group, Object attr)
getMetaData
in interface Invocation
getMetaData
in class InvocationBase
public Invocation getWrapper(Interceptor[] newchain)
newchain
- chain of interceptors to be inserted on invocationpublic Invocation copy()
public Object[] getArguments()
The returned array can be changed by the advice or interceptor accordingly. All
changes will be noticed by construction 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 invokeNext()
,
InvocationBase.invokeNext(Interceptor[])
, or invokeTarget()
method.
Otherwise, inconsistency on joinpoint argument values may be noticed.
public void setArguments(Object[] arguments)
arguments
. Since this invocation is executed after construction, the
changes performed on arguments
will not be applied on the
construction itself. However, these changes will be noticeable to all
subsequent construction advices.
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.
arguments
- a non-null array containing the new values of constructor
arguments. The size of this array must be the same as the one
of getArguments()
, as well as the element types.public Constructor<?> getConstructor()
public void setConstructor(Constructor<?> constructor)
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.