Package org.openhab.core.thing.binding
Class AbstractDynamicDescriptionProvider
java.lang.Object
org.openhab.core.thing.binding.AbstractDynamicDescriptionProvider
- Direct Known Subclasses:
BaseDynamicCommandDescriptionProvider
,BaseDynamicStateDescriptionProvider
The
AbstractDynamicDescriptionProvider
provides a base implementation for dynamic description providers.
It holds a reference to the ChannelTypeI18nLocalizationService
to provide localized descriptions. Therefore
the inheriting class has to request a reference for the ChannelTypeI18nLocalizationService
on its own.
It posts ChannelDescriptionChangedEvent
s through the openHAB events bus about a changed dynamic description.
Therefore the subclass has to request references for the EventPublisher
and
ItemChannelLinkRegistry
.
- Author:
- Christoph Weitkamp - Initial contribution
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.osgi.framework.BundleContext
protected @Nullable ChannelTypeI18nLocalizationService
protected @Nullable EventPublisher
protected @Nullable ItemChannelLinkRegistry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
activate
(org.osgi.service.component.ComponentContext componentContext) void
protected void
This method can be used in a subclass in order to post events through the openHAB events bus.
-
Field Details
-
bundleContext
@NonNullByDefault({}) protected org.osgi.framework.BundleContext bundleContext -
eventPublisher
-
channelTypeI18nLocalizationService
-
itemChannelLinkRegistry
-
-
Constructor Details
-
AbstractDynamicDescriptionProvider
public AbstractDynamicDescriptionProvider()
-
-
Method Details
-
postEvent
This method can be used in a subclass in order to post events through the openHAB events bus. A common use case is to notify event subscribers about a changed dynamic description.- Parameters:
event
- theEvent
-
activate
protected void activate(org.osgi.service.component.ComponentContext componentContext) -
deactivate
public void deactivate()
-