TPTP 4.4.0 Monitoring Tools Project
Public API Specification

org.eclipse.hyades.logging.adapter.impl
Class Component

java.lang.Object
  extended byorg.eclipse.hyades.logging.adapter.impl.Component
All Implemented Interfaces:
IComponent
Direct Known Subclasses:
Context, ProcessUnit

public class Component
extends java.lang.Object
implements IComponent

Abstract class provided for the convinience. Contains some default implementations of the main functionality for the component Role of the abstract class Component is to provide initial most common implementation of basic functionality for component. So the class provide implementation for the getter and setter for the componentName, getter and setter for the targetName, stabs for the start, stop and update functions.


Field Summary
protected  IProcessUnit logger
           
protected  Status status
           
protected  boolean stopping
           
 
Constructor Summary
Component()
          Constructor for Component.
 
Method Summary
 void clean()
           
 IComponent[] getComponents()
          Method returns the components this component manages
 Status getComponentStatus()
          Get the component status object
 org.w3c.dom.Element getConfiguration()
          Method getConfiguration.
 org.w3c.dom.Element getContextConfiguration()
          Method getContextConfiguration.
 java.lang.String getDescription()
          Method returns the component description
 org.eclipse.hyades.logging.events.cbe.EventFactory getEventFactory()
           
 java.lang.String getExecutableClassName()
          Method returns the executable class name
 java.lang.String getImplementationCreationDate()
          Method returns implementation creation date
 java.lang.String getImplementationVersion()
          Method returns the version specific role description
 java.lang.String getImplementationVersionDescription()
          Method returns implementation version description
 int getItemsProcessedCount()
          Gets the number of items processed by the component.
 IProcessUnit getLogger()
          Retrieve the logger for this adapter.
 short getLoggingLevel()
          Method returns loggin level of the component
 java.lang.String getName()
          Method returns name of the component
 IComponent getParent()
          Components are arranged in a heirarchy.
 java.lang.String getRole()
          Method returns the role of the component
 java.lang.String getRoleCreationDate()
          Method returns role creation date
 java.lang.String getRoleVersion()
          Method returns the role version
 java.lang.String getRoleVersionDescription()
          Method returns the version specific role description
 java.lang.String getUniqueID()
          Method returns the uniqueID of this component instance
 void incrementItemsProcessedCount()
          Increments the number of items processed count for this component.
 void incrementItemsProcessedCount(int n)
          Increments the number of items processed count for this component by the value passed in.
 boolean init()
          Initialize all the Component level properties from the context config for this component, and then ask all child components to do the same.
 boolean isDisabled()
           
 boolean isStopping()
          Returns whether the component is in stopping state.
 void log(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event)
          Logging method.
 void log(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event, short level)
          Deprecated. Set the severity on the Common Base Event and use the log(CommonBaseEvent event) API.
 void setComponents(IComponent[] newComponents)
          Method sets the list of components this component manages.
 void setConfiguration(org.w3c.dom.Element newConfiguration)
          Sets the config.
 void setContextConfiguration(org.w3c.dom.Element newConfiguration)
          Sets the context config.
 void setDescription(java.lang.String newDescription)
          Method sets the description of this component
 void setDisabled(boolean disabled)
          Set whether this component is disabled or not
 void setExecutableClassName(java.lang.String newExecutableClassName)
          Method sets executable class name
 void setImplemenationCreationDate(java.lang.String newImplementationCreationDate)
          Method sets implementation creation date
 void setImplementationVersion(java.lang.String newImplementationVersion)
          Method sets the implementation version in the form of x.y.z where x is a major release level, which may have api changes y is a minor release level with no api changes z is an optional fix level with no api changes
 void setImplementationVersionDescription(java.lang.String newImplementationVersionDescription)
          Method sets implementation version description
 void setLogger(IProcessUnit logger)
          The logger will be set by the context during initialization.
 void setLoggingLevel(short newLevel)
          Method sets logging level of the component
 void setName(java.lang.String newName)
          Method sets name of the component
 void setParent(IComponent parent)
          Components are arranged in a heirarchy.
 void setRole(java.lang.String newRole)
          Method sets the role of the component
 void setRoleCreationDate(java.lang.String newCreationDate)
          Method sets role creation time
 void setRoleVersion(java.lang.String newRoleVersion)
          Method sets role version
 void setRoleVersionDescription(java.lang.String newRoleVersionDescription)
          Method sets the version specific role description
 void setStopping(boolean stopping)
          Set the stopping state of the component.
 void setUniqueID(java.lang.String newUniqueID)
          Method sets the uniqueID of this component instance
 void start()
          Method start.
 void stop()
          Method stop.
 void stop(int toStop)
           
 void trace(java.lang.String msgKey, java.lang.String sub)
          Tracing method with one substitution variable.
 void trace(java.lang.String msgKey, java.lang.String sub1, java.lang.String sub2)
          Tracing method with two substitution variables.
 void trace(java.lang.String msgKey, java.lang.String sub1, java.lang.String sub2, java.lang.String sub3)
          Tracing method with three substitution variables.
 void update()
          Set Component instance level properties based on the component configuration Element.
 void update(org.w3c.dom.Element config)
          Method update.
protected  void updateConfigurationAttribute(java.lang.String attrName, java.lang.String attrValue)
          Update an attribute in the configuration element
protected  void updateContextConfigurationAttribute(java.lang.String attrName, java.lang.String attrValue)
          Update an attribute in the context configuration element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected IProcessUnit logger

status

protected Status status

stopping

protected boolean stopping
Constructor Detail

Component

public Component()
Constructor for Component.

Method Detail

init

public boolean init()
Initialize all the Component level properties from the context config for this component, and then ask all child components to do the same.

Specified by:
init in interface IComponent
Returns:
boolean if init success
See Also:
IComponent.init()

start

public void start()
Description copied from interface: IComponent
Method start. Starts component activity

Specified by:
start in interface IComponent
See Also:
IComponent.start()

stop

public void stop(int toStop)
See Also:
org.eclipse.hyades.logging.adapter.IComponent#stop(int)

stop

public void stop()
Description copied from interface: IComponent
Method stop. Stops the component activity

Specified by:
stop in interface IComponent
See Also:
IComponent.stop()

updateConfigurationAttribute

protected void updateConfigurationAttribute(java.lang.String attrName,
                                            java.lang.String attrValue)
Update an attribute in the configuration element

Parameters:
attrName - name of attribute
attrValue - value of the attribute

updateContextConfigurationAttribute

protected void updateContextConfigurationAttribute(java.lang.String attrName,
                                                   java.lang.String attrValue)
Update an attribute in the context configuration element

Parameters:
attrName -
attrValue -

update

public void update(org.w3c.dom.Element config)
            throws AdapterInvalidConfig
Description copied from interface: IComponent
Method update. Sets the component configuration with a root DOM Element and then request the component to update based on that Element.

Specified by:
update in interface IComponent
Parameters:
config - - configuration DOM element
Throws:
AdapterInvalidConfig - if the configuration is invalid or cannot be processed.
See Also:
IComponent.update(Element)

update

public void update()
            throws AdapterInvalidConfig
Set Component instance level properties based on the component configuration Element.

Specified by:
update in interface IComponent
Throws:
AdapterInvalidConfig - if the configuration is invalid or cannot be processed.
See Also:
IComponent.update()

getContextConfiguration

public org.w3c.dom.Element getContextConfiguration()
Description copied from interface: IComponent
Method getContextConfiguration.

Specified by:
getContextConfiguration in interface IComponent
Returns:
Element - current config of the component
See Also:
IComponent.getContextConfiguration()

setContextConfiguration

public void setContextConfiguration(org.w3c.dom.Element newConfiguration)
Sets the context config.

Specified by:
setContextConfiguration in interface IComponent
See Also:
IComponent.setContextConfiguration(Element)

getConfiguration

public org.w3c.dom.Element getConfiguration()
Description copied from interface: IComponent
Method getConfiguration.

Specified by:
getConfiguration in interface IComponent
Returns:
Element - current config of the component
See Also:
IComponent.getConfiguration()

setConfiguration

public void setConfiguration(org.w3c.dom.Element newConfiguration)
Sets the config.

Specified by:
setConfiguration in interface IComponent

getLogger

public IProcessUnit getLogger()
Description copied from interface: IComponent
Retrieve the logger for this adapter. This cannot be called until the Component has been initialized by the init() method.

Specified by:
getLogger in interface IComponent
Returns:
the logger for this adapter
See Also:
IComponent.getLogger()

setLogger

public void setLogger(IProcessUnit logger)
Description copied from interface: IComponent
The logger will be set by the context during initialization.

Specified by:
setLogger in interface IComponent
Parameters:
logger - the logger for this component to use
See Also:
IComponent.setLogger(IProcessUnit)

getEventFactory

public org.eclipse.hyades.logging.events.cbe.EventFactory getEventFactory()

getLoggingLevel

public short getLoggingLevel()
Description copied from interface: IComponent
Method returns loggin level of the component

Specified by:
getLoggingLevel in interface IComponent
Returns:
short
See Also:
IComponent.getName()

setLoggingLevel

public void setLoggingLevel(short newLevel)
Description copied from interface: IComponent
Method sets logging level of the component

Specified by:
setLoggingLevel in interface IComponent
Parameters:
newLevel - - new logging level
See Also:
org.eclipse.hyades.logging.adapter.IComponent#setName(short)

getName

public java.lang.String getName()
Description copied from interface: IComponent
Method returns name of the component

Specified by:
getName in interface IComponent
Returns:
String
See Also:
IComponent.getName()

setName

public void setName(java.lang.String newName)
Description copied from interface: IComponent
Method sets name of the component

Specified by:
setName in interface IComponent
See Also:
IComponent.setName(java.lang.String)

getRole

public java.lang.String getRole()
Description copied from interface: IComponent
Method returns the role of the component

Specified by:
getRole in interface IComponent
Returns:
String
See Also:
IComponent.getRole()

setRole

public void setRole(java.lang.String newRole)
Description copied from interface: IComponent
Method sets the role of the component

Specified by:
setRole in interface IComponent
See Also:
IComponent.setRole(java.lang.String)

getDescription

public java.lang.String getDescription()
Description copied from interface: IComponent
Method returns the component description

Specified by:
getDescription in interface IComponent
Returns:
String
See Also:
IComponent.getDescription()

setDescription

public void setDescription(java.lang.String newDescription)
Description copied from interface: IComponent
Method sets the description of this component

Specified by:
setDescription in interface IComponent
See Also:
IComponent.setDescription(java.lang.String)

getUniqueID

public java.lang.String getUniqueID()
Description copied from interface: IComponent
Method returns the uniqueID of this component instance

Specified by:
getUniqueID in interface IComponent
Returns:
String
See Also:
IComponent.getUniqueID()

setUniqueID

public void setUniqueID(java.lang.String newUniqueID)
Description copied from interface: IComponent
Method sets the uniqueID of this component instance

Specified by:
setUniqueID in interface IComponent
See Also:
IComponent.setUniqueID(java.lang.String)

getExecutableClassName

public java.lang.String getExecutableClassName()
Description copied from interface: IComponent
Method returns the executable class name

Specified by:
getExecutableClassName in interface IComponent
Returns:
String
See Also:
IComponent.getExecutableClassName()

setExecutableClassName

public void setExecutableClassName(java.lang.String newExecutableClassName)
Description copied from interface: IComponent
Method sets executable class name

Specified by:
setExecutableClassName in interface IComponent
See Also:
IComponent.setExecutableClassName(java.lang.String)

getRoleVersion

public java.lang.String getRoleVersion()
Description copied from interface: IComponent
Method returns the role version

Specified by:
getRoleVersion in interface IComponent
Returns:
String
See Also:
IComponent.getRoleVersion()

setRoleVersion

public void setRoleVersion(java.lang.String newRoleVersion)
Description copied from interface: IComponent
Method sets role version

Specified by:
setRoleVersion in interface IComponent
See Also:
IComponent.setRoleVersion(java.lang.String)

getRoleCreationDate

public java.lang.String getRoleCreationDate()
Description copied from interface: IComponent
Method returns role creation date

Specified by:
getRoleCreationDate in interface IComponent
Returns:
String
See Also:
IComponent.getRoleCreationDate()

setRoleCreationDate

public void setRoleCreationDate(java.lang.String newCreationDate)
Description copied from interface: IComponent
Method sets role creation time

Specified by:
setRoleCreationDate in interface IComponent
See Also:
IComponent.setRoleCreationDate(java.lang.String)

getRoleVersionDescription

public java.lang.String getRoleVersionDescription()
Description copied from interface: IComponent
Method returns the version specific role description

Specified by:
getRoleVersionDescription in interface IComponent
Returns:
String
See Also:
IComponent.getRoleVersionDescription()

setRoleVersionDescription

public void setRoleVersionDescription(java.lang.String newRoleVersionDescription)
Description copied from interface: IComponent
Method sets the version specific role description

Specified by:
setRoleVersionDescription in interface IComponent
See Also:
IComponent.setRoleVersionDescription(java.lang.String)

getImplementationVersion

public java.lang.String getImplementationVersion()
Description copied from interface: IComponent
Method returns the version specific role description

Specified by:
getImplementationVersion in interface IComponent
Returns:
String
See Also:
IComponent.getImplementationVersion()

setImplementationVersion

public void setImplementationVersion(java.lang.String newImplementationVersion)
Description copied from interface: IComponent
Method sets the implementation version in the form of x.y.z where x is a major release level, which may have api changes y is a minor release level with no api changes z is an optional fix level with no api changes

Specified by:
setImplementationVersion in interface IComponent
See Also:
IComponent.setImplementationVersion(java.lang.String)

getImplementationCreationDate

public java.lang.String getImplementationCreationDate()
Description copied from interface: IComponent
Method returns implementation creation date

Specified by:
getImplementationCreationDate in interface IComponent
Returns:
String
See Also:
IComponent.getImplementationCreationDate()

setImplemenationCreationDate

public void setImplemenationCreationDate(java.lang.String newImplementationCreationDate)
Description copied from interface: IComponent
Method sets implementation creation date

Specified by:
setImplemenationCreationDate in interface IComponent
See Also:
IComponent.setImplemenationCreationDate(java.lang.String)

getImplementationVersionDescription

public java.lang.String getImplementationVersionDescription()
Description copied from interface: IComponent
Method returns implementation version description

Specified by:
getImplementationVersionDescription in interface IComponent
Returns:
String
See Also:
IComponent.getImplementationVersionDescription()

setImplementationVersionDescription

public void setImplementationVersionDescription(java.lang.String newImplementationVersionDescription)
Description copied from interface: IComponent
Method sets implementation version description

Specified by:
setImplementationVersionDescription in interface IComponent
See Also:
IComponent.setImplementationVersionDescription(java.lang.String)

getComponents

public IComponent[] getComponents()
Description copied from interface: IComponent
Method returns the components this component manages

Specified by:
getComponents in interface IComponent
Returns:
org.eclipse.hyades.logging.adapter.IComponent[]
See Also:
IComponent.getComponents()

setComponents

public void setComponents(IComponent[] newComponents)
Description copied from interface: IComponent
Method sets the list of components this component manages. This component will now be considered the parent of each element it manages.

Specified by:
setComponents in interface IComponent
See Also:
IComponent.setComponents(org.eclipse.hyades.logging.adapter.IComponent[])

clean

public void clean()

trace

public void trace(java.lang.String msgKey,
                  java.lang.String sub)
Tracing method with one substitution variable.

The message with the specified resource key and substutution value is logged in a Common Base Event with severity 5.

Parameters:
msgKey - resource key for trace message string.
sub - substitution value - null for no value

trace

public void trace(java.lang.String msgKey,
                  java.lang.String sub1,
                  java.lang.String sub2)
Tracing method with two substitution variables.

The message with the specified resource key and substutution values is logged in a Common Base Event with severity 5.

Parameters:
msgKey - resource key for trace message string.
sub1 - first substitution value
sub2 - second substitution value

trace

public void trace(java.lang.String msgKey,
                  java.lang.String sub1,
                  java.lang.String sub2,
                  java.lang.String sub3)
Tracing method with three substitution variables.

The message with the specified resource key and substutution values is logged in a Common Base Event with severity 5.

Parameters:
msgKey - resource key for trace message string.
sub1 - first substitution value
sub2 - second substitution value
sub3 - third substitution value

log

public void log(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event)
Logging method.

The Common Base Event is logged based on its severity.

Specified by:
log in interface IComponent
Parameters:
event - The Common Base Event to be logged.

log

public void log(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event,
                short level)
Deprecated. Set the severity on the Common Base Event and use the log(CommonBaseEvent event) API.

Logging method.

Specified by:
log in interface IComponent
Parameters:
event - The Common Base Event to be logged.
level - The severity of the Common Base Event to be logged.

setParent

public void setParent(IComponent parent)
Description copied from interface: IComponent
Components are arranged in a heirarchy. Sets the parent component of this component.

Specified by:
setParent in interface IComponent
Parameters:
parent - the parent component in the hierarchy
See Also:
IComponent.setParent(org.eclipse.hyades.logging.adapter.IComponent)

getParent

public IComponent getParent()
Description copied from interface: IComponent
Components are arranged in a heirarchy. Gets the parent component of this component.

Specified by:
getParent in interface IComponent
Returns:
the parent component
See Also:
IComponent.getParent()

isStopping

public boolean isStopping()
Returns whether the component is in stopping state.

Returns:
true if the component is stopping, false otherwise.

setStopping

public void setStopping(boolean stopping)
Set the stopping state of the component.

Parameters:
stopping - - true for stopping, false for not stopping

getItemsProcessedCount

public int getItemsProcessedCount()
Gets the number of items processed by the component.

Returns:
the number of items processed by the component.

incrementItemsProcessedCount

public void incrementItemsProcessedCount()
Increments the number of items processed count for this component.


incrementItemsProcessedCount

public void incrementItemsProcessedCount(int n)
Increments the number of items processed count for this component by the value passed in.

Parameters:
n - Amount to increment the count by.

getComponentStatus

public Status getComponentStatus()
Get the component status object

Returns:
Returns the status object for this component.

isDisabled

public boolean isDisabled()
Returns:
boolean whether this component is disabled or not

setDisabled

public void setDisabled(boolean disabled)
Set whether this component is disabled or not

Parameters:
disabled - boolean

TPTP 4.4.0 Monitoring Tools Project
Public API Specification