net.esper.view.stream
Class StreamReuseServiceImpl

java.lang.Object
  extended by net.esper.view.stream.StreamReuseServiceImpl
All Implemented Interfaces:
StreamReuseService

public class StreamReuseServiceImpl
extends Object
implements StreamReuseService

Service implementation to reuse event streams and existing filters using reference counting to remove filters when not used.


Constructor Summary
StreamReuseServiceImpl()
          Ctor.
 
Method Summary
 EventStream createStream(FilterSpec filterSpec, FilterService filterService)
          Create or reuse existing EventStream instance representing that event filter.
 void dropStream(FilterSpec filterSpec, FilterService filterService)
          Drop the event stream associated with the filter passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamReuseServiceImpl

public StreamReuseServiceImpl()
Ctor.

Method Detail

createStream

public EventStream createStream(FilterSpec filterSpec,
                                FilterService filterService)
Description copied from interface: StreamReuseService
Create or reuse existing EventStream instance representing that event filter. When called for some filters, should return same stream.

Specified by:
createStream in interface StreamReuseService
Parameters:
filterSpec - event filter definition
filterService - filter service to activate filter if not already active
Returns:
event stream representing active filter

dropStream

public void dropStream(FilterSpec filterSpec,
                       FilterService filterService)
Description copied from interface: StreamReuseService
Drop the event stream associated with the filter passed in. Throws an exception if already dropped.

Specified by:
dropStream in interface StreamReuseService
Parameters:
filterSpec - is the event filter definition associated with the event stream to be dropped
filterService - to be used to deactivate filter when the last event stream is dropped