WS-BaseNotification

As you probably know, WS-BaseNotification offers support for web services that notify each other of events through web service calls.

Topics

Events are classified using Topics. WSRFlite supports only simple topics: resource property changes. Clients can subscribe using a resource property QName as topic, such as ws-rl:TerminationTime. They will be notified if this property changes.

Filters

A common scenario for messaging are things like "notify me if the Status is 'DONE'". This can be realised using a filter that evaluates a notification message before it is sent. Notification clients can specify an XPath expression to be used as such a filter. Check the TestFilteredMessagesConsumer testcase for an example.

Subscribing to notifications

Client services that want to receive notifications use a callback interface (NotificationConsumer) through which they can receive nmessages. They subscribe with a service producing notifications.

Clients can subclass NotificationProducerImpl (instead of WSResourceImpl) if they want to produce notifications.

Producing Notifications

Services that produce notifications offer an interface that clients use for subscribing. In the WSRF version, unsubscribing is done by destroying a Subscription WS-resource.

Services can subclass NotificationComsumerImpl (instead of WSResourceImpl) if they want to receive notifications.

The NotificationProducer code has to actively trigger the notification mechanism. This is done by calling the postEvent() method, that takes a QName as a parameter.