org.jboss.aop.proxy.container
Class MarshalledProxyAdvisor

java.lang.Object
  extended by org.jboss.aop.Advisor
      extended by org.jboss.aop.proxy.container.MarshalledProxyAdvisor
All Implemented Interfaces:
InstanceAdvisor

public class MarshalledProxyAdvisor
extends Advisor
implements InstanceAdvisor

The advisor used by a container proxy that is unmarshalled in a remote jvm

Version:
$Revision: 1.1 $
Author:
Kabir Khan

Field Summary
 
Fields inherited from class org.jboss.aop.Advisor
adviceBindings, adviceInterceptors, advisedMethods, annotations, aspects, classMetaData, classMetaDataBindings, clazz, constructionInfos, constructionInterceptors, constructorInfos, constructorInterceptors, constructorMetaData, constructors, defaultMetaData, doesHaveAspects, fieldMetaData, interfaceIntroductions, lazyCollectionLock, loader, manager, methodInterceptors, methodMetaData, name, NULL_ASPECT, perInstanceAspectDefinitions, perInstanceJoinpointAspectDefinitions
 
Constructor Summary
MarshalledProxyAdvisor(String name, AspectManager manager)
           
 
Method Summary
 void addClassMetaData(ClassMetaDataBinding data)
           
 void addMethodInfo(MethodInfo info)
           
 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.
 MethodInfo getMethodInfo(long hash)
          Returns the MethodInfo that represents the execution of the method identified by hash.
 MethodInfo[] getMethodInfos()
           
 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 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.
protected  void rebuildInterceptors()
           
protected  void rebuildInterceptorsForAddedBinding(AdviceBinding binding)
           
protected  void rebuildInterceptorsForRemovedBinding(AdviceBinding removedBinding)
           
 void removeClassMetaData(ClassMetaDataBinding data)
           
 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.
 void setClazz(Class<?> clazz)
           
 void setInstance(Object instance)
           
 
Methods inherited from class org.jboss.aop.Advisor
addAdviceInterceptor, addInterfaceIntroduction, addPerClassAspect, addPerInstanceAspect, addPerInstanceJoinpointAspect, adjustInfoForAddedBinding, chainOverridingForInheritedMethods, cleanup, createInterceptorChain, deployAnnotationOverride, deployAnnotationOverrides, deployMethodAnnotationOverrides, doDeployAnnotationOverride, dynamicInvoke, finalizeChain, finalizeMethodChain, getAdviceInterceptor, getAllMethods, getAnnotations, getClassLoader, getClassMetaData, getClassMetadataBindings, getClazz, getConstructionInfos, getConstructionInterceptors, getConstructorInfos, getConstructorInterceptors, getConstructorMetaData, getConstructors, getDefaultMetaData, getFieldMetaData, getInterfaceIntroductions, getManager, getMetadata, getMethodMetaData, getName, getPerClassAspect, getPerClassAspect, getPerInstanceAspectDefinitions, getPerInstanceJoinpointAspectDefinitions, getPerVMAspect, getSimpleName, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAspects, hasSameConstructorAspectLength, hasSameMethodAspectLength, initAdvisedMethodsMap, initClassMetaDataBindingsList, initializeConstructionChain, initializeConstructorChain, initializeInterfaceIntroductions, initInterfaceIntroductionsList, initPerInstanceAspectDefinitionsSet, initPerInstanceJoinpointAspectDefinitionsMap, lockWriteChain, lockWriteChain, newBindingAdded, newBindingAdded, pointcutResolved, populateInterceptorsFromInfos, removeAdviceBinding, removeAdviceBindings, removeInterfaceIntroduction, removePerClassAspect, removePerInstanceAspect, removePerInstanceJoinpointAspect, resetChain, resetChain, resetChainKeepInterceptors, resetChainKeepInterceptors, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveConstructionPointcut, resolveConstructorPointcut, resolveMethodPointcut, resolveTypedAnnotation, resolveTypedAnnotation, resolveTypedAnnotation, resolveTypedAnnotation, resolveTypedAnnotation, resolveTypedAnnotation, setChainOverridingForInheritedMethods, setManager, setMetadata, unlockWriteChain, unlockWriteChain, updateConstructionPointcutAfterRemove, updateConstructorPointcutAfterRemove, updateFieldPointcutAfterRemove, updateFieldPointcutAfterRemove, updateMethodPointcutAfterRemove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.aop.InstanceAdvisor
hasAspects
 

Constructor Detail

MarshalledProxyAdvisor

public MarshalledProxyAdvisor(String name,
                              AspectManager manager)
Method Detail

setClazz

public void setClazz(Class<?> clazz)

addMethodInfo

public void addMethodInfo(MethodInfo info)

setInstance

public void setInstance(Object instance)

addClassMetaData

public void addClassMetaData(ClassMetaDataBinding data)
Specified by:
addClassMetaData in class Advisor

rebuildInterceptors

protected void rebuildInterceptors()
Specified by:
rebuildInterceptors in class Advisor

rebuildInterceptorsForAddedBinding

protected void rebuildInterceptorsForAddedBinding(AdviceBinding binding)
Specified by:
rebuildInterceptorsForAddedBinding in class Advisor

rebuildInterceptorsForRemovedBinding

protected void rebuildInterceptorsForRemovedBinding(AdviceBinding removedBinding)
Specified by:
rebuildInterceptorsForRemovedBinding in class Advisor

removeClassMetaData

public void removeClassMetaData(ClassMetaDataBinding data)
Specified by:
removeClassMetaData in class Advisor

getMethodInfo

public MethodInfo getMethodInfo(long hash)
Description copied from class: Advisor
Returns the MethodInfo that represents the execution of the method identified by hash.

Overrides:
getMethodInfo in class Advisor
Parameters:
hash - a hash code that identifies uniquely a method inside the context.
Returns:
a MethodInfo representing the queried method execution joinpoint.

getMethodInfos

public MethodInfo[] getMethodInfos()

appendInterceptor

public void appendInterceptor(Interceptor interceptor)
Description copied from interface: InstanceAdvisor
Appends an interceptor to the end of the instance's interceptor chain.

Specified by:
appendInterceptor in interface InstanceAdvisor
Parameters:
interceptor - the interceptor to be appended to the instance's chain

appendInterceptor

public void appendInterceptor(int index,
                              Interceptor interceptor)
                       throws IndexOutOfBoundsException
Description copied from interface: InstanceAdvisor
Appends an interceptor at position index of the appended instance's interceptor chain.

Specified by:
appendInterceptor in interface InstanceAdvisor
Parameters:
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.
Throws:
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 value

appendInterceptorStack

public void appendInterceptorStack(String stackName)
Description copied from interface: InstanceAdvisor
Appends an interceptor chain to the end of the instance's interceptor chain.

Specified by:
appendInterceptorStack in interface InstanceAdvisor
Parameters:
stackName - the name that identifies the interceptor stack to be appended

getDomain

public Domain getDomain()
Description copied from interface: InstanceAdvisor
Returns the domain where this advisor belongs. The domain contains all the configured AOP features (like bindings, aspects, and introductions) that should be applied to the advised instance.

Specified by:
getDomain in interface InstanceAdvisor
Returns:
the domain bound to this advisor

getInstance

public Object getInstance()
Description copied from interface: InstanceAdvisor
Returns the advised instance managed by this advisor.

Specified by:
getInstance in interface InstanceAdvisor
Returns:
the advised instance

getInterceptors

public Interceptor[] getInterceptors()
Description copied from interface: InstanceAdvisor
Returns the interceptor chain of the advised instance.

For internal use only.

Specified by:
getInterceptors in interface InstanceAdvisor
Returns:
the interceptor chain of the advised instance.

getInterceptors

public Interceptor[] getInterceptors(Interceptor[] baseChain)
Description copied from interface: InstanceAdvisor
Merges the advised instance interceptor chain with baseChain.
The result of the merge will contain first all the inserted interceptors, then baseChain, and finally all the appended interceptors.

For internal use only.

Specified by:
getInterceptors in interface InstanceAdvisor
Parameters:
baseChain - the chain to be joined with the advised instance's chain.
Returns:
a new interception chain as a result of the merge of baseChain with the instance's chain. May return baseChain if the last one is empty.

getMetaData

public SimpleMetaData getMetaData()
Description copied from interface: InstanceAdvisor
Returns the metadata bound to the advised instance.

Specified by:
getMetaData in interface InstanceAdvisor
Returns:
the metadata bound to the advised instance.

getPerInstanceAspect

public Object getPerInstanceAspect(String aspectName)
Description copied from interface: InstanceAdvisor
Returns a per instance aspect object identified by aspectName.
Notice that the aspect objects are created by JBoss AOP, either by using an aspect factory or by using the constructor of an aspect class.

For internal use only.

Specified by:
getPerInstanceAspect in interface InstanceAdvisor
Parameters:
aspectName - name of the queried aspect
Returns:
the per instance aspect named aspectName

getPerInstanceAspect

public Object getPerInstanceAspect(AspectDefinition def)
Description copied from interface: InstanceAdvisor
Returns a per instance aspect object defined by def.
Notice that the aspect objects are created by JBoss AOP, either by using an aspect factory or by using the constructor of an aspect class.

For internal use only.

Specified by:
getPerInstanceAspect in interface InstanceAdvisor
Parameters:
def - definition of the queried aspect
Returns:
the per instance aspect defined by def

getPerInstanceJoinpointAspect

public Object getPerInstanceJoinpointAspect(Joinpoint joinpoint,
                                            AspectDefinition def)
Description copied from interface: InstanceAdvisor
Returns the per instance joinpoint aspect object defined by def to be applied at joipoint.
Notice that the aspect objects are created by JBoss AOP, either by using an aspect factory or by using the constructor of an aspect class.

For internal use only.

Specified by:
getPerInstanceJoinpointAspect in interface InstanceAdvisor
Parameters:
joinpoint - the joinpoint to which the aspect object will be applied.
def - definition of the queried aspect
Returns:
the per instance joinpoint aspect defined by def to be applied at joinpoint

hasInterceptors

public boolean hasInterceptors()
Description copied from interface: InstanceAdvisor
Indicates if the advised instance interceptor chain is not empty.

Specified by:
hasInterceptors in interface InstanceAdvisor
Returns:
true if the advised instance interceptor chain contains one or more elements.

insertInterceptor

public void insertInterceptor(Interceptor interceptor)
Description copied from interface: InstanceAdvisor
Inserts an interceptor at the beginning of the instance's interceptor chain.

Specified by:
insertInterceptor in interface InstanceAdvisor
Parameters:
interceptor - the interceptor to be added to the instance's chain.

insertInterceptor

public void insertInterceptor(int index,
                              Interceptor interceptor)
                       throws IndexOutOfBoundsException
Description copied from interface: InstanceAdvisor
Inserts an interceptor at position index of the inserted instance's interceptor chain.

Specified by:
insertInterceptor in interface InstanceAdvisor
Parameters:
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.
Throws:
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 value

insertInterceptorStack

public void insertInterceptorStack(String stackName)
Description copied from interface: InstanceAdvisor
Inserts an interceptor stack to the beginning of the instance's interceptor chain.

Specified by:
insertInterceptorStack in interface InstanceAdvisor
Parameters:
stackName - the name that identifies the interceptor stack to be inserted

removeInterceptor

public void removeInterceptor(String name)
Description copied from interface: InstanceAdvisor
Removes an interceptor from instance's interceptor chain.

Specified by:
removeInterceptor in interface InstanceAdvisor
Parameters:
name - name of the interceptor to be removed from the chain.
See Also:
Interceptor.getName()

removeInterceptorStack

public void removeInterceptorStack(String name)
Description copied from interface: InstanceAdvisor
Removes an interceptor stack from the instance's interceptor chain.

Specified by:
removeInterceptorStack in interface InstanceAdvisor
Parameters:
name - the name that identifies the interceptor stack to be removed


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