Interface ThingHandlerService

All Known Subinterfaces:
ThingActions
All Known Implementing Classes:
AbstractThingHandlerDiscoveryService

@NonNullByDefault public interface ThingHandlerService
Interface for a service that provides access to a ThingHandler.
Author:
Stefan Triller - Initial contribution
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    This method is used by the framework during activation of the OSGi component.
    default void
    This method is used by the framework during de-activation of the OSGi component.
    default void
    This method is used by the framework during de-activation of the service.
    @Nullable ThingHandler
    Gets the ThingHandler on which the actions (methods) should be called
    default void
    This method is used by the framework during activation of the service.
    void
    Sets the ThingHandler on which the actions (methods) should be called
  • Method Details

    • setThingHandler

      void setThingHandler(ThingHandler handler)
      Sets the ThingHandler on which the actions (methods) should be called
      Parameters:
      handler - the ThingHandler
    • getThingHandler

      @Nullable ThingHandler getThingHandler()
      Gets the ThingHandler on which the actions (methods) should be called
      Returns:
      the ThingHandler
    • activate

      default void activate()
      This method is used by the framework during activation of the OSGi component. It is called BEFORE the thing handler is set. See initialize(), deactivate()
    • deactivate

      default void deactivate()
      This method is used by the framework during de-activation of the OSGi component. It is NOT guaranteed that the thing handler is still valid. See dispose(), activate()
    • initialize

      default void initialize()
      This method is used by the framework during activation of the service. It is called AFTER the component is fully activated and thing handler has been set. Implementations should override this method to add additional initialization code. This method should call super.initialize() to ensure background discovery is properly handled. See activate(), dispose()
    • dispose

      default void dispose()
      This method is used by the framework during de-activation of the service. It is called while the component is still activated. Code depending on an activated service should go here. This method should call super.dispose() to ensure background discovery is properly handled. See deactivate(), initialize()