com.espertech.esper.epl.named
Interface NamedWindowService

All Known Implementing Classes:
NamedWindowServiceImpl

public interface NamedWindowService

Service to manage named window dispatches, locks and processors on an engine level.


Field Summary
static String ERROR_MSG_DATAWINDOWS
          Error message for data windows required.
static String ERROR_MSG_NO_DATAWINDOW_ALLOWED
          Error message for no data window allowed.
 
Method Summary
 void addDispatch(NamedWindowDeltaData delta, Map<EPStatementHandle,List<NamedWindowConsumerView>> consumers)
          For use to add a result of a named window that must be dispatched to consuming views.
 void addNamedWindowLock(String windowName, ManagedLock statementResourceLock)
          Sets the lock to use for a named window.
 NamedWindowProcessor addProcessor(String name, EventType eventType, EPStatementHandle createWindowStmtHandle, StatementResultService statementResultService)
          Create a new named window.
 void destroy()
          Clear out the service.
 boolean dispatch()
          Dispatch events of the insert and remove stream of named windows to consumers, as part of the main event processing or dispatch loop.
 ManagedLock getNamedWindowLock(String windowName)
          Returns the statement lock for the named window, to be shared with on-delete statements for the same named window.
 NamedWindowProcessor getProcessor(String name)
          Returns the processing instance for a given named window.
 boolean isNamedWindow(String name)
          Returns true to indicate that the name is a named window.
 void removeProcessor(String name)
          Upon destroy of the named window creation statement, the named window processor must be removed.
 

Field Detail

ERROR_MSG_DATAWINDOWS

static final String ERROR_MSG_DATAWINDOWS
Error message for data windows required.

See Also:
Constant Field Values

ERROR_MSG_NO_DATAWINDOW_ALLOWED

static final String ERROR_MSG_NO_DATAWINDOW_ALLOWED
Error message for no data window allowed.

See Also:
Constant Field Values
Method Detail

isNamedWindow

boolean isNamedWindow(String name)
Returns true to indicate that the name is a named window.

Parameters:
name - is the window name
Returns:
true if a named window, false if not a named window

addProcessor

NamedWindowProcessor addProcessor(String name,
                                  EventType eventType,
                                  EPStatementHandle createWindowStmtHandle,
                                  StatementResultService statementResultService)
                                  throws ViewProcessingException
Create a new named window.

Parameters:
name - window name
eventType - the event type of the window
createWindowStmtHandle - is the handle and lock of the create-named-window statement
statementResultService - for coordinating on whether insert and remove stream events should be posted
Returns:
processor for the named window
Throws:
ViewProcessingException - if the named window already exists

getProcessor

NamedWindowProcessor getProcessor(String name)
Returns the processing instance for a given named window.

Parameters:
name - window name
Returns:
processor for the named window

removeProcessor

void removeProcessor(String name)
Upon destroy of the named window creation statement, the named window processor must be removed.

Parameters:
name - is the named window name

dispatch

boolean dispatch()
Dispatch events of the insert and remove stream of named windows to consumers, as part of the main event processing or dispatch loop.

Returns:
send events to consuming statements

addDispatch

void addDispatch(NamedWindowDeltaData delta,
                 Map<EPStatementHandle,List<NamedWindowConsumerView>> consumers)
For use to add a result of a named window that must be dispatched to consuming views.

Parameters:
delta - is the result to dispatch
consumers - is the destination of the dispatch, a map of statements to one or more consuming views

getNamedWindowLock

ManagedLock getNamedWindowLock(String windowName)
Returns the statement lock for the named window, to be shared with on-delete statements for the same named window.

Parameters:
windowName - is the window name
Returns:
the lock for the named window, or null if the window dos not yet exists

addNamedWindowLock

void addNamedWindowLock(String windowName,
                        ManagedLock statementResourceLock)
Sets the lock to use for a named window.

Parameters:
windowName - is the named window name
statementResourceLock - is the statement lock for the create window statement

destroy

void destroy()
Clear out the service.


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