|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.berkeley.guir.ptk.notification.NotificationPolicy
Handles the routing of events to Notification Setters. An instance of class is
initialized by the PeripheralDisplay class each time
makeConnection is called.
The method setNotification loops through the Abstractors that are installed (these correspond to an array of Notification Setters or a single Notification Setter passed into a makeConnection call). Different instances of this class can have different Notification Setters installed. These set the notification level of the event. Default for the setNotification method is to continue looping through all installed Notification Setters unless the notify level is set to "demand action" (in which case it would stop all remaining notification setting).
In setNotification, this policy determines if it should call a Notification Setter's
set method by comparing the metadata of the event and data IDs
with the metadata and data IDs the Notification Setter indicates it can
handle.
Developers will rarely need to modify this class or worry about how it works. One case in which developers may want to modify this class is if they want to modify the way in which events are passed to a chain of installed Notification Setters.
| Field Summary | |
History |
h
All notification policies can look at the application's event history. |
EventPriorityQueue |
inQ
The queue that houses incoming events to be processed by this policy. |
protected java.util.Vector |
notification_setters
|
EventPriorityQueue |
outQ
The queue where the policy places processed events. |
PeripheralDisplay |
pd
This is a pointer to the Application that contains this NotificationPolicy. |
| Constructor Summary | |
NotificationPolicy()
Default constructor which sets all data fields to null. |
|
NotificationPolicy(java.util.Vector notify_setters)
Constructor that takes two parameters. |
|
| Method Summary | |
void |
addNotificationSetter(NotificationSetter ns)
Adds a notification setter to this policy. |
void |
run()
Processing loop that periodically checks the inQ for new events to be processed. |
int |
setNotification(Event e)
This is the most important method in this class - it handles event processing by looping through all notification setters installed in the policy and asking them to set the events notification level (depending on the event metadata/data). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Vector notification_setters
public EventPriorityQueue inQ
public EventPriorityQueue outQ
public History h
public PeripheralDisplay pd
| Constructor Detail |
public NotificationPolicy()
public NotificationPolicy(java.util.Vector notify_setters)
notify_setters - Vector of notification setters to be
installed in this policy. The order of
this Vector dictates the order in which
the setters will process a new event.
The setter in the first (0th) position of
Vector will process the event first.| Method Detail |
public int setNotification(Event e)
The default for this method is to discontinue looping if an event's notification level is set to "demand action." To change this, subclass and reimplement this method.
e - the event with new input data for which the notification
level will be set
public void run()
run in interface java.lang.Runnablepublic void addNotificationSetter(NotificationSetter ns)
PeripheralDisplay.
ns - notification setter to add.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||