org.oddjob.framework
Class RunnableWrapper

java.lang.Object
  extended by org.oddjob.framework.BaseComponent
      extended by org.oddjob.framework.BaseWrapper
          extended by org.oddjob.framework.RunnableWrapper
All Implemented Interfaces:
Serializable, Runnable, org.apache.commons.beanutils.DynaBean, ArooaContextAware, ArooaSessionAware, Describeable, Forceable, ComponentWrapper, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful, Stoppable

public class RunnableWrapper
extends BaseWrapper
implements ComponentWrapper, Serializable, Forceable

Creates a proxy for any Runnable to allow it to be controlled and monitored within Oddjob.

See Also:
Serialized Form
Author:
Rob Gordon.

Field Summary
 
Fields inherited from class org.oddjob.framework.BaseComponent
iconHelper
 
Constructor Summary
RunnableWrapper(Object wrapped, Object proxy)
          Constructor.
 
Method Summary
protected  void fireDestroyedState()
          Internal method to fire state.
 void force()
          Force the job to COMPLETE.
protected  org.apache.commons.beanutils.DynaBean getDynaBean()
          Sub classes must provide a dyna bean for properties.
protected  Object getProxy()
          Subclass must provide the proxy.
protected  JobStateChanger getStateChanger()
           
protected  Object getWrapped()
          Return the object that is being proxied.
 boolean hardReset()
          Perform a hard reset on the job.
 void onStop()
           
 void run()
           
 void setArooaSession(ArooaSession session)
          Here for the tests...
 boolean softReset()
          Perform a soft reset on the job.
protected  JobStateHandler stateHandler()
           
 
Methods inherited from class org.oddjob.framework.BaseWrapper
configure, contains, describe, equals, get, get, get, getDynaClass, getResult, interfacesFor, logger, loggerName, onDestroy, remove, save, set, set, set, stop, toString
 
Methods inherited from class org.oddjob.framework.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
 

Constructor Detail

RunnableWrapper

public RunnableWrapper(Object wrapped,
                       Object proxy)
Constructor.

Method Detail

setArooaSession

public void setArooaSession(ArooaSession session)
Description copied from class: BaseComponent
Here for the tests...

Specified by:
setArooaSession in interface ArooaSessionAware
Overrides:
setArooaSession in class BaseComponent

stateHandler

protected JobStateHandler stateHandler()
Specified by:
stateHandler in class BaseComponent

getStateChanger

protected JobStateChanger getStateChanger()

getWrapped

protected Object getWrapped()
Description copied from class: BaseWrapper
Return the object that is being proxied.

Specified by:
getWrapped in class BaseWrapper
Returns:
The component being proxied.

getDynaBean

protected org.apache.commons.beanutils.DynaBean getDynaBean()
Description copied from class: BaseWrapper
Sub classes must provide a dyna bean for properties.

Specified by:
getDynaBean in class BaseWrapper
Returns:

getProxy

protected Object getProxy()
Description copied from class: BaseWrapper
Subclass must provide the proxy.

Specified by:
getProxy in class BaseWrapper
Returns:

run

public void run()
Specified by:
run in interface Runnable

onStop

public void onStop()
            throws FailedToStopException
Overrides:
onStop in class BaseWrapper
Throws:
FailedToStopException

softReset

public boolean softReset()
Perform a soft reset on the job.

Specified by:
softReset in interface Resetable
Returns:
true if successful.

hardReset

public boolean hardReset()
Perform a hard reset on the job.

Specified by:
hardReset in interface Resetable
Returns:
true if successful.

force

public void force()
Force the job to COMPLETE.

Specified by:
force in interface Forceable

fireDestroyedState

protected void fireDestroyedState()
Internal method to fire state.

Specified by:
fireDestroyedState in class BaseComponent