JPF 1.5.1

org.java.plugin.standard
Class StandardPluginLifecycleHandler

java.lang.Object
  extended by org.java.plugin.standard.PluginLifecycleHandler
      extended by org.java.plugin.standard.StandardPluginLifecycleHandler

public class StandardPluginLifecycleHandler
extends PluginLifecycleHandler

Standard implementation of plug-in life cycle handler.

Configuration parameters

This life cycle handler implementation supports following configuration parameters:

probeParentLoaderLast
If true, plug-in classloader will try loading classes from system (boot) classpath after trying to load them from plug-in classpath. Otherwise system classpath will be used first. Default value is false that corresponds to standard delegation model for classloaders hierarchy that corresponds to JLS.
stickySynchronizing
Allows advanced configuring of classloaders synchronization in multy-threaded environment. If true then class loading will be synchronized with initial plug-in classloader instance. Otherwise this instance will be used as synchronizing monitor. Default value is false.
localClassLoadingOptimization
If true then plug-in classloader will collect local packages statistics to predict class location. This allow to optimize class look-up procedure for classes that belong to the requested plug-in. Default value is true.
foreignClassLoadingOptimization
If true then plug-in classloader will collect statistics for "foreign" classes - those which belong to depending plug-ins. This allow to optimize class look-up procedure when enumerating depending plug-ins. Default value is true.

Version:
$Id: StandardPluginLifecycleHandler.java,v 1.5 2007/04/07 12:39:50 ddimon Exp $

Constructor Summary
StandardPluginLifecycleHandler()
           
 
Method Summary
protected  void afterPluginStop(Plugin plugin)
          This method does nothing in this implementation.
protected  void beforePluginStart(Plugin plugin)
          This method does nothing in this implementation.
 void configure(ExtendedProperties config)
          Configures this handler instance.
protected  PluginClassLoader createPluginClassLoader(PluginDescriptor descr)
          Creates standard implementation of plug-in class loader.
protected  Plugin createPluginInstance(PluginDescriptor descr)
          Creates instance of plug-in class calling it's default (no-arguments) constructor.
protected  void dispose()
          This method does nothing in this implementation.
 
Methods inherited from class org.java.plugin.standard.PluginLifecycleHandler
getPluginManager, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardPluginLifecycleHandler

public StandardPluginLifecycleHandler()
Method Detail

createPluginClassLoader

protected PluginClassLoader createPluginClassLoader(PluginDescriptor descr)
Creates standard implementation of plug-in class loader.

Specified by:
createPluginClassLoader in class PluginLifecycleHandler
Parameters:
descr - plug-in descriptor
Returns:
class loader instance for given plug-in
See Also:
PluginLifecycleHandler.createPluginClassLoader( org.java.plugin.registry.PluginDescriptor)

createPluginInstance

protected Plugin createPluginInstance(PluginDescriptor descr)
                               throws PluginLifecycleException
Creates instance of plug-in class calling it's default (no-arguments) constructor. Class look-up is done with plug-in's class loader.

Specified by:
createPluginInstance in class PluginLifecycleHandler
Parameters:
descr - plug-in descriptor
Returns:
new not initialized instance of plug-in class
Throws:
PluginLifecycleException - if plug-in class can't be instantiated for some reason
See Also:
PluginLifecycleHandler.createPluginInstance( org.java.plugin.registry.PluginDescriptor)

beforePluginStart

protected void beforePluginStart(Plugin plugin)
This method does nothing in this implementation.

Specified by:
beforePluginStart in class PluginLifecycleHandler
Parameters:
plugin - plug-in being starting
See Also:
PluginLifecycleHandler.beforePluginStart( org.java.plugin.Plugin)

afterPluginStop

protected void afterPluginStop(Plugin plugin)
This method does nothing in this implementation.

Specified by:
afterPluginStop in class PluginLifecycleHandler
Parameters:
plugin - plug-in being stopping
See Also:
PluginLifecycleHandler.afterPluginStop( org.java.plugin.Plugin)

dispose

protected void dispose()
This method does nothing in this implementation.

Specified by:
dispose in class PluginLifecycleHandler
See Also:
PluginLifecycleHandler.dispose()

configure

public void configure(ExtendedProperties config)
Description copied from class: PluginLifecycleHandler
Configures this handler instance. Note that this method should be called once before PluginLifecycleHandler.init(PluginManager), usually this is done in object factory implementation.

Specified by:
configure in class PluginLifecycleHandler
Parameters:
config - handler configuration data
See Also:
PluginLifecycleHandler.configure( ExtendedProperties)

JPF 1.5.1

Copyright © 2004-2007 Dmitry Olshansky. All Rights Reserved.