org.aspectj.weaver.loadtime

## Interface IWeavingContext

All Known Implementing Classes:
  DefaultWeavingContext

    public interface IWeavingContext

This class adds support to AspectJ for an OSGi environment

Author:
  David Knibb

### Method Summary

Methods
`java.lang.String` `getBundleIdFromURL(java.net.URL url)` Deprecated. use getFile() or getClassLoaderName()
`java.lang.ClassLoader` `getClassLoader()`
`java.lang.String` `getClassLoaderName()` In an environment with multiple class loaders allows each to be identified using something safer and possibly shorter than toString
`java.util.List` `getDefinitions(java.lang.ClassLoader loader, WeavingAdaptor adaptor)` Allow custom parsing of aop.xml or alternative mechanism for providing Definitions
`java.lang.String` `getFile(java.net.URL url)` Format a URL
`java.lang.String` `getId()` In an environment with multiple class loaders allows messages to identified according to the weaving context
`java.util.Enumeration` `getResources(java.lang.String name)` Allows the standard ClassLoader.getResources() mechanisms to be replaced with a different implementation.
`boolean` `isLocallyDefined(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

#### getResources

    java.util.Enumeration getResources(java.lang.String name)
                                       throws java.io.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` - the name of the resource to search for
Returns:
  an enumeration containing all of the matching resources found
Throws:
  `java.io.IOException`

#### getBundleIdFromURL

    java.lang.String getBundleIdFromURL(java.net.URL url)

Deprecated. use getFile() or getClassLoaderName()
In an OSGi environment, determin which bundle a URL originated from. In a non-OSGi environment, implementors should return `null`.``

Parameters:
  `url` -
Returns:

#### getClassLoaderName

    java.lang.String getClassLoaderName()

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

Returns:
  name of the associated class loader

#### getClassLoader

    java.lang.ClassLoader getClassLoader()

#### getFile

    java.lang.String getFile(java.net.URL url)

Format a URL

Returns:
  filename

#### getId

    java.lang.String getId()

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

Returns:
  short name

#### isLocallyDefined

    boolean isLocallyDefined(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. 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` - name of the class, eg. "java.lang.String"
Returns:
  true if the associated classloader will define the class

#### getDefinitions

    java.util.List getDefinitions(java.lang.ClassLoader loader,
                                WeavingAdaptor adaptor)

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

Parameters:
  `loader` -
  `adaptor` -
Returns:
  List containing 0 or more Definition instances