org.jbpm.util
Class ClassLoaderUtil

java.lang.Object
  extended by org.jbpm.util.ClassLoaderUtil

public class ClassLoaderUtil
extends java.lang.Object

provides centralized classloader lookup.


Method Summary
static java.lang.Class classForName(java.lang.String className)
           
static java.lang.Class classForName(java.lang.String className, boolean useConfiguredLoader)
           
static java.lang.ClassLoader getClassLoader()
          Returns the ClassLoader employed by jBPM to load classes referenced in the configuration.
static java.util.Properties getProperties(java.lang.String resource)
           
static java.io.InputStream getStream(java.lang.String resource)
           
static java.io.InputStream getStream(java.lang.String resource, boolean useConfiguredLoader)
          Loads resource as stream.
static java.lang.Class loadClass(java.lang.String className)
          Deprecated. Use classForName(String) instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadClass

public static java.lang.Class loadClass(java.lang.String className)
Deprecated. Use classForName(String) instead

Bad usage of ClassLoader.loadClass() under JDK 6.

See Also:
JBPM-1976

classForName

public static java.lang.Class classForName(java.lang.String className)
                                    throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

classForName

public static java.lang.Class classForName(java.lang.String className,
                                           boolean useConfiguredLoader)
                                    throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getClassLoader

public static java.lang.ClassLoader getClassLoader()
Returns the ClassLoader employed by jBPM to load classes referenced in the configuration. The class loader can be changed in jbpm.cfg.xml by setting the string property jbpm.class.loader. The possible values are:


getStream

public static java.io.InputStream getStream(java.lang.String resource)

getStream

public static java.io.InputStream getStream(java.lang.String resource,
                                            boolean useConfiguredLoader)
Loads resource as stream. If useConfiguredLoader is true, this method searches for the resource in the context class loader, if not found it searches in the class loader of this class.

This method helps bootstrap jBPM because the class loader used for locating the configuration resource cannot be configured in the configuration itself.

Returns:
a stream for reading the resource, or null if the resource was not found

getProperties

public static java.util.Properties getProperties(java.lang.String resource)


Copyright © 2010 JBoss Community. All Rights Reserved.