|
Protomatter Classes v1.1.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is implemented internally by PAS. It provides a mechanism for registering and un-registering interest in topics, and for sending events.
The PAS event topic tree is organized like this:
"*" is the root of all topics. The higher up the tree, the more general the topic. If you're listening to the "*" topic, you get everything that passes through the event system. If you're listening to "weather.usa.co.denver" you only get events for that topic. If you're listening to "weather.usa.co" you'll get events for the "weather.usa.co", "weather.usa.co.denver" and "weather.usa.co.boulder" topics. The topic tree is dynamically created and pruned as listeners are added an removed. Events are delivered to listeners in the tree from top to bottom (so a listener to "weather" will get events before a listener to "weather.usa"). Events are delivered via a pool of threads, so that the PASEventManager.deliverEvent(...) method returns immediately, before the event is actually delivered.* +------------+ | | weather stocks +---------+ | | canada usa +----------+ | | co va +--------+ | | denver boulder
You can get access to the default implementation of the PASEventManager interface like this:
From there you can register for events, un-register for events, and send events of your own.import javax.naming.*; // JNDI stuff import com.protomatter.pas.event.*; // PASEventManager ... Context context = get_A_JNDI_Context(); PASEventManager em = (PASEventManager)context.lookup(PASEventManager.JNDI_NAME);
Field Summary | |
static java.lang.String |
JNDI_NAME
Implementations of this interface are placed at this location in the JNDI tree. |
Method Summary | |
void |
registerListener(java.lang.String topic,
PASEventListener listener)
Register interest in the given topic. |
void |
sendEvent(java.lang.String topic,
PASEvent event)
Send an event to the given topic. |
void |
unregisterListener(java.lang.String topic,
PASEventListener listener)
Un-register interest in the given topic. |
Field Detail |
public static final java.lang.String JNDI_NAME
Method Detail |
public void sendEvent(java.lang.String topic, PASEvent event)
public void registerListener(java.lang.String topic, PASEventListener listener)
public void unregisterListener(java.lang.String topic, PASEventListener listener)
|
Protomatter Classes v1.1.6 Copyright 1998-2001 Nate Sammons |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Protomatter Classes v1.1.6 | http://protomatter.sourceforge.net/1.1.6 |