Class AbstractConfigurable<T extends ConfigBean>

java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.config.AbstractConfigurable<T>
All Implemented Interfaces:
ConfigAware<T>, HandleAware, Ready, ReadyListener
Direct Known Subclasses:
ConfigSerialNumberProvider

public abstract class AbstractConfigurable<T extends ConfigBean> extends ReadyBean implements ConfigAware<T>
Abstract base class that can be used for objects that need to be configurable. This is useful for classes that don't otherwise extend any other class and want to get ConfigAware support without any additional work. This is simply a convenience class to simplify the implementation of ConfigAware.

This class does not implement ContextHandleAware so the handle will not be automatically connected by adding it to a BeanContext. If you want your bean handle to be automatically constructed from the context, simply implement the ContextHandleAware interface.

Since:
1.0
Version:
2022-09-12
  • Constructor Details

    • AbstractConfigurable

      public AbstractConfigurable(String name)
  • Method Details

    • getConfig

      public T getConfig()
      Retrieves the configuration bean.
      Specified by:
      getConfig in interface ConfigAware<T extends ConfigBean>
      Returns:
      the config bean
    • setConfig

      public void setConfig(T config)
      Sets the configuration bean.
      Specified by:
      setConfig in interface ConfigAware<T extends ConfigBean>
      Parameters:
      config - the config bean
    • getHandle

      public Handle getHandle()
      Description copied from interface: HandleAware
      Returns the handle for this bean. This is used by the context to compute the opaque handle for the object.
      Specified by:
      getHandle in interface HandleAware
      Returns:
      the handle node for the bean