Package org.aspectj.weaver.loadtime
Class DefaultWeavingContext
java.lang.Object
org.aspectj.weaver.loadtime.DefaultWeavingContext
- All Implemented Interfaces:
IWeavingContext
Use in non-OSGi environment
- Author:
- David Knibb
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultWeavingContext(ClassLoader loader)Construct a new WeavingContext to use the specified ClassLoader This is the constructor which should be used. -
Method Summary
Modifier and TypeMethodDescriptiongetBundleIdFromURL(URL url)In an OSGi environment, determine which bundle a URL originated from.In an environment with multiple class loaders allows each to be identified using something safer and possibly shorter than toStringgetDefinitions(ClassLoader loader, WeavingAdaptor adaptor)Simply call weaving adaptor back to parse aop.xmlFormat a URLgetId()In an environment with multiple class loaders allows messages to identified according to the weaving contextgetResources(String name)Same as ClassLoader.getResources()booleanisLocallyDefined(String classname)Return true if the classloader associated with this weaving context is the one that will define the class with the specified name.
-
Field Details
-
loaderRef
-
-
Constructor Details
-
DefaultWeavingContext
Construct a new WeavingContext to use the specified ClassLoader This is the constructor which should be used.- Parameters:
loader-
-
-
Method Details
-
getResources
Same as ClassLoader.getResources()- Specified by:
getResourcesin interfaceIWeavingContext- Parameters:
name- the name of the resource to search for- Returns:
- an enumeration containing all of the matching resources found
- Throws:
IOException
-
getBundleIdFromURL
Description copied from interface:IWeavingContextIn an OSGi environment, determine which bundle a URL originated from. In a non-OSGi environment, implementors should returnnull.- Specified by:
getBundleIdFromURLin interfaceIWeavingContext- Returns:
- null as we are not in an OSGi environment (therefore no bundles)
-
getClassLoaderName
Description copied from interface:IWeavingContextIn an environment with multiple class loaders allows each to be identified using something safer and possibly shorter than toString- Specified by:
getClassLoaderNamein interfaceIWeavingContext- Returns:
- classname@hashcode
-
getClassLoader
- Specified by:
getClassLoaderin interfaceIWeavingContext
-
getFile
Description copied from interface:IWeavingContextFormat a URL- Specified by:
getFilein interfaceIWeavingContext- Returns:
- filename
-
getId
Description copied from interface:IWeavingContextIn an environment with multiple class loaders allows messages to identified according to the weaving context- Specified by:
getIdin interfaceIWeavingContext- Returns:
- unqualifiedclassname@hashcode
-
getSuffix
-
isLocallyDefined
Description copied from interface:IWeavingContextReturn true if the classloader associated with this weaving context is the one that will define the class with the specified name. In a delegating classloader hierarchy this might check the parent won't define it and the child will - in OSGi it will do something else.- Specified by:
isLocallyDefinedin interfaceIWeavingContext- Parameters:
classname- name of the class, eg. "java.lang.String"- Returns:
- true if the associated classloader will define the class
-
getDefinitions
Simply call weaving adaptor back to parse aop.xml- Specified by:
getDefinitionsin interfaceIWeavingContext- Parameters:
adaptor-loader-- Returns:
- List containing 0 or more Definition instances
-