com.vividsolutions.jump.workbench.plugin
Class PlugInManager

java.lang.Object
  extended by com.vividsolutions.jump.workbench.plugin.PlugInManager

public class PlugInManager
extends java.lang.Object

Manages plug-ins for BizzJUMP. The main task of this class is to load the plug-ins from the file system and initialize them during the program start-up process. It also executes plug-ins immediately after program start-up and immediately before program shutdown, if the plug-in desires.


Constructor Summary
PlugInManager(WorkbenchContext context, java.io.File plugInDirectory, TaskMonitor monitor)
          Constructs a new PlugInManager.
 
Method Summary
 void executeRegisteredPlugInsAsPartOfProgramShutDown()
          Allows plug-ins registered with this class to clean-up after themselves as part of the program shutdown process.
 java.lang.ClassLoader getClassLoader()
          To access extension classes, use this ClassLoader rather than the default ClassLoader.
 java.util.Collection getConfigurations()
          Creates a list of Configuration objects from the provided list of classes.
 java.util.List<EnhancedPlugIn> getRegisteredPlugIns()
          Returns a list of EnhancedPlugIn implementations that are available to other plug-ins during program execution.
 void load()
          Loads plug-ins by completing the following steps: (1) Finds their class file, (2) loads their class file, (3) creates an instance of the loaded class, and (4)class that instance's initialize method.
 java.lang.String name(Configuration argConfiguration)
          Creates a name for the Configuration provided as an argument.
 java.lang.String version(Configuration argConfiguration)
          Returns the version of the Configuration provided as an argument.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlugInManager

public PlugInManager(WorkbenchContext context,
                     java.io.File plugInDirectory,
                     TaskMonitor monitor)
              throws java.lang.InstantiationException,
                     java.lang.IllegalAccessException,
                     java.lang.ClassNotFoundException,
                     java.io.IOException
Constructs a new PlugInManager. If the plugInDirectory argument is null, only plug-ins and extensions listed in the WorkbenchProperties object are loaded.

Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.io.IOException
Method Detail

load

public void load()
          throws java.lang.Exception
Loads plug-ins by completing the following steps: (1) Finds their class file, (2) loads their class file, (3) creates an instance of the loaded class, and (4)class that instance's initialize method. Plug-ins are loaded from three locations: (1) Plug-ins configured and initialized by Extension implementations stored in JAR files in the plug-in directory. (2) Plug-ins configured and initialized by Extension implementations identified in the WorkbenchProperties class. (3) Plug-ins identified in the WorkbenchProperties class. These are typically plug-ins included as part of the core. They aren't packaged in a plug-in JAR or a JAR with an Extension, so they have to be loaded directly.identified in the WorkbenchProperties and any plug-ins found.

Throws:
java.lang.Exception

name

public java.lang.String name(Configuration argConfiguration)
Creates a name for the Configuration provided as an argument. If the argument is an implementation of the Extension interface, then the value provided by the getName method of the Extension class is returned. If the argument is not an implementation of the Extension interface, the name is created from the automatically from the class name.


version

public java.lang.String version(Configuration argConfiguration)
Returns the version of the Configuration provided as an argument. If the Configuration is an implementation of the Extension interface, then the results of the Extension's getVersion method is returned. Otherwise this method returns and empty string.


getConfigurations

public java.util.Collection getConfigurations()
Creates a list of Configuration objects from the provided list of classes.

Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException

getRegisteredPlugIns

public java.util.List<EnhancedPlugIn> getRegisteredPlugIns()
Returns a list of EnhancedPlugIn implementations that are available to other plug-ins during program execution.


executeRegisteredPlugInsAsPartOfProgramShutDown

public void executeRegisteredPlugInsAsPartOfProgramShutDown()
Allows plug-ins registered with this class to clean-up after themselves as part of the program shutdown process. This method is called by the BasicApplicationExitHandler class, and should not be called by other classes.


getClassLoader

public java.lang.ClassLoader getClassLoader()
To access extension classes, use this ClassLoader rather than the default ClassLoader. Extension classes will not be present in the latter.