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 URLs.

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

Field Summary
 
Fields inherited from interface org.apache.avalon.phoenix.interfaces.ClassLoaderManager
ROLE
 
Constructor Summary
DefaultClassLoaderManager()
           
 
Method Summary
 void contextualize(Context context)
          Pass the Context to the Manager.
 java.lang.ClassLoader createClassLoader(Configuration environment, java.io.File source, java.io.File homeDirectory, java.io.File workDirectory, java.lang.String[] classPath)
          Create a ClassLoader for a specific application.
 void service(ServiceManager serviceManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultClassLoaderManager

public DefaultClassLoaderManager()
Method Detail

contextualize

public void contextualize(Context context)
                   throws ContextException
Pass the Context to the Manager. It is expected that the there will be an entry

Parameters:
context - the context
Throws:
ContextException - if context does not contain common classloader

service

public void service(ServiceManager serviceManager)
             throws ServiceException
ServiceException

createClassLoader

public java.lang.ClassLoader createClassLoader(Configuration environment,
                                               java.io.File source,
                                               java.io.File homeDirectory,
                                               java.io.File workDirectory,
                                               java.lang.String[] classPath)
                                        throws java.lang.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 application
source - the source of application. (usually the name of the .sar file or else the same as baseDirectory)
homeDirectory - the base directory of application
workDirectory - the work directory of application
classPath - the list of URLs in applications deployment
Returns:
the ClassLoader created
Throws:
java.lang.Exception - if an error occurs


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.