Package org.openhab.core.thing.binding
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 TypeMethodDescriptiondefault void
activate()
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
dispose()
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 calleddefault void
This method is used by the framework during activation of the service.void
setThingHandler
(ThingHandler handler) Sets the ThingHandler on which the actions (methods) should be called
-
Method Details
-
setThingHandler
Sets the ThingHandler on which the actions (methods) should be called- Parameters:
handler
- theThingHandler
-
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. Seeinitialize()
,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. Seedispose()
,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 callsuper.initialize()
to ensure background discovery is properly handled. Seeactivate()
,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 callsuper.dispose()
to ensure background discovery is properly handled. Seedeactivate()
,initialize()
-