org.jboss.aop.proxy.container
Class InstanceProxyContainer

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

public class InstanceProxyContainer
extends ClassProxyContainer
implements InstanceAdvisor

The InstanceAdvisor returned by ClassProxyContainer

Version:
$Revision: 73394 $
Author:
Kabir Khan

Field Summary
 
Fields inherited from class org.jboss.aop.ClassContainer
advisedFields
 
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, methodInfos, methodInterceptors, methodMetaData, name, NULL_ASPECT, perInstanceAspectDefinitions, perInstanceJoinpointAspectDefinitions
 
Constructor Summary
InstanceProxyContainer(String name, ProxyAdvisorDomain instanceDomain, Advisor classAdvisor, org.jboss.metadata.spi.MetaData metaData)
           
 
Method Summary
 void appendInterceptor(Interceptor interceptor)
          Not implemented InstanceAdvisor method, we should be using the domain
 void appendInterceptor(int index, Interceptor interceptor)
          Not implemented InstanceAdvisor method, we should be using the domain
 void appendInterceptorStack(String stackName)
          Not implemented InstanceAdvisor method, we should be using the domain
static InstanceProxyContainer createInstanceProxyContainer(Advisor classAdvisor, InterfaceIntroduction introduction, org.jboss.metadata.spi.MetaData metaData)
           
 Advisor getClassAdvisor()
           
 Domain getDomain()
          Returns the domain where this advisor belongs.
 Object getInstance()
          Returns the advised instance managed by this advisor.
 Interceptor[] getInterceptors()
          Not implemented InstanceAdvisor method, we should be using the domain
 Interceptor[] getInterceptors(Interceptor[] baseChain)
          Not implemented InstanceAdvisor method, we should be using the domain
 SimpleMetaData getMetaData()
          Returns the metadata bound to the advised instance.
 MethodInfo getMethodInfo(long hash)
          If the target instance is advised, make sure that we set the unadvised method to the one stored by the class advisor so that we don't get double invocations.
protected  Advisor getParentAdvisor()
           
 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()
          Not implemented InstanceAdvisor method, we should be using the domain
 void insertInterceptor(Interceptor interceptor)
          Not implemented InstanceAdvisor method, we should be using the domain
 void insertInterceptor(int index, Interceptor interceptor)
          Not implemented InstanceAdvisor method, we should be using the domain
 void insertInterceptorStack(String stackName)
          Not implemented InstanceAdvisor method, we should be using the domain
 void removeFromDomain()
           
 void removeInterceptor(String name)
          Not implemented InstanceAdvisor method, we should be using the domain
 void removeInterceptorStack(String name)
          Not implemented InstanceAdvisor method, we should be using the domain
 
Methods inherited from class org.jboss.aop.proxy.container.ClassProxyContainer
addPerClassAspect, chainOverridingForInheritedMethods, createConstructorTables, createInstanceProxyContainer, createMethodMap, getMethodInfos, getPerClassAspect, initialise
 
Methods inherited from class org.jboss.aop.ClassContainer
addClassMetaData, bindClassMetaData, createFieldTable, createInterceptorChains, initializeClassContainer, initializeClassContainer, initializeMetadata, initializeMethodChain, rebindClassMetaData, rebuildInterceptors, rebuildInterceptorsForAddedBinding, rebuildInterceptorsForRemovedBinding, removeClassMetaData, setChainOverridingForInheritedMethods, setClass, updateInterceptorChains
 
Methods inherited from class org.jboss.aop.Advisor
addAdviceInterceptor, addInterfaceIntroduction, addPerInstanceAspect, addPerInstanceJoinpointAspect, adjustInfoForAddedBinding, 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, 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, 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

InstanceProxyContainer

public InstanceProxyContainer(String name,
                              ProxyAdvisorDomain instanceDomain,
                              Advisor classAdvisor,
                              org.jboss.metadata.spi.MetaData metaData)
Method Detail

createInstanceProxyContainer

public static InstanceProxyContainer createInstanceProxyContainer(Advisor classAdvisor,
                                                                  InterfaceIntroduction introduction,
                                                                  org.jboss.metadata.spi.MetaData metaData)

getClassAdvisor

public Advisor getClassAdvisor()

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

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.

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

hasInterceptors

public boolean hasInterceptors()
Not implemented InstanceAdvisor method, we should be using the domain

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

getInterceptors

public Interceptor[] getInterceptors()
Not implemented InstanceAdvisor method, we should be using the domain

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

getInterceptors

public Interceptor[] getInterceptors(Interceptor[] baseChain)
Not implemented InstanceAdvisor method, we should be using the domain

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.

insertInterceptor

public void insertInterceptor(Interceptor interceptor)
Not implemented InstanceAdvisor method, we should be using the domain

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

removeInterceptor

public void removeInterceptor(String name)
Not implemented InstanceAdvisor method, we should be using the domain

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

appendInterceptor

public void appendInterceptor(Interceptor interceptor)
Not implemented InstanceAdvisor method, we should be using the domain

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

insertInterceptorStack

public void insertInterceptorStack(String stackName)
Not implemented InstanceAdvisor method, we should be using the domain

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

removeInterceptorStack

public void removeInterceptorStack(String name)
Not implemented InstanceAdvisor method, we should be using the domain

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

appendInterceptorStack

public void appendInterceptorStack(String stackName)
Not implemented InstanceAdvisor method, we should be using the domain

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

insertInterceptor

public void insertInterceptor(int index,
                              Interceptor interceptor)
Not implemented InstanceAdvisor method, we should be using the domain

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.

appendInterceptor

public void appendInterceptor(int index,
                              Interceptor interceptor)
Not implemented InstanceAdvisor method, we should be using the domain

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.

removeFromDomain

public void removeFromDomain()

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

getMethodInfo

public MethodInfo getMethodInfo(long hash)
If the target instance is advised, make sure that we set the unadvised method to the one stored by the class advisor so that we don't get double invocations.

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.

getParentAdvisor

protected Advisor getParentAdvisor()
Overrides:
getParentAdvisor in class ClassProxyContainer


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