TEMERITY

us.temerity.pipeline
Class BasePlugin

java.lang.Object
  extended by us.temerity.pipeline.Named
      extended by us.temerity.pipeline.PluginID
          extended by us.temerity.pipeline.BasePlugin
All Implemented Interfaces:
Serializable, Cloneable, Comparable<PluginID>, Glueable
Direct Known Subclasses:
BaseAction, BaseAnnotation, BaseArchiver, BaseBuilderCollection, BaseComparator, BaseEditor, BaseExt, BaseKeyChooser, BaseTool

public class BasePlugin
extends PluginID

The superclass of all Pipeline plugins.

By default only the Unix operating system is supported by a subclass plugin. The addSupport method should be called in the subclass constructor to add support for other operation systems. Unix support can also be removed using the removeSupport method.

See Also:
Serialized Form

Field Summary
protected  String pDescription
          A short message which describes the plugin.
 
Fields inherited from class us.temerity.pipeline.PluginID
pVendor, pVersionID
 
Fields inherited from class us.temerity.pipeline.Named
pName
 
Constructor Summary
protected BasePlugin()
          This constructor is required by the GlueDecoder to instantiate the class when encountered during the reading of GLUE format files and should not be called from user code.
protected BasePlugin(PluginID pluginID, String desc)
          Construct with the given plugin ID and description.
protected BasePlugin(String name, VersionID vid, String vendor, String desc)
          Construct with the given name, version, vendor and description.
 
Method Summary
protected  void addSupport(OsType os)
          Add support for execution under the given operating system type.
 int compareTo(PluginID pluginID)
          Compares this PluginID with the given PluginID for order.
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 String getDescription()
          Gets the description text.
protected  String getFullMessage(Throwable ex)
          Deprecated. The static method Exceptions.getFullMessage(java.lang.String, java.lang.Throwable, boolean, boolean) should be used instead.
 PluginID getPluginID()
          Get the unique plugin identifier.
 PluginType getPluginType()
          Get which general type of plugin this is.
 URL getResource(String name)
          A convenience method to find a resource with a given name.
 SortedMap<String,Long> getResources()
          Retrieves all the resources available to the plugin.
 long getResourceSize(String name)
          Retrieves the file size for a valid resource.
 SortedSet<OsType> getSupports()
          Get the supported operating system types.
 boolean isUnderDevelopment()
          Whether this version of the plugin in currently being modified and tested by the plugin developer.
protected  void removeSupport(OsType os)
          Remove support for execution under the given operating system type.
protected  void setSupports(SortedSet<OsType> oss)
          Set the specific operating systems that are supported.
 boolean supports(OsType os)
          Whether the plugin supports execution under the given operating system type.
 String toString()
          Generate a string representation of this plugin.
protected  void underDevelopment()
          Mark this version of the plugin as currently being modified and tested by the plugin developer.
 
Methods inherited from class us.temerity.pipeline.PluginID
fromGlue, getVendor, getVersionID, toGlue
 
Methods inherited from class us.temerity.pipeline.Named
clone, getName
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pDescription

protected String pDescription
A short message which describes the plugin.

Constructor Detail

BasePlugin

protected BasePlugin()
This constructor is required by the GlueDecoder to instantiate the class when encountered during the reading of GLUE format files and should not be called from user code.


BasePlugin

protected BasePlugin(String name,
                     VersionID vid,
                     String vendor,
                     String desc)
Construct with the given name, version, vendor and description.

Parameters:
name - The short name of the plugin
vid - The plugin revision number.
vendor - The name of the plugin vendor.
desc - A short description of the plugin.

BasePlugin

protected BasePlugin(PluginID pluginID,
                     String desc)
Construct with the given plugin ID and description.

Parameters:
pluginID - The unique ID of the plugin.
desc - A short description of the plugin.
Method Detail

getDescription

public String getDescription()
Gets the description text.


supports

public final boolean supports(OsType os)
Whether the plugin supports execution under the given operating system type.

Parameters:
os - The operating system type.

getSupports

public SortedSet<OsType> getSupports()
Get the supported operating system types.


addSupport

protected void addSupport(OsType os)
Add support for execution under the given operating system type.

Parameters:
os - The operating system type.

removeSupport

protected void removeSupport(OsType os)
Remove support for execution under the given operating system type.

Parameters:
os - The operating system type.

setSupports

protected void setSupports(SortedSet<OsType> oss)
Set the specific operating systems that are supported.


underDevelopment

protected final void underDevelopment()
Mark this version of the plugin as currently being modified and tested by the plugin developer.

Plugins with this flag set can be dynamically reloaded by the plpluginmgr(1) daemon and distributed to all running Pipeline programs. Subclasses should call this method in their constructor during the creation and testing phase of developement.


isUnderDevelopment

public final boolean isUnderDevelopment()
Whether this version of the plugin in currently being modified and tested by the plugin developer.

Plugins with this flag set can be dynamically reloaded by the plpluginmgr(1) daemon and distributed to all running Pipeline programs.


getPluginType

public PluginType getPluginType()
Get which general type of plugin this is.


getPluginID

public PluginID getPluginID()
Get the unique plugin identifier.


getResource

public URL getResource(String name)
A convenience method to find a resource with a given name.

Parameters:
name - The name of the resource.

getResourceSize

public long getResourceSize(String name)
Retrieves the file size for a valid resource.


getResources

public SortedMap<String,Long> getResources()
Retrieves all the resources available to the plugin.


equals

public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class PluginID
Parameters:
obj - The reference object with which to compare.

toString

public String toString()
Generate a string representation of this plugin.

Overrides:
toString in class PluginID

compareTo

public int compareTo(PluginID pluginID)
Compares this PluginID with the given PluginID for order.

Specified by:
compareTo in interface Comparable<PluginID>
Overrides:
compareTo in class PluginID
Parameters:
pluginID - The PluginID to be compared.

getFullMessage

@Deprecated
protected String getFullMessage(Throwable ex)
Deprecated. The static method Exceptions.getFullMessage(java.lang.String, java.lang.Throwable, boolean, boolean) should be used instead.

Generate a string containing both the exception message and stack trace.

Parameters:
ex - The thrown exception.

TEMERITY