com.threerings.presents.dobj
Interface Subscriber<T extends DObject>

Type Parameters:
T - the type object being subscribed to.
All Known Subinterfaces:
ProxySubscriber
All Known Implementing Classes:
ConfigObjectManager.ConfigObjectSubscriber, ObjectEditorPanel, PeerNode, PresentsSession.ClientProxy, SafeSubscriber

public interface Subscriber<T extends DObject>

A subscriber is an entity that has access to a distributed object. The process of obtaining access to a distributed object is an asynchronous one, and changes made to an object are delivered asynchronously. By registering as a subscriber to an object, an entity can react to changes made to an object and ensure that their object is kept up to date.

To actually receive callbacks when events are dispatched on a distributed object, an entity should register itself as a listener on the object once it has received its object reference.

See Also:
EventListener, AttributeChangeListener, SetListener, OidListListener

Method Summary
 void objectAvailable(T object)
          Called when a subscription request has succeeded and the object is available.
 void requestFailed(int oid, ObjectAccessException cause)
          Called when a subscription request has failed.
 

Method Detail

objectAvailable

void objectAvailable(T object)
Called when a subscription request has succeeded and the object is available. If the object was requested for subscription, the subscriber can subsequently receive notifications by registering itself as a listener of some sort (see DObject.addListener(com.threerings.presents.dobj.ChangeListener)).

See Also:
DObjectManager.subscribeToObject(int, com.threerings.presents.dobj.Subscriber)

requestFailed

void requestFailed(int oid,
                   ObjectAccessException cause)
Called when a subscription request has failed. The nature of the failure will be communicated via the supplied ObjectAccessException.

See Also:
DObjectManager.subscribeToObject(int, com.threerings.presents.dobj.Subscriber)