Interface Component

All Superinterfaces:
Broadcaster, Listener, NamedObject, Receiver<Transmittable>, Repeater, Transceiver, Transmitter<Transmittable>
All Known Subinterfaces:
ComponentMixin
All Known Implementing Classes:
Application, BaseComponent, Server

public interface Component extends Repeater
Interface to KivaKit component functionality, including easy access to settings (see Settings) and object registries (see Registry).

Packaging Methods

Classes implementing this interface are provided with easy access to packages and package resources relative to the class' package:

Settings Registry Methods

Settings for a component can be retrieved with settings(Class). This provides a simplified interface to load settings objects specified by the user while also allowing for default settings when they are not specified. See Settings for details.

Object Lookup Registry

Access to this component's lookup Registry is provided and fulfills basic needs for object wiring:

Author:
jonathanl (shibo)
See Also:
Registry, Settings, Repeater
  • Method Details

    • lookup

      default <T> T lookup(Class<T> type)
      Convenience method
    • lookup

      default <T> T lookup(Class<T> type, Enum<?> instance)
      Convenience method
    • lookup

      default <T> T lookup(Class<T> type, String instance)
      Convenience method
    • lookup

      <T> T lookup(Class<T> type, InstanceIdentifier instance)
      Returns:
      Any settings object of the given type and instance
    • packageResource

      default Resource packageResource(String path)
      Returns:
      The resource at the given path relative to this component's class
    • registerAllSettings

      void registerAllSettings(Settings settings)
      Registers the settings from the given settings registry with the settings registry for this component
    • registerAllSettingsIn

      void registerAllSettingsIn(Folder folder)
      Registers the settings in the given folder with the settings registry for this component
    • registerAllSettingsIn

      void registerAllSettingsIn(Package package_)
      Registers the settings in the given package with the registry for this component
    • registerDeployment

      default void registerDeployment(Deployment deployment)
      Adds the settings objects from the given Deployment to the settings registry for this component.
    • registerObject

      default <T> T registerObject(T object)
      Convenience method
    • registerObject

      default <T> T registerObject(T object, Enum<?> instance)
      Convenience method
    • registerObject

      default <T> T registerObject(T object, String instance)
      Convenience method
    • registerObject

      <T> T registerObject(T object, InstanceIdentifier instance)
      Registers the given object and instance in the global object Registry
    • registerSettingsObject

      default void registerSettingsObject(Object settings)
      Convenience method
    • registerSettingsObject

      void registerSettingsObject(Object settings, InstanceIdentifier instance)
      Registers the given instance of the given settings object with the lookup registry for this component
    • registry

      default Registry registry()
      Returns:
      The lookup registry for this component
    • relativePackage

      default Package relativePackage(String path)
    • relativeResource

      default Resource relativeResource(String path)
    • require

      default <T> T require(Class<T> type)
      Convenience method
    • require

      default <T> T require(Class<T> type, Enum<?> instance)
      Convenience method
    • require

      default <T> T require(Class<T> type, String instance)
      Convenience method
    • require

      <T> T require(Class<T> type, InstanceIdentifier instance)
      Returns:
      The settings object of the given instance and type, or Ensure.fail() is called if there is no such object
    • settings

      default <T> T settings(Class<T> type)
      Convenience method
    • settings

      default <T> T settings(Class<T> type, Enum<?> instance)
      Convenience method
    • settings

      default <T> T settings(Class<T> type, String instance)
      Convenience method
    • settings

      <T> T settings(Class<T> type, InstanceIdentifier instance)
      Returns:
      The settings object of the given instance and type or null if there is no such object
    • settingsRegistry

      default Settings settingsRegistry()
      Returns:
      The settings registry for this component