com.threerings.admin.client
Class ConfigObjectManager.ConfigObjectSubscriber

java.lang.Object
  extended by com.threerings.admin.client.ConfigObjectManager.ConfigObjectSubscriber
All Implemented Interfaces:
Subscriber<ConfigObject>
Enclosing class:
ConfigObjectManager

protected class ConfigObjectManager.ConfigObjectSubscriber
extends Object
implements Subscriber<ConfigObject>

This class takes care of the details of subscribing to and placing an individual ConfigObject that the server knows about into a HashMap.


Field Summary
protected  ConfigObject _cobj
          The object that we are tracking.
protected  String _key
          The name of the config object to which we are subscribing.
protected  int _oid
          The oid of the object that we're tracking.
 
Constructor Summary
protected ConfigObjectManager.ConfigObjectSubscriber()
           
 
Method Summary
 void cleanup()
          Signals that we should stop subscribing to our ConfigObject, and flush out the entry from the serverconfig map.
 void objectAvailable(ConfigObject 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.
 void subscribeConfig(String key, int oid)
          This method requests that we place a subscription to the ConfigObject with the given oid, identified by the key; when the object becomes available, it's added to our serverconfig map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_cobj

protected ConfigObject _cobj
The object that we are tracking.


_key

protected String _key
The name of the config object to which we are subscribing.


_oid

protected int _oid
The oid of the object that we're tracking.

Constructor Detail

ConfigObjectManager.ConfigObjectSubscriber

protected ConfigObjectManager.ConfigObjectSubscriber()
Method Detail

subscribeConfig

public void subscribeConfig(String key,
                            int oid)
This method requests that we place a subscription to the ConfigObject with the given oid, identified by the key; when the object becomes available, it's added to our serverconfig map.


objectAvailable

public void objectAvailable(ConfigObject object)
Description copied from interface: Subscriber
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)).

Specified by:
objectAvailable in interface Subscriber<ConfigObject>
See Also:
DObjectManager.subscribeToObject(int, com.threerings.presents.dobj.Subscriber)

requestFailed

public void requestFailed(int oid,
                          ObjectAccessException cause)
Description copied from interface: Subscriber
Called when a subscription request has failed. The nature of the failure will be communicated via the supplied ObjectAccessException.

Specified by:
requestFailed in interface Subscriber<ConfigObject>
See Also:
DObjectManager.subscribeToObject(int, com.threerings.presents.dobj.Subscriber)

cleanup

public void cleanup()
Signals that we should stop subscribing to our ConfigObject, and flush out the entry from the serverconfig map.