Class sunsoft.jws.visual.rt.base.Registry
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sunsoft.jws.visual.rt.base.Registry

java.lang.Object
   |
   +----sunsoft.jws.visual.rt.base.Registry

public class Registry
extends Object
implements Runnable
The event registry

Constructor Index

 o Registry()
Constructor.

Method Index

 o getPublishers()
Get the list of registered publishers.
 o publish(Message)
Send an event via the registry to all subscribers.
 o register(String, String, Object)
Register a publisher with the registry.
 o run()
The actual run method
 o subscribe(Message, AttributeManager)
Subscribe to events using the supplied Message as a template for requested events.
 o unregister(String)
Unregister a publisher.
 o unsubscribe(int)
Cancel a subscription.

Constructors

 o Registry
  public Registry()
Constructor.

Methods

 o subscribe
  public synchronized int subscribe(Message msg,
                                    AttributeManager obj)
Subscribe to events using the supplied Message as a template for requested events.
Only 'name', 'type' and 'targetName' can be set on the template event. (all other fields should be null, zero or false as appropriate). The strings are compared for equality. If the last character of the string is '*', then all strings beginning with the rest of the string are considered to be matching.
Note: the callback object should be written to handle callbacks on multiple threads.
 o unsubscribe
  public synchronized void unsubscribe(int id)
Cancel a subscription. The 'id' is the value returned from the subscribe call.
 o publish
  public synchronized void publish(Message msg)
Send an event via the registry to all subscribers.
 o run
  public void run()
The actual run method
 o register
  public synchronized void register(String publisher_name,
                                    String description,
                                    Object obj)
Register a publisher with the registry. This is not necessary in order to actually publish. It is just used to advertise yourself in the publishers list.
 o unregister
  public synchronized void unregister(String publisher_name)
Unregister a publisher.
 o getPublishers
  public synchronized RegistryEntry[] getPublishers()
Get the list of registered publishers.

All Packages  Class Hierarchy  This Package  Previous  Next  Index