jess
Class JessEventAdapter

java.lang.Object
  extended byjess.JessEventAdapter
All Implemented Interfaces:
java.util.EventListener, JessListener

public class JessEventAdapter
extends java.lang.Object
implements JessListener

A JessEventAdapter that lets you write JessEvent handlers in the Jess language. The adapter serves as "glue" between a source of JessEvents and a Userfunction that will be invoked when an event is received.

(C) 2006 Sandia National Laboratories


Constructor Summary
JessEventAdapter(java.lang.String uf, Rete engine)
          Create an adapter.
 
Method Summary
 void eventHappened(JessEvent e)
          Called when a JessEvent occurs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JessEventAdapter

public JessEventAdapter(java.lang.String uf,
                        Rete engine)
                 throws JessException
Create an adapter. Normally you'll call this from Jess code using reflection. The first argument is the name of a function to call when a JessEvent occurs; The second is the engine to attach to

Parameters:
uf - The name of a Jess function
engine - The engine to field events from
Throws:
JessException - If anything goes wrong.
Method Detail

eventHappened

public final void eventHappened(JessEvent e)
Called when a JessEvent occurs. The function specified in the constructor is called, with the event object as the only argument. The function can examine the event using reflection.

Specified by:
eventHappened in interface JessListener
Parameters:
e - The event

© 2007 Sandia Corporation