i3.dragos.core.services.events
Class EventDetector

java.lang.Object
  extended by i3.dragos.core.services.events.EventDetector
Direct Known Subclasses:
DataEventDetector

public class EventDetector
extends java.lang.Object

A simple 2-state automaton that waits for a specified event. It is mainly used for testing, and was included here instead of the testcases directory so that it can also be used by dragos-system-testsuite.

Author:
Thorsten Hermes <thermes@i3.informatik.rwth-aachen.de>

Constructor Summary
EventDetector(EventFilter filter)
          Creates an EventDetector.
 
Method Summary
 void check(DragosEvent event)
          Checks the supplied event.
 EventFilter getFilter()
          Returns the EventFilter that determines acceptance of events.
 boolean hasDetected()
          Returns true if the specified event was detected, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventDetector

public EventDetector(EventFilter filter)
Creates an EventDetector.

Parameters:
filter - A filter that determines which events should be detected.
Method Detail

check

public void check(DragosEvent event)
           throws DragosException
Checks the supplied event. If it is accepted by the filter, this detector enters the accepting state, from which there is no return.

Parameters:
event - The event to check.
Throws:
DragosException - in case of errors.

hasDetected

public boolean hasDetected()
Returns true if the specified event was detected, false otherwise.

Returns:
true if the specified event was detected, false otherwise.

getFilter

public EventFilter getFilter()
Returns the EventFilter that determines acceptance of events.

Returns:
the EventFilter that determines acceptance of events.


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.