com.espertech.esper.epl.named
Class NamedWindowMgmtServiceImpl

java.lang.Object
  extended by com.espertech.esper.epl.named.NamedWindowMgmtServiceImpl
All Implemented Interfaces:
NamedWindowMgmtService

public class NamedWindowMgmtServiceImpl
extends java.lang.Object
implements NamedWindowMgmtService

This service hold for each named window a dedicated processor and a lock to the named window. This lock is shrared between the named window and on-delete statements.


Field Summary
 
Fields inherited from interface com.espertech.esper.epl.named.NamedWindowMgmtService
ERROR_MSG_DATAWINDOWS, ERROR_MSG_NO_DATAWINDOW_ALLOWED
 
Constructor Summary
NamedWindowMgmtServiceImpl(boolean enableQueryPlanLog, MetricReportingService metricReportingService)
          Ctor.
 
Method Summary
 void addNamedWindowLock(java.lang.String windowName, StatementAgentInstanceLock statementResourceLock, java.lang.String statementName)
          Sets the lock to use for a named window.
 void addObserver(NamedWindowLifecycleObserver observer)
          Add an observer to be called back when named window state changes occur.
 NamedWindowProcessor addProcessor(java.lang.String name, java.lang.String contextName, EventType eventType, StatementResultService statementResultService, ValueAddEventProcessor revisionProcessor, java.lang.String eplExpression, java.lang.String statementName, boolean isPrioritized, boolean isEnableSubqueryIndexShare, boolean isBatchingDataWindow, boolean isVirtualDataWindow, java.util.Set<java.lang.String> optionalUniqueKeyProps, java.lang.String eventTypeAsName, StatementContext statementContextCreateWindow, NamedWindowDispatchService namedWindowDispatchService)
          Create a new named window.
 void destroy()
          Clear out the service.
 IndexMultiKey[] getNamedWindowIndexes(java.lang.String windowName)
          Returns an index descriptor array describing all available indexes for the named window.
 StatementAgentInstanceLock getNamedWindowLock(java.lang.String windowName)
          Returns the statement lock for the named window, to be shared with on-delete statements for the same named window.
 java.lang.String[] getNamedWindows()
          Returns the names of all named windows known.
 NamedWindowProcessor getProcessor(java.lang.String name)
          Returns the processing instance for a given named window.
 boolean isNamedWindow(java.lang.String name)
          Returns true to indicate that the name is a named window.
 void removeNamedWindowIfFound(java.lang.String namedWindowName)
          Remove the named window instance(s), when found
 void removeNamedWindowLock(java.lang.String statementName)
          Remove the lock associated to the named window.
 void removeObserver(NamedWindowLifecycleObserver observer)
          Remove an observer to be called back when named window state changes occur.
 void removeProcessor(java.lang.String name)
          Upon destroy of the named window creation statement, the named window processor must be removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedWindowMgmtServiceImpl

public NamedWindowMgmtServiceImpl(boolean enableQueryPlanLog,
                                  MetricReportingService metricReportingService)
Ctor.

Method Detail

destroy

public void destroy()
Description copied from interface: NamedWindowMgmtService
Clear out the service.

Specified by:
destroy in interface NamedWindowMgmtService

getNamedWindows

public java.lang.String[] getNamedWindows()
Description copied from interface: NamedWindowMgmtService
Returns the names of all named windows known.

Specified by:
getNamedWindows in interface NamedWindowMgmtService
Returns:
named window names

getNamedWindowLock

public StatementAgentInstanceLock getNamedWindowLock(java.lang.String windowName)
Description copied from interface: NamedWindowMgmtService
Returns the statement lock for the named window, to be shared with on-delete statements for the same named window.

Specified by:
getNamedWindowLock in interface NamedWindowMgmtService
Parameters:
windowName - is the window name
Returns:
the lock for the named window, or null if the window dos not yet exists

addNamedWindowLock

public void addNamedWindowLock(java.lang.String windowName,
                               StatementAgentInstanceLock statementResourceLock,
                               java.lang.String statementName)
Description copied from interface: NamedWindowMgmtService
Sets the lock to use for a named window.

Specified by:
addNamedWindowLock in interface NamedWindowMgmtService
Parameters:
windowName - is the named window name
statementResourceLock - is the statement lock for the create window statement
statementName - the name of the statement that is the "create window"

removeNamedWindowLock

public void removeNamedWindowLock(java.lang.String statementName)
Description copied from interface: NamedWindowMgmtService
Remove the lock associated to the named window.

Specified by:
removeNamedWindowLock in interface NamedWindowMgmtService
Parameters:
statementName - the name of the statement that is the "create window"

isNamedWindow

public boolean isNamedWindow(java.lang.String name)
Description copied from interface: NamedWindowMgmtService
Returns true to indicate that the name is a named window.

Specified by:
isNamedWindow in interface NamedWindowMgmtService
Parameters:
name - is the window name
Returns:
true if a named window, false if not a named window

getProcessor

public NamedWindowProcessor getProcessor(java.lang.String name)
Description copied from interface: NamedWindowMgmtService
Returns the processing instance for a given named window.

Specified by:
getProcessor in interface NamedWindowMgmtService
Parameters:
name - window name
Returns:
processor for the named window

getNamedWindowIndexes

public IndexMultiKey[] getNamedWindowIndexes(java.lang.String windowName)
Description copied from interface: NamedWindowMgmtService
Returns an index descriptor array describing all available indexes for the named window.

Specified by:
getNamedWindowIndexes in interface NamedWindowMgmtService
Parameters:
windowName - window name
Returns:
indexes

removeNamedWindowIfFound

public void removeNamedWindowIfFound(java.lang.String namedWindowName)
Description copied from interface: NamedWindowMgmtService
Remove the named window instance(s), when found

Specified by:
removeNamedWindowIfFound in interface NamedWindowMgmtService
Parameters:
namedWindowName - to remove

addProcessor

public NamedWindowProcessor addProcessor(java.lang.String name,
                                         java.lang.String contextName,
                                         EventType eventType,
                                         StatementResultService statementResultService,
                                         ValueAddEventProcessor revisionProcessor,
                                         java.lang.String eplExpression,
                                         java.lang.String statementName,
                                         boolean isPrioritized,
                                         boolean isEnableSubqueryIndexShare,
                                         boolean isBatchingDataWindow,
                                         boolean isVirtualDataWindow,
                                         java.util.Set<java.lang.String> optionalUniqueKeyProps,
                                         java.lang.String eventTypeAsName,
                                         StatementContext statementContextCreateWindow,
                                         NamedWindowDispatchService namedWindowDispatchService)
                                  throws ViewProcessingException
Description copied from interface: NamedWindowMgmtService
Create a new named window.

Specified by:
addProcessor in interface NamedWindowMgmtService
Parameters:
name - window name
eventType - the event type of the window
statementResultService - for coordinating on whether insert and remove stream events should be posted
revisionProcessor - handles update events
eplExpression - is the expression
statementName - the name of the statement
isPrioritized - if the engine is running with prioritized execution
Returns:
processor for the named window
Throws:
ViewProcessingException - if the named window already exists

removeProcessor

public void removeProcessor(java.lang.String name)
Description copied from interface: NamedWindowMgmtService
Upon destroy of the named window creation statement, the named window processor must be removed.

Specified by:
removeProcessor in interface NamedWindowMgmtService
Parameters:
name - is the named window name

addObserver

public void addObserver(NamedWindowLifecycleObserver observer)
Description copied from interface: NamedWindowMgmtService
Add an observer to be called back when named window state changes occur.

Observers have set-semantics: the same Observer cannot be added twice

Specified by:
addObserver in interface NamedWindowMgmtService
Parameters:
observer - to add

removeObserver

public void removeObserver(NamedWindowLifecycleObserver observer)
Description copied from interface: NamedWindowMgmtService
Remove an observer to be called back when named window state changes occur.

Specified by:
removeObserver in interface NamedWindowMgmtService
Parameters:
observer - to remove

© 2006-2016 EsperTech Inc.
All rights reserved.
Visit us at espertech.com