Brooklyn

brooklyn.util.javalang
[Java] Class AggregateClassLoader

java.lang.Object
  java.lang.ClassLoader
      brooklyn.util.javalang.AggregateClassLoader

public class AggregateClassLoader
extends java.lang.ClassLoader

looks for classes and resources in the classloaders added here

similar to XStream's CompositeClassLoader, but also supporting resources, exposing more info, a few conveniences, and a nice toString


Method Summary
void add(int index, java.lang.ClassLoader classLoader)

Add a loader to the specific position in the search path.

void addFirst(java.lang.ClassLoader classLoader)

Add a loader to the first position in the search path.

void addLast(java.lang.ClassLoader classLoader)

Add a loader to the last position in the search path.

protected java.lang.Class findClass(java.lang.String name)

java.util.List getList()

Returns the _live_ (and modifiable) list of classloaders @return

java.net.URL getResource(java.lang.String name)

static AggregateClassLoader newInstanceWithDefaultLoaders()

creates default instance, with classloaders of Object and AggregateClassLoader

static AggregateClassLoader newInstanceWithNoLoaders()

creates default instance, with no classloaders (assuming this instance will itself be nested, or defaults will be added by caller)

java.lang.String toString()

 
Methods inherited from class java.lang.ClassLoader
java.lang.ClassLoader#loadClass(java.lang.String), java.lang.ClassLoader#getSystemClassLoader(), java.lang.ClassLoader#getResourceAsStream(java.lang.String), java.lang.ClassLoader#getResource(java.lang.String), java.lang.ClassLoader#getSystemResourceAsStream(java.lang.String), java.lang.ClassLoader#getSystemResource(java.lang.String), java.lang.ClassLoader#getResources(java.lang.String), java.lang.ClassLoader#getSystemResources(java.lang.String), java.lang.ClassLoader#getParent(), java.lang.ClassLoader#setDefaultAssertionStatus(boolean), java.lang.ClassLoader#setPackageAssertionStatus(java.lang.String, boolean), java.lang.ClassLoader#setClassAssertionStatus(java.lang.String, boolean), java.lang.ClassLoader#clearAssertionStatus(), java.lang.ClassLoader#wait(), java.lang.ClassLoader#wait(long), java.lang.ClassLoader#wait(long, int), java.lang.ClassLoader#equals(java.lang.Object), java.lang.ClassLoader#toString(), java.lang.ClassLoader#hashCode(), java.lang.ClassLoader#getClass(), java.lang.ClassLoader#notify(), java.lang.ClassLoader#notifyAll()
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

add

public void add(int index, java.lang.ClassLoader classLoader)
Add a loader to the specific position in the search path. (It is callers responsibility to ensure that position is valid.)


addFirst

public void addFirst(java.lang.ClassLoader classLoader)
Add a loader to the first position in the search path.


addLast

public void addLast(java.lang.ClassLoader classLoader)
Add a loader to the last position in the search path.


findClass

@Override
protected java.lang.Class findClass(java.lang.String name)


getList

public java.util.List getList()
Returns the _live_ (and modifiable) list of classloaders @return


getResource

@Override
public java.net.URL getResource(java.lang.String name)


newInstanceWithDefaultLoaders

public static AggregateClassLoader newInstanceWithDefaultLoaders()
creates default instance, with classloaders of Object and AggregateClassLoader


newInstanceWithNoLoaders

public static AggregateClassLoader newInstanceWithNoLoaders()
creates default instance, with no classloaders (assuming this instance will itself be nested, or defaults will be added by caller)


toString

@Override
public java.lang.String toString()


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.