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 Details

    • BaseWrapper

      public BaseWrapper()
  • Method Details

    • getWrapped

      protected abstract Object 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

      protected abstract Object getProxy()
      Subclass must provide the proxy.
      Returns:
    • logger

      protected org.slf4j.Logger logger()
      Specified by:
      logger in class BaseComponent
    • loggerName

      public String loggerName()
      Description copied from interface: LogEnabled
      Provide the logger name. The name should be unique for each component that is LogEnabled.
      Specified by:
      loggerName in interface LogEnabled
      Returns:
      A logger name. Never Null.
    • configure

      protected void configure() throws ArooaConfigurationException
      Called by sub classes to configure the component.
      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:
      The result.
      Throws:
      ArooaConversionException - If the result can't be converted to int.
      ArooaPropertyException - If the result property can't be read.
    • describe

      public Map<String,String> describe()
      Description copied from interface: Describable
      Provides the properties.
      Specified by:
      describe in interface Describable
      Returns:
      A map of property values. Must not be null.
    • onDestroy

      public void onDestroy()
      Description copied from class: BaseComponent
      Subclasses override this method to clear up resources. This is called by the framework before child elements have been destroyed.
      Overrides:
      onDestroy in class BaseComponent
    • interfacesFor

      public static Class<?>[] interfacesFor(Object object)
      Helper class to find interfaces implemented by an object.
      Parameters:
      object -
      Returns:
      An array of the interface classes.