net.esper.pattern.guard
Class TimerWithinGuard

java.lang.Object
  extended by net.esper.pattern.guard.TimerWithinGuard
All Implemented Interfaces:
Guard, ScheduleHandleCallback

public class TimerWithinGuard
extends Object
implements Guard, ScheduleHandleCallback

Guard implementation that keeps a timer instance and quits when the timer expired, letting all MatchedEventMap instances pass until then.


Constructor Summary
TimerWithinGuard(long msec, PatternContext context, Quitable quitable)
          Ctor.
 
Method Summary
 boolean inspect(MatchedEventMap matchEvent)
          Returns true if inspection shows that the match events can pass, or false to not pass.
 void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
          Callback that is invoked as indicated by a schedule added to the scheduling service.
 void startGuard()
          Start the guard operation.
 void stopGuard()
          Called when sub-expression quits, or when the pattern stopped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerWithinGuard

public TimerWithinGuard(long msec,
                        PatternContext context,
                        Quitable quitable)
Ctor.

Parameters:
msec - - number of millisecond to guard expiration
context - - contains timer service
quitable - - to use to indicate that the gaurd quitted
Method Detail

startGuard

public void startGuard()
Description copied from interface: Guard
Start the guard operation.

Specified by:
startGuard in interface Guard

stopGuard

public void stopGuard()
Description copied from interface: Guard
Called when sub-expression quits, or when the pattern stopped.

Specified by:
stopGuard in interface Guard

inspect

public boolean inspect(MatchedEventMap matchEvent)
Description copied from interface: Guard
Returns true if inspection shows that the match events can pass, or false to not pass.

Specified by:
inspect in interface Guard
Parameters:
matchEvent - is the map of matching events
Returns:
true to pass, false to not pass

scheduledTrigger

public final void scheduledTrigger(ExtensionServicesContext extensionServicesContext)
Description copied from interface: ScheduleHandleCallback
Callback that is invoked as indicated by a schedule added to the scheduling service.

Specified by:
scheduledTrigger in interface ScheduleHandleCallback
Parameters:
extensionServicesContext - is a marker interface for providing custom extension services passed to the triggered class

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