Mp3dings 
20100427

de.mospace.lang
Class MinimalClassLoaderProvider

java.lang.Object
  extended by de.mospace.lang.MinimalClassLoaderProvider
All Implemented Interfaces:
ClassLoaderProvider, Serializable
Direct Known Subclasses:
DefaultClassLoaderProvider

public class MinimalClassLoaderProvider
extends Object
implements ClassLoaderProvider, Serializable

A minimal implementation of the ClassLoaderProvider interface whose getClassLoader method always returns the same classloader.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface de.mospace.lang.ClassLoaderProvider
serialVersionUID
 
Constructor Summary
MinimalClassLoaderProvider()
          Contructs a new MinimalClassLoaderProvider whose getClassLoader() method will always return the system class loader.
MinimalClassLoaderProvider(ClassLoader classLoader)
          Contructs a new MinimalClassLoaderProvider whose getClassLoader() method will always return the specified class loader.
 
Method Summary
 ClassLoader getClassLoader()
          Returns the class loader specified when this MinimalClassLoader is instantiated.
 boolean registerLibraries(File[] jarFiles)
          Does nothing.
 boolean registerLibrary(File jarFile)
          Apart from possibly throwing an IllegalArgumentException a call to this method has no effect.
 boolean registerLibraryDirectories(File[] dirs)
          Does nothing.
 boolean registerLibraryDirectory(File dir)
          Apart from possibly throwing an IllegalArgumentException a call to this method has no effect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinimalClassLoaderProvider

public MinimalClassLoaderProvider(ClassLoader classLoader)
Contructs a new MinimalClassLoaderProvider whose getClassLoader() method will always return the specified class loader.

Parameters:
classLoader - the class loader that will be returned by this object's getClassLoader() method

MinimalClassLoaderProvider

public MinimalClassLoaderProvider()
Contructs a new MinimalClassLoaderProvider whose getClassLoader() method will always return the system class loader.

See Also:
ClassLoader.getSystemClassLoader()
Method Detail

getClassLoader

public ClassLoader getClassLoader()
Returns the class loader specified when this MinimalClassLoader is instantiated.

Specified by:
getClassLoader in interface ClassLoaderProvider
Returns:
a ClassLoader that looks for class files in all successfully registered libraries.

registerLibrary

public boolean registerLibrary(File jarFile)
Apart from possibly throwing an IllegalArgumentException a call to this method has no effect.

Specified by:
registerLibrary in interface ClassLoaderProvider
Parameters:
jarFile - a jar archive with Java class files
Returns:
false
Throws:
IllegalArgumentException - if jarFile does not exist or is not a jar file

registerLibraries

public boolean registerLibraries(File[] jarFiles)
Does nothing.

Specified by:
registerLibraries in interface ClassLoaderProvider
Parameters:
jarFiles - an array of jar archives with Java class files
Returns:
false

registerLibraryDirectory

public boolean registerLibraryDirectory(File dir)
Apart from possibly throwing an IllegalArgumentException a call to this method has no effect.

Specified by:
registerLibraryDirectory in interface ClassLoaderProvider
Parameters:
dir - a directory with jar archives
Returns:
false
Throws:
IllegalArgumentException - if dir is not a directory

registerLibraryDirectories

public boolean registerLibraryDirectories(File[] dirs)
Does nothing.

Specified by:
registerLibraryDirectories in interface ClassLoaderProvider
Parameters:
dirs - an array o directories with jar archives
Returns:
false

Mp3dings 
20100427