org.kuali.rice.kew.plugin
Class BasePluginLoader

java.lang.Object
  extended by org.kuali.rice.kew.plugin.BasePluginLoader
All Implemented Interfaces:
Modifiable, PluginLoader
Direct Known Subclasses:
ZipFilePluginLoader

public abstract class BasePluginLoader
extends Object
implements PluginLoader

Abstract base PluginLoader implementation. Delegates to template methods to obtain plugin ClassLoader and plugin config file URL, then load the config under the plugin ClassLoader, and constructs a Plugin object.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
protected  String logPrefix
           
protected  ClassLoader parentClassLoader
           
protected  Config parentConfig
           
protected  String pluginConfigPath
           
protected  File sharedPluginDirectory
           
protected  String simplePluginName
           
 
Constructor Summary
BasePluginLoader(String simplePluginName, File sharedPluginDirectory, ClassLoader parentClassLoader, Config parentConfig)
           
 
Method Summary
protected  void configureExtraClasspath(PluginClassLoader classLoader, PluginConfig config)
           
protected abstract  PluginClassLoader createPluginClassLoader()
          Template method that subclasses should implement to supply an appropriate plugin ClassLoader
protected  String getLogPrefix()
           
protected abstract  URL getPluginConfigURL()
          Template method that subclasses should implement to supply an appropriate URL to the plugin's configuration
 String getPluginName()
           
protected  QName getPluginName(PluginConfig pluginConfig)
           
protected  String getSimplePluginName()
           
protected  void installPluginListeners(Plugin plugin)
           
protected  void installResourceLoader(Plugin plugin)
           
 boolean isRemoved()
          Returns true if the Plugin loaded by this loader has been removed (for example, it was deleted from the file system which should result in the plugin being undeployed).
 Plugin load()
          Loads and creates the Plugin.
protected  PluginConfig loadPluginConfig(URL url)
           
protected  Plugin loadWithinContextClassLoader(PluginClassLoader classLoader)
          Executes loading of the plugin within the current context classloader set to the Plugin's classloader.
 void setPluginConfigPath(String pluginConfigPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.kew.plugin.Modifiable
isModified
 

Field Detail

simplePluginName

protected final String simplePluginName

logPrefix

protected String logPrefix

parentClassLoader

protected final ClassLoader parentClassLoader

parentConfig

protected final Config parentConfig

sharedPluginDirectory

protected final File sharedPluginDirectory

pluginConfigPath

protected String pluginConfigPath
Constructor Detail

BasePluginLoader

public BasePluginLoader(String simplePluginName,
                        File sharedPluginDirectory,
                        ClassLoader parentClassLoader,
                        Config parentConfig)
Method Detail

getLogPrefix

protected String getLogPrefix()

getPluginName

public String getPluginName()
Specified by:
getPluginName in interface PluginLoader

setPluginConfigPath

public void setPluginConfigPath(String pluginConfigPath)
Specified by:
setPluginConfigPath in interface PluginLoader

getSimplePluginName

protected String getSimplePluginName()

createPluginClassLoader

protected abstract PluginClassLoader createPluginClassLoader()
                                                      throws IOException
Template method that subclasses should implement to supply an appropriate plugin ClassLoader

Returns:
an appropriate PluginClassLoader
Throws:
IOException - if anything goes awry

getPluginConfigURL

protected abstract URL getPluginConfigURL()
                                   throws PluginException,
                                          IOException
Template method that subclasses should implement to supply an appropriate URL to the plugin's configuration

Returns:
an appropriate URL to the plugin's configuration
Throws:
IOException - if anything goes awry
PluginException

load

public Plugin load()
            throws Exception
Loads and creates the Plugin.

Specified by:
load in interface PluginLoader
Throws:
Exception

isRemoved

public boolean isRemoved()
Description copied from interface: PluginLoader
Returns true if the Plugin loaded by this loader has been removed (for example, it was deleted from the file system which should result in the plugin being undeployed).

Specified by:
isRemoved in interface PluginLoader

loadWithinContextClassLoader

protected Plugin loadWithinContextClassLoader(PluginClassLoader classLoader)
                                       throws PluginException,
                                              IOException
Executes loading of the plugin within the current context classloader set to the Plugin's classloader.

Throws:
PluginException
IOException

installResourceLoader

protected void installResourceLoader(Plugin plugin)

installPluginListeners

protected void installPluginListeners(Plugin plugin)

configureExtraClasspath

protected void configureExtraClasspath(PluginClassLoader classLoader,
                                       PluginConfig config)
                                throws MalformedURLException
Throws:
MalformedURLException

getPluginName

protected QName getPluginName(PluginConfig pluginConfig)

loadPluginConfig

protected PluginConfig loadPluginConfig(URL url)


Copyright © 2005-2011 The Kuali Foundation. All Rights Reserved.