org.aspectj.weaver.loadtime
Interface IWeavingContext
- DefaultWeavingContext
public interface IWeavingContext
This class adds support to AspectJ for an OSGi environment
String | getBundleIdFromURL(URL url) - use getFile() or getClassLoaderName()
|
String | getClassLoaderName() - In an environment with multiple class loaders allows each to be
identified using something safer and possibly shorter than toString
|
List | getDefinitions(ClassLoader loader, WeavingAdaptor adaptor) - Allow custom parsing of aop.xml or alternative mechanism for providing
Definitions
|
String | getFile(URL url) - Format a URL
|
String | getId() - In an environment with multiple class loaders allows messages
to identified according to the weaving context
|
Enumeration | getResources(String name) - Allows the standard ClassLoader.getResources() mechanisms to be
replaced with a different implementation.
|
boolean | isLocallyDefined(String classname) - Return true if the classloader associated with this weaving context
is the one that will define the class with the specified name.
|
getBundleIdFromURL
public String getBundleIdFromURL(URL url)
use getFile() or getClassLoaderName()
In an OSGi environment, determin which bundle a URL originated from.
In a non-OSGi environment, implementors should return null
.
getClassLoaderName
public String getClassLoaderName()
In an environment with multiple class loaders allows each to be
identified using something safer and possibly shorter than toString
- name of the associated class loader
getDefinitions
public List getDefinitions(ClassLoader loader,
WeavingAdaptor adaptor)
Allow custom parsing of aop.xml or alternative mechanism for providing
Definitions
- List containing 0 or more Definition instances
getFile
public String getFile(URL url)
Format a URL
getId
public String getId()
In an environment with multiple class loaders allows messages
to identified according to the weaving context
getResources
public Enumeration getResources(String name)
throws IOException
Allows the standard ClassLoader.getResources() mechanisms to be
replaced with a different implementation.
In an OSGi environment, this will allow for filtering to take
place on the results of ClassLoader.getResources(). In a non-OSGi
environment, ClassLoader.getResources should be returned.
name
- the name of the resource to search for
- an enumeration containing all of the matching resources found
isLocallyDefined
public boolean isLocallyDefined(String classname)
Return 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.
classname
- name of the class, eg. "java.lang.String"
- true if the associated classloader will define the class