org.ops4j.pax.radman.service.job.scheduler.internal
Class OSGiClassLoadHelper

java.lang.Object
  extended by org.ops4j.pax.radman.service.job.scheduler.internal.OSGiClassLoadHelper
All Implemented Interfaces:
org.quartz.spi.ClassLoadHelper

public final class OSGiClassLoadHelper
extends java.lang.Object
implements org.quartz.spi.ClassLoadHelper

OSGiClassLoadHelper is instantiated by StdSchedulerFactory. Hence, this class requires to have default constructor.

The properties for StdSchedulerFactory.PROP_SCHED_CLASS_LOAD_HELPER_CLASS must be set with this OSGiClassLoadHelper.

Since:
0.1.0
Author:
Edward Yakop

Constructor Summary
OSGiClassLoadHelper()
           
 
Method Summary
 java.net.URL getResource(java.lang.String name)
          Finds a resource with a given name.
 java.io.InputStream getResourceAsStream(java.lang.String name)
          Finds a resource with a given name.
 void initialize()
          Called to give the ClassLoadHelper a chance to initialize itself, including the oportunity to "steal" the class loader off of the calling thread, which is the thread that is initializing Quartz.
 java.lang.Class loadClass(java.lang.String name)
          Return the class with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSGiClassLoadHelper

public OSGiClassLoadHelper()
Method Detail

initialize

public final void initialize()
                      throws java.lang.IllegalStateException
Called to give the ClassLoadHelper a chance to initialize itself, including the oportunity to "steal" the class loader off of the calling thread, which is the thread that is initializing Quartz.

Specified by:
initialize in interface org.quartz.spi.ClassLoadHelper
Throws:
java.lang.IllegalStateException - Thrown if the bundle of this OSGiClassLoadHelper is not started.
Since:
0.1.0

loadClass

public java.lang.Class loadClass(java.lang.String name)
                          throws java.lang.ClassNotFoundException
Return the class with the given name.

Specified by:
loadClass in interface org.quartz.spi.ClassLoadHelper
Throws:
java.lang.ClassNotFoundException

getResource

public java.net.URL getResource(java.lang.String name)
Finds a resource with a given name. This method returns null if no resource with this name is found.

Specified by:
getResource in interface org.quartz.spi.ClassLoadHelper
Parameters:
name - name of the desired resource
Returns:
a java.net.URL object

getResourceAsStream

public java.io.InputStream getResourceAsStream(java.lang.String name)
Finds a resource with a given name. This method returns null if no resource with this name is found.

Specified by:
getResourceAsStream in interface org.quartz.spi.ClassLoadHelper
Parameters:
name - name of the desired resource
Returns:
a java.io.InputStream object


Copyright © 2008. All Rights Reserved.