|
Valescom Java API | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--com.valescom.support.event.java.EventHandler
Events based on a Subscription.
Event matching
the Subscription is published.
// remote event handler
EventHandler myHandler1 = new EventHandler(new Expression(
  "class = 'com.valescom.support.event.java.RemoteEvent'"),
  true)
{
  public final void
  handle(Event anEvent)
  {
  // do something
  }
};
myHandler1.start();
// local event handler
Event myEvent = new LocalEvent();
EventHandler myHandler2 = new EventHandler(myEvent)
// myEvent categories are used as a subscription
{
  public final void
  handle(Event anEvent)
  {
  // do something
  }
};
myHandler2.start();
Handler,
EventManager

| Constructor Summary | |
|---|---|
protected |
EventHandler(Event anEvent)
Construct an EventHandler instance for anEvent Pre conditions: anEvent may not be null. |
protected |
EventHandler(Subscription aSubscription)
Construct a EventHandler instance for aSubscription. |
protected |
EventHandler(Subscription aSubscription,
boolean aRemote)
Construct a EventHandler instance for aSubscription and aRemote. |
| Method Summary | |
|---|---|
long |
delay()
Before an EventHandler is handled by the EventDispatcher, the delay is set. |
abstract void |
handle(Event anEvent)
Override this method if you want to implement a handler that does something with the handled event. |
boolean |
isStarted()
Indicates whether this EventHandler is started or not. |
void |
start()
Start this EventHandler if it has not already been started. |
void |
stop()
Stop this EventHandler if it has not already been stopped. |
Subscription |
subscription()
Returns the subscription for which this is a EventHandler. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected EventHandler(Subscription aSubscription,
boolean aRemote)
aSubscription - The subscription for which to create a
EventHandler.aRemote - The remote indicating whether the subscription
should be send remote or not.protected EventHandler(Subscription aSubscription)
aSubscription - The subscription for which to create a
EventHandler.protected EventHandler(Event anEvent)
anEvent - The event for which to create a EventHandler.| Method Detail |
public boolean isStarted()
public void start()
public void stop()
public long delay()
public Subscription subscription()
public abstract void handle(Event anEvent)
anEvent - The event to handle.
|
Valescom Java API | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||