Openwings API Documentation (v1.1)

net.openwings.identity
Class ComponentDescriptor

java.lang.Object
  extended bynet.openwings.identity.ComponentDescriptor
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
InstallableComponentDescriptor

public class ComponentDescriptor
extends java.lang.Object
implements java.io.Serializable

This class contains all of the information that would be used to identify and execute a component. This information is used by several Openwings services:

See Also:
Container, Component, Installer, Serialized Form

Constructor Summary
ComponentDescriptor()
          Default constructor
ComponentDescriptor(ComponentDescriptor componentDescriptor)
          This is a shallow copy contructor.
ComponentDescriptor(UniqueID uniqueID, java.lang.String componentName, java.lang.String version, java.lang.String description, boolean executable, java.lang.String executableString, java.lang.String platform, boolean sharedContainerHint, boolean restartHint, boolean bootProcessHint, boolean runImmediatelyHint, boolean mobile, java.net.URL[] classpath, java.net.URL[] codebase, java.util.Properties properties, java.lang.String commandLineParameters)
          This constructor is used to create an executable Java ComponentDescriptor.
ComponentDescriptor(UniqueID uniqueID, java.lang.String componentName, java.lang.String version, java.lang.String description, boolean executable, java.lang.String executableString, java.lang.String platform, boolean sharedContainerHint, boolean restartHint, boolean bootProcessHint, java.lang.String commandLineParameters)
          This constructor is used to create a non-Java executable component descriptor.
ComponentDescriptor(UniqueID uniqueID, java.lang.String componentName, java.lang.String version, java.lang.String description, java.lang.String platform, java.net.URL[] classpath, java.net.URL[] codebase)
          This constructor is used to create a non-executable Java component descriptor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          This method overrides the default equals() implementation.
 boolean equalsStrict(ComponentDescriptor descriptor)
          This method provides a strict comparison with another ComponentDescriptor.
 boolean getBootProcessHint()
          This method returns true if the component should be started on platform boot.
 java.net.URL[] getClasspath()
          This method returns the classpath of the component.
 java.net.URL[] getCodebase()
          This method returns the codebase of the component.
 java.lang.String getCommandLineParameters()
          This method returns the command line parameters that should be passed to the component on startup.
 java.lang.String getComponentName()
          This method returns the name of this component.
 java.lang.String getDescription()
          This method returns a description of the component.
 boolean getExecutable()
          This method returns true if the component is executable.
 java.lang.String getExecutableString()
          This method returns the command used to execute the component.
 boolean getMobile()
          This method returns true if the component can move between containers or platforms.
 java.lang.String getPlatform()
          This method returns the platform on which this component can run.
 java.util.Properties getProperties()
          This method returns the properties used by the component.
 boolean getRestartHint()
          This method returns true if the component should be restarted in case of failure.
 boolean getRunImmediatelyHint()
          This method returns true if the component should be started immediately.
 boolean getSharedContainerHint()
          This method returns true if the component can share a container with other components.
 UniqueID getUniqueID()
          This method returns the unique identifer of this component.
 java.lang.String getVersion()
          This method returns the version number of this component.
 int hashCode()
          overrides default hashCode() method.
 void list(java.io.PrintStream out)
          Convenience method for printing out the contents of the descriptor
 void setBootProcessHint(boolean bootProcessHint)
          This method sets a flag indicating whether the component should be started on platform boot.
 void setClasspath(java.net.URL[] classpath)
          This method sets the classpath of the component.
 void setCodebase(java.net.URL[] codebase)
          This method sets the codebase of the component.
 void setCommandLineParameters(java.lang.String commandLineParameters)
          This method sets the command line parameters that should be passed to the component on startup.
 void setComponentName(java.lang.String componentName)
          This method sets the name of this component.
 void setDescription(java.lang.String description)
          This method sets a description of the component.
 void setExecutable(boolean executable)
          This method sets whether the component is executable.
 void setExecutableString(java.lang.String executableString)
          This method sets the executableString used to execute the component.
 void setMobile(boolean mobile)
          This method sets a flag indicating whether the component can move between containers or platforms.
 void setPlatform(java.lang.String platform)
          This method sets the platform on which this component can run.
 void setProperties(java.util.Properties properties)
          This method sets the properties used by the component.
 void setRestartHint(boolean restartHint)
          This method sets a flag indicating whether the component should be restarted in case of failure.
 void setRunImmediatelyHint(boolean runImmediatelyHint)
          This method sets a flag indicating whether the component should be started immediately.
 void setSharedContainerHint(boolean sharedContainerHint)
          This method sets a flag indicating whether the component can share a container with other components.
 void setUniqueID(UniqueID uniqueID)
          This method sets the unique identifer of this component.
 void setVersion(java.lang.String version)
          This method sets the version number of this component.
 java.lang.String toString()
          overrides default toString() method.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComponentDescriptor

public ComponentDescriptor()
Default constructor


ComponentDescriptor

public ComponentDescriptor(ComponentDescriptor componentDescriptor)
This is a shallow copy contructor. However, changes to the original object will not affect the new object, since all fields of a ComponentDescriptor are immutable except the Properties object. For copying this field, the clone() method is used. This creates a new mapping but the keys and values are shallow copies. This is also permissible since keys and values are also strings in a Properties object.


ComponentDescriptor

public ComponentDescriptor(UniqueID uniqueID,
                           java.lang.String componentName,
                           java.lang.String version,
                           java.lang.String description,
                           boolean executable,
                           java.lang.String executableString,
                           java.lang.String platform,
                           boolean sharedContainerHint,
                           boolean restartHint,
                           boolean bootProcessHint,
                           boolean runImmediatelyHint,
                           boolean mobile,
                           java.net.URL[] classpath,
                           java.net.URL[] codebase,
                           java.util.Properties properties,
                           java.lang.String commandLineParameters)
This constructor is used to create an executable Java ComponentDescriptor.


ComponentDescriptor

public ComponentDescriptor(UniqueID uniqueID,
                           java.lang.String componentName,
                           java.lang.String version,
                           java.lang.String description,
                           boolean executable,
                           java.lang.String executableString,
                           java.lang.String platform,
                           boolean sharedContainerHint,
                           boolean restartHint,
                           boolean bootProcessHint,
                           java.lang.String commandLineParameters)
This constructor is used to create a non-Java executable component descriptor.


ComponentDescriptor

public ComponentDescriptor(UniqueID uniqueID,
                           java.lang.String componentName,
                           java.lang.String version,
                           java.lang.String description,
                           java.lang.String platform,
                           java.net.URL[] classpath,
                           java.net.URL[] codebase)
This constructor is used to create a non-executable Java component descriptor.

Method Detail

getUniqueID

public final UniqueID getUniqueID()
This method returns the unique identifer of this component.

Returns:
unique identifier for this component

setUniqueID

public final void setUniqueID(UniqueID uniqueID)
This method sets the unique identifer of this component.

Parameters:
uniqueID - unique identifier for this component

getComponentName

public final java.lang.String getComponentName()
This method returns the name of this component.

Returns:
name of this component

setComponentName

public final void setComponentName(java.lang.String componentName)
This method sets the name of this component.

Parameters:
componentName - name of this component

getVersion

public final java.lang.String getVersion()
This method returns the version number of this component.

Returns:
version number

setVersion

public final void setVersion(java.lang.String version)
This method sets the version number of this component.

Parameters:
version - version number

getDescription

public final java.lang.String getDescription()
This method returns a description of the component.

Returns:
description of the component

setDescription

public final void setDescription(java.lang.String description)
This method sets a description of the component.

Parameters:
description - description of the component

getExecutable

public final boolean getExecutable()
This method returns true if the component is executable.

Returns:
boolean

setExecutable

public final void setExecutable(boolean executable)
This method sets whether the component is executable.

Parameters:
executable - boolean

getExecutableString

public final java.lang.String getExecutableString()
This method returns the command used to execute the component. For a Java component, this is the name of the main class.

Returns:
command used to execute the component

setExecutableString

public final void setExecutableString(java.lang.String executableString)
This method sets the executableString used to execute the component. For a Java component, this is the name of the main class.


getPlatform

public final java.lang.String getPlatform()
This method returns the platform on which this component can run.

Returns:
platform name

setPlatform

public final void setPlatform(java.lang.String platform)
This method sets the platform on which this component can run.

Parameters:
platform - platform name

getSharedContainerHint

public final boolean getSharedContainerHint()
This method returns true if the component can share a container with other components.

Returns:
boolean

setSharedContainerHint

public final void setSharedContainerHint(boolean sharedContainerHint)
This method sets a flag indicating whether the component can share a container with other components.

Parameters:
sharedContainerHint - true if the component can share a container with other components

getRestartHint

public final boolean getRestartHint()
This method returns true if the component should be restarted in case of failure.

Returns:
boolean

setRestartHint

public final void setRestartHint(boolean restartHint)
This method sets a flag indicating whether the component should be restarted in case of failure.

Parameters:
restartHint - true if the component should be restarted if it fails

getBootProcessHint

public final boolean getBootProcessHint()
This method returns true if the component should be started on platform boot.

Returns:
boolean

setBootProcessHint

public final void setBootProcessHint(boolean bootProcessHint)
This method sets a flag indicating whether the component should be started on platform boot.

Parameters:
bootProcessHint - true if the component should be started on platform boot

getRunImmediatelyHint

public final boolean getRunImmediatelyHint()
This method returns true if the component should be started immediately.

Returns:
boolean

setRunImmediatelyHint

public final void setRunImmediatelyHint(boolean runImmediatelyHint)
This method sets a flag indicating whether the component should be started immediately.

Parameters:
runImmediatelyHint - true if the component should be started immediately

getMobile

public final boolean getMobile()
This method returns true if the component can move between containers or platforms.

Returns:
boolean

setMobile

public final void setMobile(boolean mobile)
This method sets a flag indicating whether the component can move between containers or platforms.

Parameters:
mobile - true if the component may be moved

getClasspath

public final java.net.URL[] getClasspath()
This method returns the classpath of the component.

Returns:
array of addresses representing where code used by this component can be found

setClasspath

public final void setClasspath(java.net.URL[] classpath)
This method sets the classpath of the component.

Parameters:
classpath - array of addresses representing where code used by this component can be found

getCodebase

public final java.net.URL[] getCodebase()
This method returns the codebase of the component.

Returns:
array of addresses representing where code exported by this component can be found

setCodebase

public final void setCodebase(java.net.URL[] codebase)
This method sets the codebase of the component.

Parameters:
codebase - array of addresses representing where code exported by this component can be found

getProperties

public final java.util.Properties getProperties()
This method returns the properties used by the component.

Returns:
properties used by the component

setProperties

public final void setProperties(java.util.Properties properties)
This method sets the properties used by the component.

Parameters:
properties - properties used by the component

getCommandLineParameters

public final java.lang.String getCommandLineParameters()
This method returns the command line parameters that should be passed to the component on startup.

Returns:
command line parameters used by the component

setCommandLineParameters

public final void setCommandLineParameters(java.lang.String commandLineParameters)
This method sets the command line parameters that should be passed to the component on startup.

Parameters:
commandLineParameters - command line parameters used by the component

equals

public final boolean equals(java.lang.Object obj)
This method overrides the default equals() implementation. Equality is strictly based on the component unique identifier. For more strict comparison use the equalsStrict comparison.


equalsStrict

public boolean equalsStrict(ComponentDescriptor descriptor)
This method provides a strict comparison with another ComponentDescriptor. Equality is based on every field. This is useful for security checks or other circumstances where it is important to know whether a descriptor has been modified in any way.


hashCode

public final int hashCode()
overrides default hashCode() method.


toString

public java.lang.String toString()
overrides default toString() method.


list

public void list(java.io.PrintStream out)
Convenience method for printing out the contents of the descriptor

Parameters:
out - the stream to write output to

Openwings API Documentation (v1.1)