| java.lang.Object org.codehaus.aspectwerkz.aspect.management.Aspects
Method Summary | |
public static Object | aspect$Of(ClassLoader loader, String qName, String containerClassName) | public static Object | aspect$Of(String qName, String containerClassName, Class perClass) | public static Object | aspect$Of(String qName, String containerClassName, Object perInstance) | public static Object | aspectOf(String qName) Returns the singleton aspect instance for the aspect with the given qualified name. | public static Object | aspectOf(Class aspectClass) Returns the singleton aspect instance for the given aspect class. | public static Object | aspectOf(ClassLoader visibleFrom, String qName) Returns the singleton aspect instance for given aspect qName, with visibility from the given class loader
Parameters: visibleFrom - the class loader from where aspect is visible, likely to be the class loader of theadvised classes, or the one where the system hosting the aspect is deployed. | public static Object | aspectOf(Class aspectClass, Class targetClass) | public static Object | aspectOf(String qName, Class targetClass) | public static Object | aspectOf(Class aspectClass, Object targetInstance) | public static Object | aspectOf(String qName, Object targetInstance) | public static String[] | getAspectQNameContainerClassName(ClassLoader visibleFrom, String qName) Returns the aspect container class for the given aspect class qName. | public static AspectContainer | getContainerQNamed(ClassLoader visibleFrom, Class containerClass, String qName) Returns or create the aspect container for the given container class with the given aspect qualified name
We keep a weak key for the containerClass, and we then keep a list of container instance based on a composite key
based on the tuple {visibleFromClassLoader.hashCode, aspectQName}, so that when hot deploying a web app, the
aspects gets tied to the web app class loader even when the container class is higher up (f.e. |
DEFAULT_ASPECT_CONTAINER | final public static String DEFAULT_ASPECT_CONTAINER(Code) | | The default aspect container class.
|
aspectOf | public static Object aspectOf(String qName)(Code) | | Returns the singleton aspect instance for the aspect with the given qualified name.
The aspect is looked up from the thread context classloader.
Parameters: qName - the qualified name of the aspect the singleton aspect instance |
aspectOf | public static Object aspectOf(Class aspectClass)(Code) | | Returns the singleton aspect instance for the given aspect class.
Consider using aspectOf(visibleFrom, qName) if the aspect is used more than once
or if it is used in a class loader which is child of its own classloader.
Parameters: aspectClass - the class of the aspect the singleton aspect instance |
aspectOf | public static Object aspectOf(ClassLoader visibleFrom, String qName)(Code) | | Returns the singleton aspect instance for given aspect qName, with visibility from the given class loader
Parameters: visibleFrom - the class loader from where aspect is visible, likely to be the class loader of theadvised classes, or the one where the system hosting the aspect is deployed. the singleton aspect instance |
aspectOf | public static Object aspectOf(Class aspectClass, Class targetClass)(Code) | | Returns the per class aspect attached to targetClass
Consider using aspectOf(qName, targetClass) if the aspect is used more than once
Parameters: aspectClass - the name of the aspect Parameters: targetClass - the target class the per class aspect instance |
aspectOf | public static Object aspectOf(String qName, Class targetClass)(Code) | | Returns the per class aspect instance for the aspect with the given qualified name for targetClass
Parameters: qName - the qualified name of the aspect Parameters: targetClass - the target class the per class aspect instance |
aspectOf | public static Object aspectOf(Class aspectClass, Object targetInstance)(Code) | | Returns the per instance aspect attached to targetInstance
Consider using aspectOf(qName, targetInstance) if the aspect is used more than once
Parameters: aspectClass - the name of the aspect Parameters: targetInstance - the target instance the per class aspect instance |
aspectOf | public static Object aspectOf(String qName, Object targetInstance)(Code) | | Returns the per instance aspect attached to targetInstance
Parameters: qName - the qualified name of the aspect Parameters: targetInstance - the target instance the per class aspect instance |
getAspectQNameContainerClassName | public static String[] getAspectQNameContainerClassName(ClassLoader visibleFrom, String qName)(Code) | | Returns the aspect container class for the given aspect class qName.
The qName is returned since we may have only the aspect class name upon lookup
Parameters: visibleFrom - class loader to look from Parameters: qName - the container class |
getContainerQNamed | public static AspectContainer getContainerQNamed(ClassLoader visibleFrom, Class containerClass, String qName)(Code) | | Returns or create the aspect container for the given container class with the given aspect qualified name
We keep a weak key for the containerClass, and we then keep a list of container instance based on a composite key
based on the tuple {visibleFromClassLoader.hashCode, aspectQName}, so that when hot deploying a web app, the
aspects gets tied to the web app class loader even when the container class is higher up (f.e. in aw.jar)
Parameters: visibleFrom - class loader hosting the advised class ie from where all is visible Parameters: containerClass - Parameters: qName - |
|
|