net.esper.view.stream
Class StreamFactorySvcImpl

java.lang.Object
  extended by net.esper.view.stream.StreamFactorySvcImpl
All Implemented Interfaces:
StreamFactoryService

public class StreamFactorySvcImpl
extends Object
implements StreamFactoryService

Service implementation to reuse or not reuse event streams and existing filters depending on the type of statement.

Works together with StreamFactorySvcReuse for the reuse of event streams when filters match, and thus when an event stream is reused such can be the views under the stream. For joins however, this can lead to problems in multithread-safety since the statement resource lock would then have to be multiple locks, i.e. the reused statement's resource lock and the join statement's own lock, at a minimum.

Works together with StreamFactorySvcCreate for always creating a new event stream and therefore not reusing view resources, for use with joins.


Constructor Summary
StreamFactorySvcImpl()
          Ctor.
 
Method Summary
 EventStream createStream(FilterSpec filterSpec, FilterService filterService, EPStatementHandle epStatementHandle, boolean isJoin)
          Create or reuse existing EventStream instance representing that event filter.
 void dropStream(FilterSpec filterSpec, FilterService filterService, boolean isJoin)
          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

StreamFactorySvcImpl

public StreamFactorySvcImpl()
Ctor.

Method Detail

createStream

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

Specified by:
createStream in interface StreamFactoryService
Parameters:
filterSpec - event filter definition
filterService - filter service to activate filter if not already active
epStatementHandle - is the statements-own handle for use in registering callbacks with services
isJoin - is indicatng whether the stream will participate in a join statement, information necessary for stream reuse and multithreading concerns
Returns:
event stream representing active filter

dropStream

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

Specified by:
dropStream in interface StreamFactoryService
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
isJoin - is indicatng whether the stream will participate in a join statement, information necessary for stream reuse and multithreading concerns