public class GeneratedInstanceAdvisorMixin extends Object implements InstanceAdvisor, Serializable
Modifier and Type | Class and Description |
---|---|
class |
GeneratedInstanceAdvisorMixin.InstanceInterceptorFactory |
Modifier and Type | Field and Description |
---|---|
protected ArrayList<Interceptor> |
appendedInterceptors |
boolean |
hasInstanceAspects |
protected ArrayList<Interceptor> |
insertedInterceptors |
protected WeakReference<Object> |
instanceRef |
protected Map<String,Interceptor[]> |
stacks |
Constructor and Description |
---|
GeneratedInstanceAdvisorMixin() |
GeneratedInstanceAdvisorMixin(Object instance,
GeneratedClassAdvisor genadvisor) |
Modifier and Type | Method and Description |
---|---|
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.
|
protected void |
finalize()
Added to notify interceptor chain observer of interceptor chain garbage collection.
|
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[] advisorChain)
Called by the advisor
|
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 def)
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 . |
GeneratedAdvisorInterceptor[] |
getWrappers() |
Interceptor[] |
getWrappers(Interceptor[] advisorChain)
Called by the advisor
|
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)
This will not remove interceptor pointcuts! You will have to do this through AspectManager
|
void |
removeInterceptorStack(String stackName)
Removes an interceptor stack from the instance's interceptor chain.
|
protected ArrayList<Interceptor> insertedInterceptors
protected ArrayList<Interceptor> appendedInterceptors
protected WeakReference<Object> instanceRef
public boolean hasInstanceAspects
protected Map<String,Interceptor[]> stacks
public GeneratedInstanceAdvisorMixin()
public GeneratedInstanceAdvisorMixin(Object instance, GeneratedClassAdvisor genadvisor)
public boolean hasInterceptors()
InstanceAdvisor
hasInterceptors
in interface InstanceAdvisor
true
if the advised instance interceptor chain contains one
or more elements.public Object getPerInstanceAspect(String def)
InstanceAdvisor
aspectName
.
For internal use only.
getPerInstanceAspect
in interface InstanceAdvisor
def
- name of the queried aspectaspectName
public Object getPerInstanceAspect(AspectDefinition def)
InstanceAdvisor
def
.
For internal use only.
getPerInstanceAspect
in interface InstanceAdvisor
def
- definition of the queried aspectdef
public Object getPerInstanceJoinpointAspect(Joinpoint joinpoint, AspectDefinition def)
InstanceAdvisor
def
to be
applied at joipoint
.
For internal use only.
getPerInstanceJoinpointAspect
in interface InstanceAdvisor
joinpoint
- the joinpoint to which the aspect object will be applied.def
- definition of the queried aspectdef
to be applied
at joinpoint
public SimpleMetaData getMetaData()
InstanceAdvisor
getMetaData
in interface InstanceAdvisor
public Interceptor[] getInterceptors()
InstanceAdvisor
For internal use only.
getInterceptors
in interface InstanceAdvisor
public Interceptor[] getInterceptors(Interceptor[] advisorChain)
getInterceptors
in interface InstanceAdvisor
advisorChain
- 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.public GeneratedAdvisorInterceptor[] getWrappers()
public Interceptor[] getWrappers(Interceptor[] advisorChain)
An
- array of GeneratedAdvisorInterceptor from the advisor's intereceptor chain for the joinpointpublic void insertInterceptor(int index, Interceptor interceptor)
InstanceAdvisor
index
of the inserted instance's
interceptor chain.insertInterceptor
in interface InstanceAdvisor
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.public void insertInterceptor(Interceptor interceptor)
InstanceAdvisor
insertInterceptor
in interface InstanceAdvisor
interceptor
- the interceptor to be added to the instance's chain.public void appendInterceptor(Interceptor interceptor)
InstanceAdvisor
appendInterceptor
in interface InstanceAdvisor
interceptor
- the interceptor to be appended to the instance's chainpublic void appendInterceptor(int index, Interceptor interceptor)
InstanceAdvisor
index
of the appended instance's
interceptor chain.appendInterceptor
in interface InstanceAdvisor
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.public void removeInterceptor(String name)
removeInterceptor
in interface InstanceAdvisor
name
- name of the interceptor to be removed from the chain.Interceptor.getName()
public final boolean hasAspects()
InstanceAdvisor
InstanceAdvisor.hasInterceptors()
.hasAspects
in interface InstanceAdvisor
true
if there is one or more aspects bound to this advised
instance.public void insertInterceptorStack(String stackName)
InstanceAdvisor
insertInterceptorStack
in interface InstanceAdvisor
stackName
- the name that identifies the interceptor stack to be insertedpublic void appendInterceptorStack(String stackName)
InstanceAdvisor
appendInterceptorStack
in interface InstanceAdvisor
stackName
- the name that identifies the interceptor stack to be appendedpublic void removeInterceptorStack(String stackName)
InstanceAdvisor
removeInterceptorStack
in interface InstanceAdvisor
stackName
- the name that identifies the interceptor stack to be removedpublic Domain getDomain()
InstanceAdvisor
getDomain
in interface InstanceAdvisor
protected void finalize()
public Object getInstance()
InstanceAdvisor
getInstance
in interface InstanceAdvisor
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.