Revamped distributed object creation. There was no particular reason to create

distributed objects by reflection since we don't allow clients to create
objects, furthermore we needn't do it asynchronously. The object creation
methods were moved into the server-side only interface and made "immediate", so
the caller creates a derived instance of DObject and registers it with the
system instead of creating it with a Subscriber callback.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4342 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2006-08-23 23:46:48 +00:00
parent 1f204669c4
commit bc9f53396c
19 changed files with 304 additions and 589 deletions
@@ -39,23 +39,6 @@ public interface DObjectManager
*/
public boolean isManager (DObject object);
/**
* Creates a distributed object instance of the supplied class and
* notifies the specified subscriber when it becomes available. This
* is the proper mechanism for constructing a new distributed object
* as it is the only way in which it can be properly registered with
* the dobj system.
*
* @param dclass The class object of the derived class of
* <code>DObject</code> (or <code>DObject.class</code> itself) that
* should be instantiated.
* @param target The subscriber to be notified when the object is
* created and available, or if there was a problem creating the
* object.
*/
public <T extends DObject> void createObject (
Class<T> dclass, Subscriber<T> target);
/**
* Requests that the specified subscriber be subscribed to the object
* identified by the supplied object id. That subscriber will be
@@ -83,15 +66,6 @@ public interface DObjectManager
public <T extends DObject> void unsubscribeFromObject (
int oid, Subscriber<T> target);
/**
* Requests that the specified object be destroyed. Once destroyed an
* object is removed from the runtime system and may no longer have
* events dispatched on it.
*
* @param oid The object id of the distributed object to be destroyed.
*/
public void destroyObject (int oid);
/**
* Posts a distributed object event into the system. Instead of
* requesting the modification of a distributed object attribute by
@@ -35,4 +35,22 @@ public interface RootDObjectManager extends DObjectManager
* table, returning null if no object exists with that oid.
*/
public DObject getObject (int oid);
/**
* Registers a distributed object instance of the supplied class with the
* system and assigns it an oid. When the call returns the object will be
* registered with the system and its oid will have been assigned.
*
* @return the registered object for the caller's convenience.
*/
public <T extends DObject> T registerObject (T object);
/**
* Requests that the specified object be destroyed. Once destroyed an
* object is removed from the runtime system and may no longer have
* events dispatched on it.
*
* @param oid The object id of the distributed object to be destroyed.
*/
public void destroyObject (int oid);
}