Published: February, 15th 2008 HiveMind Utilities
General utility modules for HiveMind Logo

HiveEvents OCL

HiveEvents allows you to define Event filters through the use of a simple expression language, named "HiveEvents OCL" (Object Constraint Language).

Let's suppose that you have defined the following class as an event to be transmitted through an HiveEvents Channel:

public class MyEvent {
    public boolean  isBadEvent() {...}
    public int      getPriority() {...}

Now it is perfectly possible, using a ConstraintFilter, to define a filter based on the following expression:

event.badEvent || (event.priority >= 5 && event.priority < 10)

In the expression above, event is the name identifying whatever event is passed through the Channel (in our example, an instance of MyEvent). As long as your event class follows Java Beans conventions, then you can access any of its properties in the filter expression.

The following links describe the grammar of the HiveEvent OCL:

Lexical Tokens