unbbayes.io.extension.jpf
Class PluginAwareFileExtensionIODelegator

java.lang.Object
  extended by unbbayes.io.FileExtensionIODelegator
      extended by unbbayes.io.extension.jpf.PluginAwareFileExtensionIODelegator
All Implemented Interfaces:
BaseIO

public class PluginAwareFileExtensionIODelegator
extends FileExtensionIODelegator

This is an extension of FileExtensionIODelegator which uses JPF in order to load IO classes as plugins.

Author:
Shou Matsumoto

Nested Class Summary
 
Nested classes/interfaces inherited from class unbbayes.io.FileExtensionIODelegator
FileExtensionIODelegator.MoreThanOneCompatibleIOException
 
Constructor Summary
PluginAwareFileExtensionIODelegator()
          Deprecated. use newInstance() instead
 
Method Summary
 String getCorePluginID()
          This is the ID from where this class will going to find the declared extension points.
 String getExtensionPointClassParam()
          The default name of the "class" parameter of PNIO extension point
 String getExtensionPointID()
          The default value of the extension point ID expected by the plugin manager in order to find plugins for PN's IO routines.
 String getExtensionPointNameParam()
           
 UnBBayesPluginContextHolder getUnbbayesPluginContextHolder()
           
protected  Collection<BaseIO> loadIOAsPlugins()
          Obtains IO classes using plugins loaded from plugin folder, using getExtensionPointID() as extension point ID (which is usually "PNIO").
static PluginAwareFileExtensionIODelegator newInstance()
          Constructor method.
static PluginAwareFileExtensionIODelegator newInstance(boolean loadPlugins)
          Constructor method.
 void reloadPlugins()
          Reloads the plugins.
 void setCorePluginID(String corePluginID)
          This is the ID from where this class will going to find the declared extension points.
 void setExtensionPointClassParam(String extensionPointClassParam)
          The default name of the "class" parameter of PNIO extension point
 void setExtensionPointID(String extensionPointID)
          The default value of the extension point ID expected by the plugin manager in order to find plugins for PN's IO routines.
 void setExtensionPointNameParam(String extensionPointNameParam)
           
 void setUnbbayesPluginContextHolder(UnBBayesPluginContextHolder unbbayesPluginContextHolder)
           
 
Methods inherited from class unbbayes.io.FileExtensionIODelegator
findIOByName, getCompatibleIOs, getDelegators, getName, getNamesFromIOs, getSupportedFileExtensions, getSupportedFilesDescription, load, save, setDelegators, setName, supports
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginAwareFileExtensionIODelegator

public PluginAwareFileExtensionIODelegator()
Deprecated. use newInstance() instead

Default constructor is public for plugin support. If you want to use this directly as ordinal java class, use newInstance() instead. Initializes the FileExtensionIODelegator.getDelegators() using the following IO classes: - NetIO; - XMLBIFIO; - DneIO; - contents from #loadIOAsPlugins(getExtensionPointID());

Method Detail

newInstance

public static PluginAwareFileExtensionIODelegator newInstance()
Constructor method. Initializes the FileExtensionIODelegator.getDelegators() using the following IO classes: - contents from #loadIOAsPlugins(getExtensionPointID());

Returns:
a new instance of PluginAwareFileExtensionIODelegator.

newInstance

public static PluginAwareFileExtensionIODelegator newInstance(boolean loadPlugins)
Constructor method.

Parameters:
if - true, it loads plugins. If false, it does not load plugins.
Returns:
a new instance of PluginAwareFileExtensionIODelegator.

reloadPlugins

public void reloadPlugins()
Reloads the plugins.


loadIOAsPlugins

protected Collection<BaseIO> loadIOAsPlugins()
Obtains IO classes using plugins loaded from plugin folder, using getExtensionPointID() as extension point ID (which is usually "PNIO"). (see plugin.xml with ID unbbayes.util.extension.core) for declaration. The plugins are loaded using UnBBayesPluginContextHolder.getPluginManager()

Returns:
a collection of BaseIO instances loaded as plugins.

getExtensionPointID

public String getExtensionPointID()
The default value of the extension point ID expected by the plugin manager in order to find plugins for PN's IO routines.

Returns:
the extensionPointID

setExtensionPointID

public void setExtensionPointID(String extensionPointID)
The default value of the extension point ID expected by the plugin manager in order to find plugins for PN's IO routines.

Parameters:
extensionPointID - the extensionPointID to set

getExtensionPointClassParam

public String getExtensionPointClassParam()
The default name of the "class" parameter of PNIO extension point

Returns:
the extensionPointClassParam

setExtensionPointClassParam

public void setExtensionPointClassParam(String extensionPointClassParam)
The default name of the "class" parameter of PNIO extension point

Parameters:
extensionPointClassParam - the extensionPointClassParam to set

getUnbbayesPluginContextHolder

public UnBBayesPluginContextHolder getUnbbayesPluginContextHolder()
Returns:
the unbbayesPluginContextHolder

setUnbbayesPluginContextHolder

public void setUnbbayesPluginContextHolder(UnBBayesPluginContextHolder unbbayesPluginContextHolder)
Parameters:
unbbayesPluginContextHolder - the unbbayesPluginContextHolder to set

getExtensionPointNameParam

public String getExtensionPointNameParam()
Returns:
the extensionPointNameParam

setExtensionPointNameParam

public void setExtensionPointNameParam(String extensionPointNameParam)
Parameters:
extensionPointNameParam - the extensionPointNameParam to set

getCorePluginID

public String getCorePluginID()
This is the ID from where this class will going to find the declared extension points.

Returns:
the corePluginID

setCorePluginID

public void setCorePluginID(String corePluginID)
This is the ID from where this class will going to find the declared extension points.

Parameters:
corePluginID - the corePluginID to set


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.