org.apache.avalon.phoenix.components.classloader
Class DefaultClassLoaderManager
java.lang.Object
|
+--AbstractLogEnabled
|
+--org.apache.avalon.phoenix.components.classloader.DefaultClassLoaderManager
- All Implemented Interfaces:
- ClassLoaderManager
- public class DefaultClassLoaderManager
- extends AbstractLogEnabled
- implements ClassLoaderManager
Component that creates and manages the ClassLoader
for an application loaded out of a .sar deployment.
Currently it creates a policy based on the policy declaration
in the configuration. It then just creates a URLClassLoader and
populates it with the specified codebase URL
s.
In the future this class will scan the manifests for "Optional
Packages" formely called "Extensions" which it will add to the
ClassLoader
- Author:
- Peter Donald
- See Also:
ClassLoaderManager
,
Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultClassLoaderManager
public DefaultClassLoaderManager()
contextualize
public void contextualize(Context context)
throws ContextException
- Pass the Context to the Manager.
It is expected that the there will be an entry
common.classloader : ClassLoader shared betweeen
container and applications
- Parameters:
context
- the context
- Throws:
ContextException
- if context does not contain common classloader
service
public void service(ServiceManager serviceManager)
throws ServiceException
ServiceException
createClassLoader
public ClassLoader createClassLoader(Configuration environment,
File source,
File homeDirectory,
File workDirectory,
String[] classPath)
throws Exception
- Create a
ClassLoader
for a specific application.
See Class Javadoc for description of technique for creating
ClassLoader
.
- Specified by:
createClassLoader
in interface ClassLoaderManager
- Parameters:
environment
- the configuration "environment.xml" for the applicationsource
- the source of application. (usually the name of the .sar file
or else the same as baseDirectory)homeDirectory
- the base directory of applicationworkDirectory
- the work directory of applicationclassPath
- the list of URLs in applications deployment
- Returns:
- the ClassLoader created
- Throws:
Exception
- if an error occurs
Copyright © 2001 Apache Jakarta Project. All Rights Reserved.