org.oddjob.framework
Class ServiceWrapper
java.lang.Object
org.oddjob.framework.BaseComponent
org.oddjob.framework.BaseWrapper
org.oddjob.framework.ServiceWrapper
- All Implemented Interfaces:
- ContextAware, Destroyable, org.apache.commons.beanutils.DynaBean, Iconic, Initializable, java.lang.reflect.InvocationHandler, LogEnabled, Resetable, java.lang.Runnable, Stateful, Stoppable
- public class ServiceWrapper
- extends BaseWrapper
- implements java.lang.reflect.InvocationHandler
Wraps a Runnable object and adds state to it.
This is a helper class for parent jobs which depend on their
child being Stateful - this pretends an un Stateful Runnable
is Statful thus allowing the parent to accept plain Runnables
as children.
- Author:
- Rob Gordon.
| Methods inherited from class org.oddjob.framework.BaseWrapper |
contains, equals, get, get, get, getDynaClass, getLogger, getResult, hardReset, init, interfacesFor, logger, onDestroy, remove, set, set, set, setContext, softReset, stop, toString |
| Methods inherited from class org.oddjob.framework.BaseComponent |
addIconListener, addJobStateListener, addPropertyChangeListener, arooaRuntime, arooaRuntime, canHardReset, canSoftReset, configure, destroy, getLocation, iconForId, lastJobStateEvent, removeIconListener, removeJobStateListener, removePropertyChangeListener, setJobStateComplete, setJobStateException, setJobStateNotComplete, setJobStateReady |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ServiceWrapper
protected ServiceWrapper()
wrapperFor
public static java.lang.Runnable wrapperFor(Service service)
invoke
public java.lang.Object invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.lang.Throwable
- Specified by:
invoke in interface java.lang.reflect.InvocationHandler
- Throws:
java.lang.Throwable
getWrapped
protected java.lang.Object getWrapped()
- Specified by:
getWrapped in class BaseWrapper
getDynaBean
protected org.apache.commons.beanutils.DynaBean getDynaBean()
- Specified by:
getDynaBean in class BaseWrapper
getProxy
protected java.lang.Object getProxy()
- Specified by:
getProxy in class BaseWrapper
setWrapped
protected void setWrapped(Service service)
run
public void run()
- Specified by:
run in interface java.lang.Runnable
onStop
public void onStop()
throws java.lang.RuntimeException
- Overrides:
onStop in class BaseWrapper
- Throws:
java.lang.RuntimeException