Bridge Handler Implementation
BridgeHandler handles the communication between the Eclipse SmartHome framework and a bridge (a device that acts as a gateway to enable the communication with other devices) represented by a
A bridge handler has the same properties as thing handler. Therefore, the
BridgeHandler interface extends the
Eclipse SmartHome provides an abstract implementation of the
BridgeHandler interface named
BaseBridgeHandler. It is recommended to use this class, because it covers a lot of common logic.
BridgeHandler has the same life cycle than a
ThingHandler (created by a
ThingHandlerFactory, well defined life cycle by handler methods
dispose(), see chapter Life Cycle). A bridge acts as a gateway in order to provide access to other devices, the child things. Hence, the life cycle of a child handler depends on the life cycle of a bridge handler. Bridge and child handlers are subject to the following restrictions:
BridgeHandlerof a bridge is initialized before
ThingHandlers of its child things are initialized.
BridgeHandleris disposed after all
ThingHandlers of its child things are disposed.
Handler initialization notification
BridgeHandler is notified about the initialization and disposal of child things. Therefore, the
BridgeHandler interface provides the two methods
childHandlerInitialized(ThingHandler, Thing) and
These methods can be used to allocate and deallocate resources for child things.