Search in sources :

Example 1 with EventFactory

use of org.eclipse.smarthome.core.events.EventFactory in project smarthome by eclipse.

the class EventHandler method handleEvent.

private void handleEvent(final String type, final String payload, final String topic, @Nullable final String source) {
    final EventFactory eventFactory = typedEventFactories.get(type);
    if (eventFactory == null) {
        logger.debug("Could not find an Event Factory for the event type '{}'.", type);
        return;
    }
    final Set<EventSubscriber> eventSubscribers = getEventSubscribers(type);
    if (eventSubscribers.isEmpty()) {
        return;
    }
    final Event eshEvent = createESHEvent(eventFactory, type, payload, topic, source);
    if (eshEvent == null) {
        return;
    }
    dispatchESHEvent(eventSubscribers, eshEvent);
}
Also used : EventSubscriber(org.eclipse.smarthome.core.events.EventSubscriber) EventFactory(org.eclipse.smarthome.core.events.EventFactory) Event(org.eclipse.smarthome.core.events.Event)

Aggregations

Event (org.eclipse.smarthome.core.events.Event)1 EventFactory (org.eclipse.smarthome.core.events.EventFactory)1 EventSubscriber (org.eclipse.smarthome.core.events.EventSubscriber)1