net.esper.emit
Interface EmitService

All Known Implementing Classes:
EmitServiceImpl

public interface EmitService

The emit service is a simple publish-subscribe mechanism for sending events out of the runtime to emitted event listeners that registered interest in the same or default channel that an event was emitted to.


Method Summary
 void addListener(EmittedListener listener, String channel)
          Add emitted event listener for the specified channel, or the default channel if the channel value is null.
 void clearListeners()
          Removes all listeners for emitted events.
 void emitEvent(Object object, String channel)
          Emit an event to the specified channel.
 int getNumEventsEmitted()
          Number of events emitted.
 

Method Detail

emitEvent

void emitEvent(Object object,
               String channel)
Emit an event to the specified channel. All listeners listening to the exact same channel and all listeners listening to the default channel are handed the event emitted.

Parameters:
object - is the event to emit
channel - is the channel to emit to

addListener

void addListener(EmittedListener listener,
                 String channel)
Add emitted event listener for the specified channel, or the default channel if the channel value is null. The listener will be invoked when an event is emitted on the subscribed channel. Listeners subscribed to the default channel are invoked for all emitted events regardless of what channel the event is emitted onto.

Parameters:
listener - is the callback to receive when events are emitted
channel - is the channel to listen to, with null values allowed to indicate the default channel

clearListeners

void clearListeners()
Removes all listeners for emitted events.


getNumEventsEmitted

int getNumEventsEmitted()
Number of events emitted.

Returns:
total of events emitted

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com