Made our node action and request into streamable closures, and removed the

warning about having to extend them with static inner classes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6551 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2011-03-29 23:30:23 +00:00
parent 064fbe425a
commit 10bea22f14
@@ -143,13 +143,8 @@ public abstract class PeerManager
/** /**
* Encapsulates code that is meant to be executed one or more servers. * Encapsulates code that is meant to be executed one or more servers.
*
* <p><b>Note well</b>: the action you provide is serialized and sent to the server to which
* the member is currently connection. This means you MUST NOT instantiate a NodeAction
* anonymously because that will maintain an implicit non-transient reference to its containing
* class which will then also be serialized (assuming it is even serializable).
*/ */
public static abstract class NodeAction implements Streamable public static abstract class NodeAction implements Streamable.Closure
{ {
/** Returns true if this action should be executed on the specified node. This will be /** Returns true if this action should be executed on the specified node. This will be
* called on the originating server to decide whether or not to deliver the action to the * called on the originating server to decide whether or not to deliver the action to the
@@ -170,13 +165,8 @@ public abstract class PeerManager
/** /**
* Encapsulates code that is meant to be executed one or more servers and return a result. * Encapsulates code that is meant to be executed one or more servers and return a result.
*
* <p><b>Note well</b>: the request you provide is serialized and sent to the server to which
* the member is currently connection. This means you MUST NOT instantiate a NodeRequest
* anonymously because that will maintain an implicit non-transient reference to its containing
* class which will then also be serialized (assuming it is even serializable).
*/ */
public static abstract class NodeRequest implements Streamable public static abstract class NodeRequest implements Streamable.Closure
{ {
/** Returns true if this request should be executed on the specified node. This will be /** Returns true if this request should be executed on the specified node. This will be
* called on the originating server to decide whether or not to deliver the request to the * called on the originating server to decide whether or not to deliver the request to the
@@ -1600,8 +1590,6 @@ public abstract class PeerManager
protected String _nodeNamespace; protected String _nodeNamespace;
protected Map<String,PeerNode> _peers = Maps.newHashMap(); protected Map<String,PeerNode> _peers = Maps.newHashMap();
/** Used to resolve dependencies in unserialized {@link NodeAction} instances. */
/** The client oids of all peers subscribed to the node object. */ /** The client oids of all peers subscribed to the node object. */
protected ArrayIntSet _suboids = new ArrayIntSet(); protected ArrayIntSet _suboids = new ArrayIntSet();