Top Description Methods
org.aspectj.weaver.loadtime

public Interface IWeavingContext

Known Direct Implementers
org.aspectj.weaver.loadtime.DefaultWeavingContext
Imports
java.io.IOException, java.net.URL, java.util.Enumeration, .List, org.aspectj.weaver.loadtime.definition.Definition, org.aspectj.weaver.tools.WeavingAdaptor

This class adds support to AspectJ for an OSGi environment
Author
David Knibb

Method Summary

Modifier and TypeMethod and Description
public String
getBundleIdFromURL(URL url)

Deprecated use getFile() or getClassLoaderName()
In an OSGi environment, determine which bundle a URL originated from.
public ClassLoader
public String

Returns:

name of the associated class loader
getClassLoaderName
()

In an environment with multiple class loaders allows each to be identified using something safer and possibly shorter than toString

public List<Definition>

Returns:

List containing 0 or more Definition instances
getDefinitions
(final ClassLoader loader, WeavingAdaptor adaptor)

Allow custom parsing of aop.xml or alternative mechanism for providing Definitions

public String

Returns:

filename
getFile
(URL url)

Format a URL

public String

Returns:

short name
getId
()

In an environment with multiple class loaders allows messages to identified according to the weaving context

public Enumeration<URL>

Returns:

an enumeration containing all of the matching resources found
getResources
(String
the name of the resource to search for
name
)

Allows the standard ClassLoader.getResources() mechanisms to be replaced with a different implementation.

public boolean

Returns:

true if the associated classloader will define the class
isLocallyDefined
(String
name of the class, eg. "java.lang.String"
classname
)

Return true if the classloader associated with this weaving context is the one that will define the class with the specified name.

Method Detail

getBundleIdFromURLback to summary
public String getBundleIdFromURL(URL url)

Deprecated

use getFile() or getClassLoaderName()

In an OSGi environment, determine which bundle a URL originated from. In a non-OSGi environment, implementors should return null.

getClassLoaderback to summary
public ClassLoader getClassLoader()
getClassLoaderNameback to summary
public String getClassLoaderName()

In an environment with multiple class loaders allows each to be identified using something safer and possibly shorter than toString

Returns:String

name of the associated class loader

getDefinitionsback to summary
public List<Definition> getDefinitions(final ClassLoader loader, WeavingAdaptor adaptor)

Allow custom parsing of aop.xml or alternative mechanism for providing Definitions

Returns:List<Definition>

List containing 0 or more Definition instances

getFileback to summary
public String getFile(URL url)

Format a URL

Returns:String

filename

getIdback to summary
public String getId()

In an environment with multiple class loaders allows messages to identified according to the weaving context

Returns:String

short name

getResourcesback to summary
public Enumeration<URL> 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.

Parameters
name:String

the name of the resource to search for

Returns:Enumeration<URL>

an enumeration containing all of the matching resources found

isLocallyDefinedback to summary
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.

Parameters
classname:String

name of the class, eg. "java.lang.String"

Returns:boolean

true if the associated classloader will define the class