org.oddjob.framework
Class BaseWrapper

java.lang.Object
  extended by org.oddjob.framework.BaseComponent
      extended by org.oddjob.framework.BaseWrapper
All Implemented Interfaces:
Runnable, org.apache.commons.beanutils.DynaBean, ArooaContextAware, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful, Stoppable
Direct Known Subclasses:
RunnableWrapper, ServiceWrapper

public abstract class BaseWrapper
extends BaseComponent
implements Runnable, Stateful, Resetable, org.apache.commons.beanutils.DynaBean, Stoppable, LogEnabled

Base class for proxy creators.


Field Summary
 
Fields inherited from class org.oddjob.framework.BaseComponent
iconHelper
 
Constructor Summary
BaseWrapper()
           
 
Method Summary
protected  void configure()
           
 boolean contains(String name, String key)
           
 boolean equals(Object other)
           
 Object get(String name)
           
 Object get(String name, int index)
           
 Object get(String name, String key)
           
protected abstract  org.apache.commons.beanutils.DynaBean getDynaBean()
           
 org.apache.commons.beanutils.DynaClass getDynaClass()
           
protected abstract  Object getProxy()
           
protected  int getResult(Object callableResult)
          Get the result.
abstract  Object getWrapped()
          Return the object that is being proxied.
static Class<?>[] interfacesFor(Object object)
           
protected  org.apache.log4j.Logger logger()
           
 String loggerName()
           
 void onDestroy()
          Subclasses override this method to clear up resources.
protected  void onStop()
           
 void remove(String name, String key)
           
protected  void save()
          Implementations override this to save their state on state change.
 void set(String name, int index, Object value)
           
 void set(String name, Object value)
           
 void set(String name, String key, Object value)
           
 void stop()
          Stop executing.
 String toString()
           
 
Methods inherited from class org.oddjob.framework.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, fireDestroyedState, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSession, stateHandler
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 
Methods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
 
Methods inherited from interface org.oddjob.Resetable
hardReset, softReset
 

Constructor Detail

BaseWrapper

public BaseWrapper()
Method Detail

getWrapped

public abstract Object getWrapped()
Return the object that is being proxied.

Returns:
The component being proxied.

getDynaBean

protected abstract org.apache.commons.beanutils.DynaBean getDynaBean()
Returns:

getProxy

protected abstract Object getProxy()

logger

protected org.apache.log4j.Logger logger()
Specified by:
logger in class BaseComponent

loggerName

public String loggerName()
Specified by:
loggerName in interface LogEnabled

configure

protected void configure()
                  throws ArooaConfigurationException
Throws:
ArooaConfigurationException

save

protected void save()
             throws ComponentPersistException
Description copied from class: BaseComponent
Implementations override this to save their state on state change.

Overrides:
save in class BaseComponent
Throws:
ComponentPersistException

equals

public boolean equals(Object other)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

contains

public boolean contains(String name,
                        String key)
Specified by:
contains in interface org.apache.commons.beanutils.DynaBean

get

public Object get(String name)
Specified by:
get in interface org.apache.commons.beanutils.DynaBean

get

public Object get(String name,
                  int index)
Specified by:
get in interface org.apache.commons.beanutils.DynaBean

get

public Object get(String name,
                  String key)
Specified by:
get in interface org.apache.commons.beanutils.DynaBean

getDynaClass

public org.apache.commons.beanutils.DynaClass getDynaClass()
Specified by:
getDynaClass in interface org.apache.commons.beanutils.DynaBean

remove

public void remove(String name,
                   String key)
Specified by:
remove in interface org.apache.commons.beanutils.DynaBean

set

public void set(String name,
                int index,
                Object value)
Specified by:
set in interface org.apache.commons.beanutils.DynaBean

set

public void set(String name,
                Object value)
Specified by:
set in interface org.apache.commons.beanutils.DynaBean

set

public void set(String name,
                String key,
                Object value)
Specified by:
set in interface org.apache.commons.beanutils.DynaBean

stop

public final void stop()
                throws FailedToStopException
Description copied from interface: Stoppable
Stop executing. This method should not return until the Stoppable has actually stopped.

Specified by:
stop in interface Stoppable
Throws:
FailedToStopException

onStop

protected void onStop()
               throws FailedToStopException
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:
Throws:
ArooaConversionException
ArooaPropertyException

onDestroy

public void onDestroy()
Description copied from class: BaseComponent
Subclasses override this method to clear up resources.

Overrides:
onDestroy in class BaseComponent

interfacesFor

public static Class<?>[] interfacesFor(Object object)