org.activemath.events.impl
Class XmlrpcEventService

java.lang.Object
  extended by org.activemath.events.impl.XmlrpcEventService
All Implemented Interfaces:
EventListener, ActivemathEventListener

public class XmlrpcEventService
extends Object
implements ActivemathEventListener

XML-RPC server for Activemath event system


Constructor Summary
XmlrpcEventService(EventManager manager)
           
 
Method Summary
 void onActivemathEvent(ActivemathEvent event)
          Remote event delivery.
 boolean publishEvent(Hashtable props)
          Remote event publication.
 int subscribe(String listenerUrl, String refId, Vector include, Vector exclude)
          Subscribe to remote events.
 int unsubscribe(String listenerUrl, String refId)
          Unsubscribe a remote client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlrpcEventService

public XmlrpcEventService(EventManager manager)
Method Detail

subscribe

public int subscribe(String listenerUrl,
                     String refId,
                     Vector include,
                     Vector exclude)
              throws MalformedURLException
Subscribe to remote events.

If a client has already subscribed with the same URL and refId, the previous subscription is replaced.

A subscription should be terminated with a matching @see unsubscribe().

A subscription is terminated when there have been a certain number of consecutive delivery errors to a client (currently 3).

Parameters:
listenerUrl - - XMLRPC callback url
refId - - reference id passed to the callback
include - - list of event tags or types to include in the subscription
exclude - - list of event tags or types to exclude from the subscription
Returns:
dummy value 0
Throws:
MalformedURLException

unsubscribe

public int unsubscribe(String listenerUrl,
                       String refId)
Unsubscribe a remote client.

Parameters must match a previous subscriptions. Errors are ignored.

Parameters:
listenerUrl -
refId -
Returns:
dummy value 0

onActivemathEvent

public void onActivemathEvent(ActivemathEvent event)
Remote event delivery.

This will deliver an event that has happened locally to all remote subscribers.

Specified by:
onActivemathEvent in interface ActivemathEventListener
Parameters:
event - the event to respond to

publishEvent

public boolean publishEvent(Hashtable props)
Remote event publication.

This will publish an event at the EventManager on behalf of a remote client. The following attributes will be overridden: ts, id, source.

Open issues:

Parameters:
props - map describing the event attributes
Returns:
true on success