Mp3dings 
20100427

de.mospace.lang
Interface ClassLoaderProvider

All Superinterfaces:
Serializable
All Known Implementing Classes:
Application, DefaultClassLoaderProvider, MinimalClassLoaderProvider

public interface ClassLoaderProvider
extends Serializable

This interface essentially provides the functionality of a dynamic class path. Libraries can be registered with a ClassLoaderProvider and class loaders that look for class files in these libraries can be obtained with the getClassLoader() method.


Field Summary
static long serialVersionUID
          serialization version id
 
Method Summary
 ClassLoader getClassLoader()
          Returns a class loader that looks for class files in all libraries that have been successfully registered with this ClassLoaderProvider, so far.
 boolean registerLibraries(File[] jarFiles)
          Requests that the specified jar files be registered, so that they are in the class path of all class loaders returned by future calls to getClassLoader().
 boolean registerLibrary(File jarFile)
          Requests that the specified jar file be registered, so that it is in the class path of all class loaders returned by future calls to getClassLoader().
 boolean registerLibraryDirectories(File[] dirs)
          Requests that the all jar files in the specified directories be registered, so that they are in the class path of all class loaders returned by future calls to getClassLoader().
 boolean registerLibraryDirectory(File dir)
          Requests that the all jar files in the specified directory be registered, so that they are in the class path of all class loaders returned by future calls to getClassLoader().
 

Field Detail

serialVersionUID

static final long serialVersionUID
serialization version id

See Also:
Constant Field Values
Method Detail

getClassLoader

ClassLoader getClassLoader()
Returns a class loader that looks for class files in all libraries that have been successfully registered with this ClassLoaderProvider, so far. Subsequent calls to this method must return the same class loader or class loaders that delegate to all class loaders previously returned.

Returns:
a ClassLoader that looks for class files in all successfully registered libraries.

registerLibrary

boolean registerLibrary(File jarFile)
Requests that the specified jar file be registered, so that it is in the class path of all class loaders returned by future calls to getClassLoader().

Parameters:
jarFile - a jar archive with Java class files
Returns:
true if the ClassLoaderProvider honored the request.
Throws:
IllegalArgumentException - if jarFile does not exist or is not a jar file

registerLibraries

boolean registerLibraries(File[] jarFiles)
Requests that the specified jar files be registered, so that they are in the class path of all class loaders returned by future calls to getClassLoader().

Parameters:
jarFiles - an array of jar archives with Java class files
Returns:
true if the ClassLoaderProvider honored the request at least for one jar file.

registerLibraryDirectory

boolean registerLibraryDirectory(File dir)
Requests that the all jar files in the specified directory be registered, so that they are in the class path of all class loaders returned by future calls to getClassLoader().

Parameters:
dir - a directory with jar archives
Returns:
true if there was at least one jar archive in dir, for wich the request was honored.

registerLibraryDirectories

boolean registerLibraryDirectories(File[] dirs)
Requests that the all jar files in the specified directories be registered, so that they are in the class path of all class loaders returned by future calls to getClassLoader().

Parameters:
dirs - an array of directories with jar archives
Returns:
true if there was at least one jar archive in dirs, for wich the request was honored.

Mp3dings 
20100427