com.espertech.esper.view
Class ViewServiceImpl

java.lang.Object
  extended by com.espertech.esper.view.ViewServiceImpl
All Implemented Interfaces:
ViewService

public final class ViewServiceImpl
extends java.lang.Object
implements ViewService

Implementation of the view evaluation service business interface.


Constructor Summary
ViewServiceImpl()
          Ctor.
 
Method Summary
 ViewFactoryChain createFactories(int streamNum, EventType parentEventType, ViewSpec[] viewSpecDefinitions, StreamSpecOptions options, StatementContext context)
          Returns a chain of view factories that can be used to obtain the final event type, and that can later be used to actually create the chain of views or reuse existing views.
 ViewServiceCreateResult createViews(Viewable eventStreamViewable, java.util.List<ViewFactory> viewFactories, AgentInstanceViewFactoryChainContext viewFactoryChainContext, boolean hasPreviousNode)
          Creates the views given a chain of view factories.
 void remove(EventStream eventStream, Viewable viewToRemove)
          Removes a view discoupling the view and any of it's parent views up the tree to the last shared parent view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewServiceImpl

public ViewServiceImpl()
Ctor.

Method Detail

createFactories

public ViewFactoryChain createFactories(int streamNum,
                                        EventType parentEventType,
                                        ViewSpec[] viewSpecDefinitions,
                                        StreamSpecOptions options,
                                        StatementContext context)
                                 throws ViewProcessingException
Description copied from interface: ViewService
Returns a chain of view factories that can be used to obtain the final event type, and that can later be used to actually create the chain of views or reuse existing views.

Does not actually hook up the view factories or views against the event stream, but creates view factories and sets parameters on each view factory as supplied. Determines if view factories are compatible in the chain via the attach method.

Specified by:
createFactories in interface ViewService
Parameters:
streamNum - - the stream number starting at zero, a join would have N streams
parentEventType - - is the event type of the event stream that originates the raw events
viewSpecDefinitions - - the specification for each view factory in the chain to be created
options - - stream options such as unidirectional, retain-union etc
context - - dependent services
Returns:
chain of view factories
Throws:
ViewProcessingException - thrown if a view factory doesn't take parameters as supplied, or cannot hook onto it's parent view or event stream

createViews

public ViewServiceCreateResult createViews(Viewable eventStreamViewable,
                                           java.util.List<ViewFactory> viewFactories,
                                           AgentInstanceViewFactoryChainContext viewFactoryChainContext,
                                           boolean hasPreviousNode)
Description copied from interface: ViewService
Creates the views given a chain of view factories.

Attempts to reuse compatible views under then parent event stream viewable as indicated by each view factories reuse method.

Specified by:
createViews in interface ViewService
Parameters:
eventStreamViewable - is the event stream to hook into
viewFactories - defines the list of view factorys to call makeView or canReuse on
viewFactoryChainContext - provides services
Returns:
last viewable in chain, or the eventStreamViewable if no view factories are supplied

remove

public void remove(EventStream eventStream,
                   Viewable viewToRemove)
Description copied from interface: ViewService
Removes a view discoupling the view and any of it's parent views up the tree to the last shared parent view.

Specified by:
remove in interface ViewService
Parameters:
eventStream - - the event stream that originates the raw events
viewToRemove - - the view (should be the last in a chain) to remove

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