net.esper.emit
Class EmitServiceImpl

java.lang.Object
  extended by net.esper.emit.EmitServiceImpl
All Implemented Interfaces:
EmitService

public final class EmitServiceImpl
extends Object
implements EmitService

Implementation of the event emit service.


Constructor Summary
protected EmitServiceImpl()
          Constructor.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmitServiceImpl

protected EmitServiceImpl()
Constructor.

Method Detail

addListener

public final void addListener(EmittedListener listener,
                              String channel)
Description copied from interface: EmitService
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.

Specified by:
addListener in interface EmitService
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

public final void clearListeners()
Description copied from interface: EmitService
Removes all listeners for emitted events.

Specified by:
clearListeners in interface EmitService

emitEvent

public final void emitEvent(Object object,
                            String channel)
Description copied from interface: EmitService
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.

Specified by:
emitEvent in interface EmitService
Parameters:
object - is the event to emit
channel - is the channel to emit to

getNumEventsEmitted

public final int getNumEventsEmitted()
Description copied from interface: EmitService
Number of events emitted.

Specified by:
getNumEventsEmitted in interface EmitService
Returns:
total of events emitted

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