def dispose(self):
     LOG.warn("Disposing '{}' (module '{}')".format(
         self, self.trigger.id))
     self.factory.handlers.remove(self)
     OsgiEventAdmin.remove_listener(self.on_event)
     if self.trigger.id in OSGI_TRIGGERS:
         del OSGI_TRIGGERS[self.trigger.id]
Exemple #2
0
def scriptUnloaded():
    if hasattr(core, "esper") and core.esper:
        core.esper.destroy()
        core.esper = None
        log.info("Destroyed Esper provider")
        OsgiEventAdmin.remove_listener(esper_bridge)
        log.info("Esper event bridge removed")
Exemple #3
0
    def get(self, trigger):
        LOG.warn("get")
        handler = OsgiEventTriggerHandlerFactory.Handler(self, trigger)
        #handler = self.Handler(self, trigger)

        self.handlers.append(handler)
        OsgiEventAdmin.add_listener(handler.on_event)
        return handler
Exemple #4
0
def scriptLoaded(*args):
    global runtime
    configuration = Configuration()
    configuration.addEventType("ItemStateEvent", item_state_schema)
    configuration.addEventType("ItemStateChangedEvent", item_state_schema)
    configuration.addEventType("ItemCommandEvent", item_command_schema)
    configuration.addEventType("ChannelEvent", channel_event_schema)
    core.esper = EPServiceProviderManager.getProvider("engine", configuration)
    runtime = core.esper.getEPRuntime()
    log.info("Created Esper provider")
    OsgiEventAdmin.add_listener(esper_bridge)
    log.info("Esper event bridge registered")
def scriptUnloaded():
    OsgiEventAdmin.remove_listener(handle_event)
def scriptLoaded(*args):
    try:
        OsgiEventAdmin.add_listener(handle_event)
    except:
        import traceback
        print traceback.format_exc()
Exemple #7
0
 def get(self, trigger):
     handler = OsgiEventTriggerHandlerFactory.Handler(trigger)
     self.handlers.append(handler)
     OsgiEventAdmin.add_listener(handler.on_event)
     return handler
Exemple #8
0
 def dispose(self):
     log.debug("Disposing {} (module {})".format(self, self.trigger.id))
     self.factory.handlers.remove(self)
     OsgiEventAdmin.remove_listener(self.on_event)
     if self.trigger.id in osgi_triggers:
         del (osgi_triggers[self.trigger.id])