org.oddjob.framework
Class BasePrimary

java.lang.Object
  extended byorg.oddjob.framework.BaseComponent
      extended byorg.oddjob.framework.BasePrimary
All Implemented Interfaces:
Iconic
Direct Known Subclasses:
ClientNode.DeadNode, CronSchedule, IfJob, OddjobSchedule, SimpleJob, StructuralJob, TriggerJob, TriggerSchedule

public abstract class BasePrimary
extends BaseComponent

An abstract implementation of a component which provides commen functionality to concrete sub classes.

Author:
Rob Gordon

Field Summary
protected  boolean stop
          This flag is set by the stop method and should be examined by any Stoppable sub classes in their processing loop.
 
Fields inherited from class org.oddjob.framework.BaseComponent
changes, destroyed, iconHelper, location, lock, stateHandler
 
Constructor Summary
BasePrimary()
           
 
Method Summary
protected  void configurationComplete()
          Called after a component is configured.
 java.lang.String getLogger()
           
 java.lang.String getName()
          Get the job name.
protected  boolean independant()
           
protected  org.apache.log4j.Logger logger()
          Allow sub classes access to the logger.
 boolean setContext(ArooaContext context)
          Called during construction by the framework to allow a component access to the context that's creating it.
protected  void setJobStateReady()
           
 void setLogger(java.lang.String logger)
           
 void setName(java.lang.String name)
          Set the job name.
protected  void sleep(long waitTime)
          Utility method to sleep a certain time.
 java.lang.String toString()
          Override toString.
 
Methods inherited from class org.oddjob.framework.BaseComponent
addIconListener, addJobStateListener, addPropertyChangeListener, arooaRuntime, arooaRuntime, canHardReset, canSoftReset, configure, destroy, getLocation, iconForId, lastJobStateEvent, onDestroy, removeIconListener, removeJobStateListener, removePropertyChangeListener, setJobStateComplete, setJobStateException, setJobStateNotComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stop

protected transient volatile boolean stop
This flag is set by the stop method and should be examined by any Stoppable sub classes in their processing loop.

Constructor Detail

BasePrimary

public BasePrimary()
Method Detail

logger

protected org.apache.log4j.Logger logger()
Allow sub classes access to the logger.

Specified by:
logger in class BaseComponent
Returns:
The logger.

setContext

public boolean setContext(ArooaContext context)
Called during construction by the framework to allow a component access to the context that's creating it.

If this method returns true then it is an independent component responsible for it's own configuration and won't have it's configuration linked to its parents.

Subclasses overriding this method should always call super.setContext().

Parameters:
context - The ArooaXMLContext.
Returns:
true/false depending on subClasses implementation of independent();

independant

protected boolean independant()

setJobStateReady

protected void setJobStateReady()
Overrides:
setJobStateReady in class BaseComponent

sleep

protected void sleep(long waitTime)
Utility method to sleep a certain time.

Parameters:
waitTime - Milliseconds to sleep for.

configurationComplete

protected void configurationComplete()
Called after a component is configured.


setName

public void setName(java.lang.String name)
Set the job name. Used by subclasses to set the job name.

Parameters:
name - The name of the job.

getName

public java.lang.String getName()
Get the job name.

Returns:
The job name.

getLogger

public java.lang.String getLogger()
Returns:
Returns the logger.

setLogger

public void setLogger(java.lang.String logger)
Parameters:
logger - The logger to set.

toString

public java.lang.String toString()
Override toString.