org.jbpm.util
Class ClassLoaderUtil

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

public class ClassLoaderUtil
extends Object

centralized class loader access.


Method Summary
static Class classForName(String className)
           
static Class classForName(String className, boolean useConfiguredLoader)
           
static ClassLoader getClassLoader()
          Returns the ClassLoader employed by jBPM to load classes referenced in the configuration.
static Properties getProperties(String resource)
           
static InputStream getStream(String resource)
           
static InputStream getStream(String resource, boolean useConfiguredLoader)
          Returns a stream for reading the specified resource.
static Class loadClass(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 Class loadClass(String className)
Deprecated. Use classForName(String) instead

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

See Also:
JBPM-1976

classForName

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

classForName

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

getClassLoader

public static 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 InputStream getStream(String resource)

getStream

public static InputStream getStream(String resource,
                                    boolean useConfiguredLoader)
Returns a stream for reading the specified resource. This method helps bootstrap jBPM because the class loader used for locating the configuration resource cannot be configured in the configuration itself.

Parameters:
useConfiguredLoader - if true, this method searches for the resource in the context class loader, if not found it falls back on the loader of this class
Returns:
a stream for reading the resource, or null if the resource was not found

getProperties

public static Properties getProperties(String resource)


Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.