org.kuali.rice.kew.plugin
Class ZipFilePluginLoader

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

public class ZipFilePluginLoader
extends BasePluginLoader

Loads a plugin from a zip file on the file system.

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

Field Summary
 
Fields inherited from class org.kuali.rice.kew.plugin.BasePluginLoader
logPrefix, parentClassLoader, parentConfig, pluginConfigPath, sharedPluginDirectory, simplePluginName
 
Constructor Summary
ZipFilePluginLoader(File pluginZipFile, File sharedPluginDirectory, ClassLoader parentClassLoader, Config parentConfig)
           
 
Method Summary
protected  PluginClassLoader createPluginClassLoader()
          Template method that subclasses should implement to supply an appropriate plugin ClassLoader
protected  File determineExtractionDirectory(String pluginName, File pluginZipFile)
           
protected  void extractPluginFiles()
          Extracts the plugin files if necessary.
protected  URL getPluginConfigURL()
          Template method that subclasses should implement to supply an appropriate URL to the plugin's configuration
protected  boolean isExtractNeeded()
          An extract is required if the plugin has been modified or the last modified date of the zip file is later than the last modified date of the extraction directory.
 boolean isLoadFailed()
           
 boolean isModified()
           
 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).
protected  boolean isZipFileStillBeingModified()
           
 Plugin load()
          Loads and creates the Plugin.
protected  void updateLastModified()
           
 
Methods inherited from class org.kuali.rice.kew.plugin.BasePluginLoader
configureExtraClasspath, getLogPrefix, getPluginName, getPluginName, getSimplePluginName, installPluginListeners, installResourceLoader, loadPluginConfig, loadWithinContextClassLoader, setPluginConfigPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipFilePluginLoader

public ZipFilePluginLoader(File pluginZipFile,
                           File sharedPluginDirectory,
                           ClassLoader parentClassLoader,
                           Config parentConfig)
Method Detail

isModified

public boolean isModified()

isZipFileStillBeingModified

protected boolean isZipFileStillBeingModified()

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
Overrides:
isRemoved in class BasePluginLoader

load

public Plugin load()
            throws Exception
Description copied from class: BasePluginLoader
Loads and creates the Plugin.

Specified by:
load in interface PluginLoader
Overrides:
load in class BasePluginLoader
Throws:
Exception

determineExtractionDirectory

protected File determineExtractionDirectory(String pluginName,
                                            File pluginZipFile)

extractPluginFiles

protected void extractPluginFiles()
                           throws Exception
Extracts the plugin files if necessary.

Throws:
Exception

isLoadFailed

public boolean isLoadFailed()
Returns:
the loadFailed

isExtractNeeded

protected boolean isExtractNeeded()
An extract is required if the plugin has been modified or the last modified date of the zip file is later than the last modified date of the extraction directory.


updateLastModified

protected void updateLastModified()

createPluginClassLoader

protected PluginClassLoader createPluginClassLoader()
                                             throws MalformedURLException
Description copied from class: BasePluginLoader
Template method that subclasses should implement to supply an appropriate plugin ClassLoader

Specified by:
createPluginClassLoader in class BasePluginLoader
Returns:
an appropriate PluginClassLoader
Throws:
MalformedURLException

getPluginConfigURL

protected URL getPluginConfigURL()
                          throws PluginException,
                                 MalformedURLException
Description copied from class: BasePluginLoader
Template method that subclasses should implement to supply an appropriate URL to the plugin's configuration

Specified by:
getPluginConfigURL in class BasePluginLoader
Returns:
an appropriate URL to the plugin's configuration
Throws:
PluginException
MalformedURLException


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