Package com.apama.jmon
Class EventExpression
- java.lang.Object
-
- com.apama.jmon.EventExpression
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
PreparedEventExpression
public class EventExpression extends java.lang.Object implements java.io.SerializableInstances of this class are declared to represent an "Event Expression" as defined in the Apama reference manual "The JMON Application Framework".
An example expression is:
NewsItem("ACME", *):news -> StockTick("ACME", *)In this example the matching NewsItem event is tagged as 'news'. This means that the NewsItem event that caused the match will be available to theMatchListenerfrom the firedMatchEventby calling evt.getMatchingEvent("news");When the expression is matched, all registered listeners will be informed. An object implementing the
MatchListenerinterface may be registered by calling theaddMatchListenermethod, and deregistered by calling theremoveMatchListenermethod.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EventExpression(java.lang.String eventExpressionString)Constructor to create a new instance with the given immutable expression string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMatchListener(MatchListener listenerToAdd)Add a listener to be notified when the match occurs for this event expression.java.lang.StringgetEventExpressionString()Get the String value of the EventExpression.voidremoveAllMatchListeners()Remove all previously registered match listeners.voidremoveMatchListener(MatchListener listenerToRemove)Remove a match listener that was previously registered.java.lang.StringtoString()
-
-
-
Method Detail
-
getEventExpressionString
public java.lang.String getEventExpressionString()
Get the String value of the EventExpression.- Returns:
- value of the EventExpression
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
getEventExpressionString()
-
addMatchListener
public void addMatchListener(MatchListener listenerToAdd)
Add a listener to be notified when the match occurs for this event expression.- Parameters:
listenerToAdd- an object implementing the MatchListener interface to be notified when matches occur for this expression.
-
removeMatchListener
public void removeMatchListener(MatchListener listenerToRemove)
Remove a match listener that was previously registered.- Parameters:
listenerToRemove- an object implementing the MatchListener interface to be removed from the notification list for this expression.
-
removeAllMatchListeners
public void removeAllMatchListeners()
Remove all previously registered match listeners.
-
-