Class AbstractConfigurableController<M extends com.google.protobuf.AbstractMessage,MB extends com.google.protobuf.AbstractMessage.Builder<MB>,CONFIG extends com.google.protobuf.Message>

Type Parameters:
M - the message type
MB - builder of the message M
CONFIG - the configuration data type
All Implemented Interfaces:
org.openbase.jul.extension.protobuf.iface.DataBuilderProvider<M,MB>, org.openbase.jul.extension.type.iface.ScopeProvider, org.openbase.jul.extension.type.iface.TransactionIdProvider, org.openbase.jul.iface.Activatable, org.openbase.jul.iface.Configurable<String,CONFIG>, org.openbase.jul.iface.Identifiable<String>, org.openbase.jul.iface.Initializable<CONFIG>, org.openbase.jul.iface.Manageable<CONFIG>, org.openbase.jul.iface.Pingable, org.openbase.jul.iface.provider.ConfigProvider<CONFIG>, org.openbase.jul.iface.Readyable, org.openbase.jul.iface.Requestable<M>, org.openbase.jul.iface.Shutdownable, org.openbase.jul.pattern.ChangeListener, org.openbase.jul.pattern.controller.ConfigurableController<String,M,CONFIG>, org.openbase.jul.pattern.controller.Controller<M>, org.openbase.jul.pattern.controller.IdentifiableController<String,M>, org.openbase.jul.pattern.controller.MessageController<M,MB>, org.openbase.jul.pattern.provider.DataProvider<M>
Direct Known Subclasses:
AbstractEnableableConfigurableController

public abstract class AbstractConfigurableController<M extends com.google.protobuf.AbstractMessage,MB extends com.google.protobuf.AbstractMessage.Builder<MB>,CONFIG extends com.google.protobuf.Message> extends AbstractIdentifiableController<M,MB> implements org.openbase.jul.pattern.controller.ConfigurableController<String,M,CONFIG>
  • Field Details

  • Constructor Details

    • AbstractConfigurableController

      public AbstractConfigurableController(MB builder) throws org.openbase.jul.exception.InstantiationException
      Throws:
      org.openbase.jul.exception.InstantiationException
  • Method Details

    • init

      public void init(CONFIG config) throws org.openbase.jul.exception.InitializationException, InterruptedException
      Initialize the controller with a configuration.
      Specified by:
      init in interface org.openbase.jul.iface.Initializable<M extends com.google.protobuf.AbstractMessage>
      Parameters:
      config - the configuration
      Throws:
      org.openbase.jul.exception.InitializationException - if the initialization fails
      InterruptedException - if the initialization is interrupted
    • applyConfigUpdate

      public CONFIG applyConfigUpdate(CONFIG config) throws org.openbase.jul.exception.CouldNotPerformException, InterruptedException
      Apply an update to the configuration of this controller.
      Specified by:
      applyConfigUpdate in interface org.openbase.jul.iface.Configurable<M extends com.google.protobuf.AbstractMessage,MB extends com.google.protobuf.AbstractMessage.Builder<MB>>
      Parameters:
      config - the updated configuration
      Returns:
      the updated configuration
      Throws:
      org.openbase.jul.exception.CouldNotPerformException - if the update could not be performed
      InterruptedException - if the update has been interrupted
    • getConfigField

      protected final Object getConfigField(String name) throws org.openbase.jul.exception.CouldNotPerformException
      Throws:
      org.openbase.jul.exception.CouldNotPerformException
    • getConfigField

      protected final Object getConfigField(String name, CONFIG config) throws org.openbase.jul.exception.CouldNotPerformException
      Throws:
      org.openbase.jul.exception.CouldNotPerformException
    • hasConfigField

      protected final boolean hasConfigField(String name) throws org.openbase.jul.exception.CouldNotPerformException
      Throws:
      org.openbase.jul.exception.CouldNotPerformException
    • supportsConfigField

      protected final boolean supportsConfigField(String name) throws org.openbase.jul.exception.CouldNotPerformException
      Throws:
      org.openbase.jul.exception.CouldNotPerformException
    • getConfig

      public CONFIG getConfig() throws org.openbase.jul.exception.NotAvailableException
      Specified by:
      getConfig in interface org.openbase.jul.iface.provider.ConfigProvider<M extends com.google.protobuf.AbstractMessage>
      Throws:
      org.openbase.jul.exception.NotAvailableException