Class BaseComponent

All Implemented Interfaces:
Component, Receiver<Transmittable>, Transmitter<Transmittable>, NamedObject, PackagePathed, Broadcaster, Listener, Repeater, Transceiver
Direct Known Subclasses:
Application

public class BaseComponent extends BaseRepeater implements Component
Base class for KivaKit components. Provides easy access to object registration and lookup (see Registry) as well as settings registration and lookup (see Settings). For details, see Component.
Author:
jonathanl (shibo)
See Also:
Component, Registry, Settings
  • Constructor Details

    • BaseComponent

      public BaseComponent()
  • Method Details

    • lookup

      public <T> T lookup(Class<T> type, InstanceIdentifier instance)
      Specified by:
      lookup in interface Component
      Returns:
      Any registered object of the given type with the given instance identifier in the global lookup registry
    • registerAllSettings

      public void registerAllSettings(Settings settings)
      Description copied from interface: Component
      Registers the settings from the given settings registry with the settings registry for this component
      Specified by:
      registerAllSettings in interface Component
    • registerAllSettingsIn

      public void registerAllSettingsIn(Package package_)
      Description copied from interface: Component
      Registers the settings in the given package with the registry for this component
      Specified by:
      registerAllSettingsIn in interface Component
    • registerAllSettingsIn

      public void registerAllSettingsIn(Folder folder)
      Description copied from interface: Component
      Registers the settings in the given folder with the settings registry for this component
      Specified by:
      registerAllSettingsIn in interface Component
    • registerObject

      public <T> T registerObject(T object, InstanceIdentifier instance)
      Registers the specified instance of the given object's type in the global lookup registry
      Specified by:
      registerObject in interface Component
    • registerSettingsObject

      public void registerSettingsObject(Object settings, InstanceIdentifier instance)
      Adds the identified settings object to the settings registry for this application. By default, this is the global settings store.
      Specified by:
      registerSettingsObject in interface Component
    • require

      public <T> T require(Class<T> type, InstanceIdentifier instance)
      Specified by:
      require in interface Component
      Returns:
      The configuration object of the given type to configure the given instance or failure if it doesn't exist
    • settings

      public <T> T settings(Class<T> type, InstanceIdentifier instance)
      Specified by:
      settings in interface Component
      Returns:
      The configuration object of the given type for the given instance to be configured, if any exists