com.sun.slamd.common
Class JobClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by com.sun.slamd.common.JobClassLoader

public class JobClassLoader
extends java.lang.ClassLoader

This class defines a class loader that will be used to load SLAMD job classes. Defining a custom class loader for job classes makes it possible to unload them if necessary to replace them on the fly in a running VM.

Author:
Neil A. Wilson

Constructor Summary
JobClassLoader(java.lang.ClassLoader parentClassLoader, java.lang.String classPath)
          Creates a new instance of this job class loader.
 
Method Summary
 JobClass getJobClass(java.lang.String className)
          Retrieves the job class with the specified name.
 byte[] getJobClassBytes(java.lang.String className)
          Retrieves the binary representation of the specified job class.
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobClassLoader

public JobClassLoader(java.lang.ClassLoader parentClassLoader,
                      java.lang.String classPath)
Creates a new instance of this job class loader.

Parameters:
parentClassLoader - The class loader that should be used if this class loader cannot create the class.
classPath - The path to the root of the hierarchy for the class files to be loaded.
Method Detail

getJobClass

public JobClass getJobClass(java.lang.String className)
                     throws SLAMDException
Retrieves the job class with the specified name.

Parameters:
className - The fully-qualified name of the Java class to retrieve.
Returns:
The requested job class.
Throws:
SLAMDException - If a problem occurs while trying to load the requested class.

getJobClassBytes

public byte[] getJobClassBytes(java.lang.String className)
                        throws SLAMDException
Retrieves the binary representation of the specified job class.

Parameters:
className - The fully-qualified name of the Java class to retrieve.
Returns:
The bytes contained in the job class file.
Throws:
SLAMDException - If a problem occurs while trying to load the requested class.