net.esper.view
Class ViewServiceImpl

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

public final class ViewServiceImpl
extends Object
implements ViewService

Implementation of the view evaluation service business interface.


Constructor Summary
ViewServiceImpl()
          Ctor.
 
Method Summary
 ViewFactoryChain createFactories(EventType parentEventType, List<ViewSpec> viewSpecDefinitions, ViewServiceContext 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.
 Viewable createViews(Viewable eventStreamViewable, List<ViewFactory> viewFactories, ViewServiceContext context)
          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(EventType parentEventType,
                                        List<ViewSpec> viewSpecDefinitions,
                                        ViewServiceContext 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:
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
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 Viewable createViews(Viewable eventStreamViewable,
                            List<ViewFactory> viewFactories,
                            ViewServiceContext context)
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
context - 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