|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InstanceAdvisor
Holds an object instance's metadata and attached interceptor chain.
The interceptor chain attached to an advised object contains interceptors that are
applied to every method execution and field access joinpoint of that object.
At startup, the instance interceptor chain is always empty. This chain is
specially tailored for per-instance dynamic AOP operations, allowing the addition
and removal of interceptors at runtime. The order in which the interceptors are
invoked depends on which method was used to add them to the chain (for more
information, see insertInterceptor(org.jboss.aop.advice.Interceptor)
and appendInterceptor(org.jboss.aop.advice.Interceptor)
methods).
Notice that every interceptor chain operation provided by an instance
advisor affects only the advised object interceptor chain, and hence it will not
affect other advised instances, regardless of whether they belong to the same
class or not.
Method Summary | |
---|---|
void |
appendInterceptor(Interceptor interceptor)
Appends an interceptor to the end of the instance's interceptor chain. |
void |
appendInterceptor(int index,
Interceptor interceptor)
Appends an interceptor at position index of the appended instance's
interceptor chain. |
void |
appendInterceptorStack(String stackName)
Appends an interceptor chain to the end of the instance's interceptor chain. |
Domain |
getDomain()
Returns the domain where this advisor belongs. |
Object |
getInstance()
Returns the advised instance managed by this advisor. |
Interceptor[] |
getInterceptors()
Returns the interceptor chain of the advised instance. |
Interceptor[] |
getInterceptors(Interceptor[] baseChain)
Merges the advised instance interceptor chain with baseChain . |
SimpleMetaData |
getMetaData()
Returns the metadata bound to the advised instance. |
Object |
getPerInstanceAspect(AspectDefinition def)
Returns a per instance aspect object defined by def . |
Object |
getPerInstanceAspect(String aspectName)
Returns a per instance aspect object identified by aspectName . |
Object |
getPerInstanceJoinpointAspect(Joinpoint joinpoint,
AspectDefinition def)
Returns the per instance joinpoint aspect object defined by def to be
applied at joipoint . |
boolean |
hasAspects()
Indicates whether there are instance aspects bound to the instance advised. |
boolean |
hasInterceptors()
Indicates if the advised instance interceptor chain is not empty. |
void |
insertInterceptor(Interceptor interceptor)
Inserts an interceptor at the beginning of the instance's interceptor chain. |
void |
insertInterceptor(int index,
Interceptor interceptor)
Inserts an interceptor at position index of the inserted instance's
interceptor chain. |
void |
insertInterceptorStack(String stackName)
Inserts an interceptor stack to the beginning of the instance's interceptor chain. |
void |
removeInterceptor(String name)
Removes an interceptor from instance's interceptor chain. |
void |
removeInterceptorStack(String name)
Removes an interceptor stack from the instance's interceptor chain. |
Method Detail |
---|
SimpleMetaData getMetaData()
Domain getDomain()
Object getInstance()
boolean hasInterceptors()
true
if the advised instance interceptor chain contains one
or more elements.boolean hasAspects()
hasInterceptors()
.
true
if there is one or more aspects bound to this advised
instance.void insertInterceptor(Interceptor interceptor)
interceptor
- the interceptor to be added to the instance's chain.void insertInterceptor(int index, Interceptor interceptor) throws IndexOutOfBoundsException
index
of the inserted instance's
interceptor chain.
index
- the position where to insert interceptor
. This value must
not be greater than or equal to the number of inserted interceptors in
the chain.interceptor
- the interceptor to be added to the instance's chain.
IndexOutOfBoundsException
- if index
is greater than or equal to
the total number of inserted interceptors contained in this advisor, or
if index
is a negative valuevoid insertInterceptorStack(String stackName)
stackName
- the name that identifies the interceptor stack to be insertedvoid appendInterceptor(Interceptor interceptor)
interceptor
- the interceptor to be appended to the instance's chainvoid appendInterceptor(int index, Interceptor interceptor) throws IndexOutOfBoundsException
index
of the appended instance's
interceptor chain.
index
- the position where to insert interceptor
. This value must
not be greater than or equal to the number of appended interceptors in
the chain.interceptor
- the interceptor to be added to the instance's chain.
IndexOutOfBoundsException
- if index
is greater than or equal to
the total number of appended interceptors contained in this advisor, or
if index
is a negative valuevoid appendInterceptorStack(String stackName)
stackName
- the name that identifies the interceptor stack to be appendedvoid removeInterceptor(String name)
name
- name of the interceptor to be removed from the chain.Interceptor.getName()
void removeInterceptorStack(String name)
name
- the name that identifies the interceptor stack to be removedInterceptor[] getInterceptors()
For internal use only.
Interceptor[] getInterceptors(Interceptor[] baseChain)
baseChain
.
baseChain
, and finally all the appended interceptors.
For internal use only.
baseChain
- the chain to be joined with the advised instance's chain.
baseChain
with the instance's chain. May return baseChain
if the last one
is empty.Object getPerInstanceAspect(String aspectName)
aspectName
.
For internal use only.
aspectName
- name of the queried aspect
aspectName
Object getPerInstanceAspect(AspectDefinition def)
def
.
For internal use only.
def
- definition of the queried aspect
def
Object getPerInstanceJoinpointAspect(Joinpoint joinpoint, AspectDefinition def)
def
to be
applied at joipoint
.
For internal use only.
joinpoint
- the joinpoint to which the aspect object will be applied.def
- definition of the queried aspect
def
to be applied
at joinpoint
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |