net.esper.core
Class UpdateDispatchViewBase

java.lang.Object
  extended by net.esper.view.ViewSupport
      extended by net.esper.core.UpdateDispatchViewBase
All Implemented Interfaces:
Iterable<EventBean>, Dispatchable, EventCollection, View, Viewable
Direct Known Subclasses:
UpdateDispatchViewBlockingSpin, UpdateDispatchViewBlockingWait, UpdateDispatchViewNonBlocking

public abstract class UpdateDispatchViewBase
extends ViewSupport
implements Dispatchable

Convenience view for dispatching view updates received from a parent view to update listeners via the dispatch service.


Field Summary
protected  DispatchService dispatchService
          Dispatches events to listeners.
protected  ThreadLocal<Boolean> isDispatchWaiting
          Flag to indicate we have registered a dispatch.
protected  EventBean lastIterableEvent
          For iteration with patterns.
protected  ThreadLocal<LinkedList<EventBean[]>> lastNewEvents
          Buffer for holding dispatchable events.
protected  ThreadLocal<LinkedList<EventBean[]>> lastOldEvents
          Buffer for holding dispatchable events.
 
Fields inherited from class net.esper.view.ViewSupport
parent
 
Constructor Summary
UpdateDispatchViewBase(EPServiceProvider epServiceProvider, EPStatement statement, EPStatementListenerSet updateListeners, DispatchService dispatchService)
          Ctor.
 
Method Summary
 void clear()
          Remove event reference to last event.
 void dispatchOnStop()
          Dispatches when the statement is stopped any remaining results.
 void execute()
          Execute dispatch.
 EventType getEventType()
          Provides metadata information about the type of object the event collection contains.
 Iterator<EventBean> iterator()
          Allows iteration through all elements in this event collection.
 void setUpdateListeners(EPStatementListenerSet updateListeners)
          Set new update listeners.
 
Methods inherited from class net.esper.view.ViewSupport
addView, dumpChildViews, dumpUpdateParams, findDescendent, getParent, getViews, hasViews, removeView, setParent, updateChildren, updateChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.esper.view.View
update
 

Field Detail

dispatchService

protected final DispatchService dispatchService
Dispatches events to listeners.


lastIterableEvent

protected EventBean lastIterableEvent
For iteration with patterns.


isDispatchWaiting

protected ThreadLocal<Boolean> isDispatchWaiting
Flag to indicate we have registered a dispatch.


lastNewEvents

protected ThreadLocal<LinkedList<EventBean[]>> lastNewEvents
Buffer for holding dispatchable events.


lastOldEvents

protected ThreadLocal<LinkedList<EventBean[]>> lastOldEvents
Buffer for holding dispatchable events.

Constructor Detail

UpdateDispatchViewBase

public UpdateDispatchViewBase(EPServiceProvider epServiceProvider,
                              EPStatement statement,
                              EPStatementListenerSet updateListeners,
                              DispatchService dispatchService)
Ctor.

Parameters:
epServiceProvider - - the engine instance to provided to statement-aware listener
updateListeners - - listeners to update
dispatchService - - for performing the dispatch
statement - is the statement to supply to statement-aware listener
Method Detail

setUpdateListeners

public void setUpdateListeners(EPStatementListenerSet updateListeners)
Set new update listeners.

Parameters:
updateListeners - to set

getEventType

public EventType getEventType()
Description copied from interface: EventCollection
Provides metadata information about the type of object the event collection contains.

Specified by:
getEventType in interface EventCollection
Returns:
metadata for the objects in the collection

iterator

public Iterator<EventBean> iterator()
Description copied from interface: EventCollection
Allows iteration through all elements in this event collection. The iterator will return the elements in the collection in their natural order, or, if there is no natural ordering, in some unpredictable order.

Specified by:
iterator in interface Iterable<EventBean>
Specified by:
iterator in interface EventCollection
Returns:
an iterator which will go through all current elements in the collection.

dispatchOnStop

public void dispatchOnStop()
Dispatches when the statement is stopped any remaining results.


execute

public void execute()
Description copied from interface: Dispatchable
Execute dispatch.

Specified by:
execute in interface Dispatchable

clear

public void clear()
Remove event reference to last event.


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