Siena (v.1.5.5) API documentation

siena
Interface Notifiable

All Known Implementing Classes:
NotificationBuffer, NotificationInputSequencer

public interface Notifiable

interface implemented by event consumers. Every object that wants to receive event notifications from Siena must implement this interface. Siena calls notify(Notification) on a subscriber to notify a single event to it. Siena calls notify(Notification []) to notify a sequence of events.

Example:


    class SimpleSubscriber implements Notifiable {

        public void notify(Notification e) {
            System.out.println("I got this notification: " + e.toString());
        }

        public void notify(Notification s[]) {
            // I never subscribe for patterns anyway. 
        }
    } 
    

See Also:
Notification, Siena

Method Summary
 void notify(Notification n)
          sends a Notification to this Notifable Since version 1.0.1 of the Siena API it is safe to modify the Notification object received through this method.
 void notify(Notification[] s)
          sends a sequence of Notifications to this Notifable Since version 1.0.1 of the Siena API it is safe to modify the Notification objects received through this method.
 

Method Detail

notify

void notify(Notification n)
            throws SienaException
sends a Notification to this Notifable Since version 1.0.1 of the Siena API it is safe to modify the Notification object received through this method. Note that:
  1. any previous version of the Siena API assumes that clients do not modify these notifications;
  2. the current solution incurrs in an unnecessary cost by having to duplicate every notification. Therefore, it is a temporary solution. The plan is to implement immutable notifications and to pass those to subscribers.
necessary duplication of notifications can be expensive, especially if the same notification must be copied to numerous subscribers.

Parameters:
n - notification passed to the notifiable
Throws:
SienaException
See Also:
Siena.subscribe(Filter,Notifiable)

notify

void notify(Notification[] s)
            throws SienaException
sends a sequence of Notifications to this Notifable Since version 1.0.1 of the Siena API it is safe to modify the Notification objects received through this method. Please read the notes in the above documentation of notify(Notification), which apply to this method as well.

Parameters:
s - sequence of notifications passed to the notifiable
Throws:
SienaException
See Also:
Siena.subscribe(Pattern,Notifiable)

Siena (v.1.5.5) API documentation

Copyright © 2000-2005 University of Colorado.
Copyright © 2005-2008 Antonio Carzaniga.
This documentation is maintained by Antonio Carzaniga