Added support for registering, on a per class basis, a delay which will be

observed after the last subscriber of a matching distributed object has
been removed. Our client's subscription will not be flushed until after
the delay has expired, and only then if no other subscriber has come along
requesting the object in the meanwhile.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2303 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-03-11 04:43:14 +00:00
parent ef525ebad9
commit 91146a6805
2 changed files with 122 additions and 11 deletions
@@ -1,5 +1,5 @@
//
// $Id: Client.java,v 1.36 2003/01/28 04:24:16 mdb Exp $
// $Id: Client.java,v 1.37 2003/03/11 04:43:14 mdb Exp $
package com.threerings.presents.client;
@@ -184,6 +184,25 @@ public class Client
return (_comm != null) ? _comm.getDObjectManager() : null;
}
/**
* Instructs the distributed object manager associated with this
* client to allow objects of the specified class to linger around the
* specified number of milliseconds after their last subscriber has
* been removed before the client finally removes its object proxy and
* flushes the object. Normally, objects are flushed immediately
* following the removal of their last subscriber.
*
* <p><em>Note:</em> the delay will be applied to derived classes as
* well as exact matches. <em>Note also:</em> this method cannot be
* called until after the client has established a connection with the
* server and the distributed object manager is available.
*/
public void registerFlushDelay (Class objclass, long delay)
{
ClientDObjectMgr omgr = (ClientDObjectMgr)getDObjectManager();
omgr.registerFlushDelay(objclass, delay);
}
/**
* Returns the oid of the client object associated with this session.
* It is only valid for the duration of the session.