com.espertech.esper.emit
Class EmitServiceImpl

java.lang.Object
  extended by com.espertech.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.
 long getNumEventsEmitted()
          Number of events emitted.
 void resetStats()
          Resets the 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 long getNumEventsEmitted()
Description copied from interface: EmitService
Number of events emitted.

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

resetStats

public void resetStats()
Description copied from interface: EmitService
Resets the number of events emitted

Specified by:
resetStats in interface EmitService

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