Slight change to usage and documentation.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4884 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-11-28 00:47:16 +00:00
parent 95adfeb646
commit 69a1d2ec23
@@ -146,16 +146,19 @@ public class PeerManager
* *
* <p><b>Note well</b>: the action you provide is serialized and sent to the server to which * <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 * the member is currently connection. This means you MUST NOT instantiate a NodeAction
* anonymously and make reference to other classes because those implicit references will cause * anonymously because that will maintain an implicit non-transient reference to its containing
* the referenced classes to be included in the anonymous inner class's serialization closure. * class which will then also be serialized (assuming it is even serializable).
* Instead use the provided varargs constructor to pass along any information you need which *
* will be serialized and sent to the destination server. This means that said arguments must * <p> Instead extend this class with a non-inner class and use {@link #init} to pass along any
* of course be {@link Serializable}. * information you need which will be serialized and sent to the destination server. Said
* arguments must of course be {@link Serializable}.
*/ */
public static abstract class NodeAction implements Serializable public static abstract class NodeAction implements Serializable
{ {
public NodeAction (Serializable ... arguments) { /** Provides this node action with its arguments. Returns this. */
public NodeAction init (Serializable ... arguments) {
_arguments = arguments; _arguments = arguments;
return this;
} }
/** 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