Modified DObjectManager.createObject() to not afford optional subscription
because subscription no longer means receiving events. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@537 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ClientDObjectMgr.java,v 1.9 2001/10/16 16:41:14 mdb Exp $
|
||||
// $Id: ClientDObjectMgr.java,v 1.10 2001/10/24 00:36:40 mdb Exp $
|
||||
|
||||
package com.threerings.presents.client;
|
||||
|
||||
@@ -36,8 +36,7 @@ public class ClientDObjectMgr
|
||||
}
|
||||
|
||||
// inherit documentation from the interface
|
||||
public void createObject (Class dclass, Subscriber target,
|
||||
boolean subscribe)
|
||||
public void createObject (Class dclass, Subscriber target)
|
||||
{
|
||||
// not presently supported
|
||||
throw new RuntimeException("createObject() not supported");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: DObjectManager.java,v 1.9 2001/10/11 04:07:52 mdb Exp $
|
||||
// $Id: DObjectManager.java,v 1.10 2001/10/24 00:36:40 mdb Exp $
|
||||
|
||||
package com.threerings.presents.dobj;
|
||||
|
||||
@@ -27,12 +27,8 @@ public interface DObjectManager
|
||||
* @param target The subscriber to be notified when the object is
|
||||
* created and available, or if there was a problem creating the
|
||||
* object.
|
||||
* @param subscribe If true, the subscriber will be subscribed to the
|
||||
* object after creation; if false, it will merely be notified of it's
|
||||
* availability but not added as a subscriber.
|
||||
*/
|
||||
public void createObject (Class dclass, Subscriber target,
|
||||
boolean subscribe);
|
||||
public void createObject (Class dclass, Subscriber target);
|
||||
|
||||
/**
|
||||
* Requests that the specified subscriber be subscribed to the object
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: InvocationManager.java,v 1.9 2001/10/12 00:03:03 mdb Exp $
|
||||
// $Id: InvocationManager.java,v 1.10 2001/10/24 00:36:40 mdb Exp $
|
||||
|
||||
package com.threerings.presents.server;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class InvocationManager
|
||||
_omgr = omgr;
|
||||
|
||||
// create the object on which we'll listen for invocation requests
|
||||
omgr.createObject(DObject.class, this, true);
|
||||
omgr.createObject(DObject.class, this);
|
||||
}
|
||||
|
||||
public int getOid ()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: PresentsClient.java,v 1.23 2001/10/18 18:41:29 mdb Exp $
|
||||
// $Id: PresentsClient.java,v 1.24 2001/10/24 00:36:40 mdb Exp $
|
||||
|
||||
package com.threerings.presents.server;
|
||||
|
||||
@@ -78,7 +78,7 @@ public class PresentsClient
|
||||
}
|
||||
};
|
||||
Class clobjClass = _cmgr.getClientObjectClass();
|
||||
PresentsServer.omgr.createObject(clobjClass, sub, false);
|
||||
PresentsServer.omgr.createObject(clobjClass, sub);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: PresentsDObjectMgr.java,v 1.18 2001/10/12 00:03:03 mdb Exp $
|
||||
// $Id: PresentsDObjectMgr.java,v 1.19 2001/10/24 00:36:40 mdb Exp $
|
||||
|
||||
package com.threerings.presents.server;
|
||||
|
||||
@@ -41,11 +41,10 @@ public class PresentsDObjectMgr implements DObjectManager
|
||||
}
|
||||
|
||||
// inherit documentation from the interface
|
||||
public void createObject (Class dclass, Subscriber target,
|
||||
boolean subscribe)
|
||||
public void createObject (Class dclass, Subscriber target)
|
||||
{
|
||||
// queue up a create object event
|
||||
postEvent(new CreateObjectEvent(dclass, target, subscribe));
|
||||
postEvent(new CreateObjectEvent(dclass, target));
|
||||
}
|
||||
|
||||
// inherit documentation from the interface
|
||||
@@ -453,13 +452,11 @@ public class PresentsDObjectMgr implements DObjectManager
|
||||
*/
|
||||
protected class CreateObjectEvent extends DEvent
|
||||
{
|
||||
public CreateObjectEvent (Class clazz, Subscriber target,
|
||||
boolean subscribe)
|
||||
public CreateObjectEvent (Class clazz, Subscriber target)
|
||||
{
|
||||
super(0); // target the fake object
|
||||
_class = clazz;
|
||||
_target = target;
|
||||
_subscribe = subscribe;
|
||||
}
|
||||
|
||||
public boolean applyToObject (DObject target)
|
||||
@@ -482,10 +479,7 @@ public class PresentsDObjectMgr implements DObjectManager
|
||||
|
||||
if (_target != null) {
|
||||
// add the subscriber to this object's subscriber list
|
||||
// if they requested it
|
||||
if (_subscribe) {
|
||||
obj.addSubscriber(_target);
|
||||
}
|
||||
obj.addSubscriber(_target);
|
||||
|
||||
// let the target subscriber know that their object is
|
||||
// available
|
||||
@@ -513,7 +507,6 @@ public class PresentsDObjectMgr implements DObjectManager
|
||||
|
||||
protected Class _class;
|
||||
protected Subscriber _target;
|
||||
protected boolean _subscribe;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: DOMTest.java,v 1.3 2001/10/12 00:03:03 mdb Exp $
|
||||
// $Id: DOMTest.java,v 1.4 2001/10/24 00:36:40 mdb Exp $
|
||||
|
||||
package com.threerings.presents.server.test;
|
||||
|
||||
@@ -48,10 +48,10 @@ public class DOMTest implements Subscriber, AttributeChangeListener
|
||||
DOMTest sub = new DOMTest();
|
||||
|
||||
// request that a new TestObject be created
|
||||
omgr.createObject(TestObject.class, sub, true);
|
||||
omgr.createObject(TestObject.class, sub);
|
||||
|
||||
// or for fun you can try this bogus create request
|
||||
// omgr.createObject(Integer.class, sub, true);
|
||||
// omgr.createObject(Integer.class, sub);
|
||||
|
||||
// and run the object manager
|
||||
omgr.run();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: DestroyedRefTest.java,v 1.3 2001/10/12 00:03:03 mdb Exp $
|
||||
// $Id: DestroyedRefTest.java,v 1.4 2001/10/24 00:36:40 mdb Exp $
|
||||
|
||||
package com.threerings.presents.server.test;
|
||||
|
||||
@@ -17,8 +17,8 @@ public class DestroyedRefTest
|
||||
public void run ()
|
||||
{
|
||||
// create two test objects
|
||||
PresentsServer.omgr.createObject(TestObject.class, this, true);
|
||||
PresentsServer.omgr.createObject(TestObject.class, this, true);
|
||||
PresentsServer.omgr.createObject(TestObject.class, this);
|
||||
PresentsServer.omgr.createObject(TestObject.class, this);
|
||||
}
|
||||
|
||||
public void objectAvailable (DObject object)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: RefTest.java,v 1.3 2001/10/12 00:03:03 mdb Exp $
|
||||
// $Id: RefTest.java,v 1.4 2001/10/24 00:36:40 mdb Exp $
|
||||
|
||||
package com.threerings.presents.server.test;
|
||||
|
||||
@@ -16,8 +16,8 @@ public class RefTest
|
||||
public void run ()
|
||||
{
|
||||
// create two test objects
|
||||
PresentsServer.omgr.createObject(TestObject.class, this, true);
|
||||
PresentsServer.omgr.createObject(TestObject.class, this, true);
|
||||
PresentsServer.omgr.createObject(TestObject.class, this);
|
||||
PresentsServer.omgr.createObject(TestObject.class, this);
|
||||
}
|
||||
|
||||
public void objectAvailable (DObject object)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: TestServer.java,v 1.5 2001/10/12 00:03:03 mdb Exp $
|
||||
// $Id: TestServer.java,v 1.6 2001/10/24 00:36:40 mdb Exp $
|
||||
|
||||
package com.threerings.presents.server.test;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class TestServer extends PresentsServer
|
||||
"[error=" + cause + "].");
|
||||
}
|
||||
};
|
||||
omgr.createObject(TestObject.class, sub, false);
|
||||
omgr.createObject(TestObject.class, sub);
|
||||
}
|
||||
|
||||
public static void main (String[] args)
|
||||
|
||||
Reference in New Issue
Block a user