Package org.oddjob.framework.adapt
Class BaseWrapper
java.lang.Object
org.oddjob.framework.extend.BaseComponent
org.oddjob.framework.adapt.BaseWrapper
- All Implemented Interfaces:
Runnable,org.apache.commons.beanutils.DynaBean,ArooaContextAware,ArooaSessionAware,Describable,PropertyChangeNotifier,Iconic,LogEnabled,Resettable,Stateful,Stoppable
- Direct Known Subclasses:
JobWrapper,ServiceWrapper
public abstract class BaseWrapper
extends BaseComponent
implements Runnable, Stateful, Resettable, org.apache.commons.beanutils.DynaBean, Stoppable, LogEnabled, Describable
Base class for proxy creators.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalled by sub classes to configure the component.booleandescribe()Provides the properties.booleanprotected abstract org.apache.commons.beanutils.DynaBeanSub classes must provide a dyna bean for properties.org.apache.commons.beanutils.DynaClassprotected abstract ObjectgetProxy()Subclass must provide the proxy.protected intGet the result.protected abstract ObjectReturn the object that is being proxied.static Class<?>[]interfacesFor(Object object) Helper class to find interfaces implemented by an object.protected org.slf4j.Loggerlogger()Provide the logger name.voidSubclasses override this method to clear up resources.protected voidonStop()voidprotected voidsave()Implementations override this to save their state on state change.voidvoidvoidfinal voidstop()Stop executing.toString()Methods inherited from class org.oddjob.framework.extend.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, fireDestroyedState, firePropertyChange, getArooaSession, iconForId, iconHelper, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSession, stateHandlerMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.oddjob.Resettable
hardReset, softResetMethods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
-
Constructor Details
-
BaseWrapper
public BaseWrapper()
-
-
Method Details
-
getWrapped
Return the object that is being proxied.- Returns:
- The component being proxied.
-
getDynaBean
protected abstract org.apache.commons.beanutils.DynaBean getDynaBean()Sub classes must provide a dyna bean for properties.- Returns:
-
getProxy
Subclass must provide the proxy.- Returns:
-
logger
protected org.slf4j.Logger logger()- Specified by:
loggerin classBaseComponent
-
loggerName
Description copied from interface:LogEnabledProvide the logger name. The name should be unique for each component that is LogEnabled.- Specified by:
loggerNamein interfaceLogEnabled- Returns:
- A logger name. Never Null.
-
configure
Called by sub classes to configure the component.- Throws:
ArooaConfigurationException
-
save
Description copied from class:BaseComponentImplementations override this to save their state on state change.- Overrides:
savein classBaseComponent- Throws:
ComponentPersistException
-
equals
-
toString
-
contains
- Specified by:
containsin interfaceorg.apache.commons.beanutils.DynaBean
-
get
- Specified by:
getin interfaceorg.apache.commons.beanutils.DynaBean
-
get
- Specified by:
getin interfaceorg.apache.commons.beanutils.DynaBean
-
get
- Specified by:
getin interfaceorg.apache.commons.beanutils.DynaBean
-
getDynaClass
public org.apache.commons.beanutils.DynaClass getDynaClass()- Specified by:
getDynaClassin interfaceorg.apache.commons.beanutils.DynaBean
-
remove
- Specified by:
removein interfaceorg.apache.commons.beanutils.DynaBean
-
set
- Specified by:
setin interfaceorg.apache.commons.beanutils.DynaBean
-
set
- Specified by:
setin interfaceorg.apache.commons.beanutils.DynaBean
-
set
- Specified by:
setin interfaceorg.apache.commons.beanutils.DynaBean
-
stop
Description copied from interface:StoppableStop executing. This method should not return until the Stoppable has actually stopped.- Specified by:
stopin interfaceStoppable- Throws:
FailedToStopException
-
onStop
- Throws:
FailedToStopException
-
getResult
protected int getResult(Object callableResult) throws ArooaPropertyException, ArooaConversionException Get the result. Use either the return value from the Callable or the result property if there is one.- Returns:
- The result.
- Throws:
ArooaConversionException- If the result can't be converted to int.ArooaPropertyException- If the result property can't be read.
-
describe
Description copied from interface:DescribableProvides the properties.- Specified by:
describein interfaceDescribable- Returns:
- A map of property values. Must not be null.
-
onDestroy
public void onDestroy()Description copied from class:BaseComponentSubclasses override this method to clear up resources. This is called by the framework before child elements have been destroyed.- Overrides:
onDestroyin classBaseComponent
-
interfacesFor
Helper class to find interfaces implemented by an object.- Parameters:
object-- Returns:
- An array of the interface classes.
-