org.yawlfoundation.yawl.resourcing.util
Class PluginLoader

java.lang.Object
  extended by org.yawlfoundation.yawl.resourcing.util.PluginLoader

public class PluginLoader
extends Object

Loads and instantiates classes that use the pluggable interface.

Author:
Michael Adams
Created/Last Date:
7/09/2010

Constructor Summary
PluginLoader()
           
 
Method Summary
static
<T> T
loadInstance(Class<T> c, String localPkg, String className)
          Instantiates a single pluggable class.
static
<T> T
loadInstance(Class<T> c, String localPkg, String className, boolean external)
          Instantiates a single pluggable class.
static
<T> Set<T>
loadInstances(Class<T> c, String pkg, String[] excludes)
          Instantiates all the classes matching the parameters passed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginLoader

public PluginLoader()
Method Detail

loadInstance

public static <T> T loadInstance(Class<T> c,
                                 String localPkg,
                                 String className,
                                 boolean external)
                      throws PluginLoaderException
Instantiates a single pluggable class.

Parameters:
c - the type of class to instantiate
localPkg - the class's package (may be null if class is located externally to the resource service)
className - the canonical name of the required class (no extension)
external - true if the clas is stored in an external directory
Returns:
the instantiated class, or null if there was a problem
Throws:
PluginLoaderException - a wrapper for the various exceptions that may occur

loadInstance

public static <T> T loadInstance(Class<T> c,
                                 String localPkg,
                                 String className)
                      throws PluginLoaderException
Instantiates a single pluggable class.

Parameters:
c - the type of class to instantiate
localPkg - the class's package (may be null if class is located externally to the resource service)
className - the canonical name of the required class (no extension)
Returns:
the instantiated class, or null if there was a problem
Throws:
PluginLoaderException - a wrapper for the various exceptions that may occur

loadInstances

public static <T> Set<T> loadInstances(Class<T> c,
                                       String pkg,
                                       String[] excludes)
Instantiates all the classes matching the parameters passed.

Parameters:
c - the type of class to instantiate
pkg - the classes package (may be null if class is located externally to the resource service)
excludes - an array of the class names to not instantiate from those found
Returns:
a Set of instantiated classes, or null if there was a problem


Copyright © 2004-2012 The YAWL Foundation.