net.sf.taverna.raven.repository
Class AggregatingClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by net.sf.taverna.raven.repository.AggregatingClassLoader

public class AggregatingClassLoader
extends java.lang.ClassLoader

ClassLoader implementation as a convenience to allow searching of multiple artifact based classloaders. This can be used for cases such as the Beanshell where only a single ClassLoader can be specified, should such cases require classes from multiple independant artifacts this class can aggregate a set of classloaders, delegating to each in turn until an appropriate match is found for a class or resource.

Author:
Tom Oinn

Constructor Summary
AggregatingClassLoader(Repository rep, java.util.List<Artifact> artifacts)
           
AggregatingClassLoader(Repository rep, java.util.List<Artifact> artifacts, java.lang.ClassLoader parent)
           
 
Method Summary
 java.net.URL findResource(java.lang.String name)
           
 java.util.Enumeration<java.net.URL> findResources(java.lang.String name)
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregatingClassLoader

public AggregatingClassLoader(Repository rep,
                              java.util.List<Artifact> artifacts)
                       throws ArtifactStateException,
                              ArtifactNotFoundException
Throws:
ArtifactStateException
ArtifactNotFoundException

AggregatingClassLoader

public AggregatingClassLoader(Repository rep,
                              java.util.List<Artifact> artifacts,
                              java.lang.ClassLoader parent)
                       throws ArtifactStateException,
                              ArtifactNotFoundException
Throws:
ArtifactStateException
ArtifactNotFoundException
Method Detail

findResource

public java.net.URL findResource(java.lang.String name)
Overrides:
findResource in class java.lang.ClassLoader

findResources

public java.util.Enumeration<java.net.URL> findResources(java.lang.String name)
                                                  throws java.io.IOException
Overrides:
findResources in class java.lang.ClassLoader
Throws:
java.io.IOException