at.ac.tuwien.infosys.sm4all.copal.esper.internal
Class EsperEngine

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.esper.internal.EsperEngine
All Implemented Interfaces:
ContextQueryRegistry, EventSystem, EventTypeRegistry, PublishingService

public class EsperEngine
extends Object
implements PublishingService, EventSystem, EventTypeRegistry, ContextQueryRegistry

Implementation of the EventTypeRegistry, PublishingService, and ContextQueryRegistry interfaces which uses Esper as actual event system. These interfaces are used by COPAL core services.

Author:
fei, sanjin

Constructor Summary
EsperEngine()
          Creates instance that uses Esper provider with EsperService name.
 
Method Summary
 void publish(ContextEvent event)
          Publish ContextEvents.
 boolean register(ContextQuery query)
          Register ContextQuery with event system.
 boolean register(XMLContextEventType eventType)
          Register specified XMLContextEventType.
 void setUnmatchedEventListener(ContextListener listener)
          Sets specified context listener to receive events that were not matched by any query.
 void shutdown()
          Unregister all context listeners and all context event types.
 boolean unregister(ContextQuery query)
          Unregister ContextQuery from event system.
 boolean unregister(String eventName)
          Unregister a XMLContextEventType with specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EsperEngine

public EsperEngine()
Creates instance that uses Esper provider with EsperService name.

Method Detail

publish

public void publish(ContextEvent event)
             throws ContextException
Description copied from interface: PublishingService
Publish ContextEvents.

Specified by:
publish in interface PublishingService
Parameters:
event - the event.
Throws:
ContextException - if publishing was unsuccessful.

setUnmatchedEventListener

public void setUnmatchedEventListener(ContextListener listener)
Description copied from interface: EventSystem
Sets specified context listener to receive events that were not matched by any query.

Specified by:
setUnmatchedEventListener in interface EventSystem
Parameters:
listener - the context lister for unmatched events.

register

public boolean register(ContextQuery query)
Description copied from interface: ContextQueryRegistry
Register ContextQuery with event system.

Specified by:
register in interface ContextQueryRegistry
Parameters:
query - the context query.
Returns:
true> if registering was successful; false otherwise.

unregister

public boolean unregister(ContextQuery query)
Description copied from interface: ContextQueryRegistry
Unregister ContextQuery from event system.

Specified by:
unregister in interface ContextQueryRegistry
Parameters:
query - the context query.
Returns:
true> if unregistering was successful; false otherwise.

register

public boolean register(XMLContextEventType eventType)
Description copied from interface: EventTypeRegistry
Register specified XMLContextEventType.

Specified by:
register in interface EventTypeRegistry
Parameters:
eventType - the XMLContextEventType.
Returns:
true> if registration was successful; false otherwise.

unregister

public boolean unregister(String eventName)
Description copied from interface: EventTypeRegistry
Unregister a XMLContextEventType with specified name.

Specified by:
unregister in interface EventTypeRegistry
Parameters:
eventName - the name of the XMLContextEventType.
Returns:
true> if unregistration was successful; false otherwise.

shutdown

public void shutdown()
Unregister all context listeners and all context event types.



Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.