Provide a convenient method for indicating that a listener does not

need to be responded to. It turns out that a listener may not be
a marshaller if a server entity is calling a service request method
directly.  The convenience method handles this and is also cleaner looking
for callers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3832 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-02-04 03:49:53 +00:00
parent 12a4f4bb7e
commit 17987537f4
3 changed files with 14 additions and 5 deletions
@@ -237,6 +237,17 @@ public class InvocationMarshaller
return _invCode;
}
/**
* A convenience method to indicate that the listener is not going
* to be responded-to, and that this is ok.
*/
public static void setNoResponse (InvocationListener listener)
{
if (listener instanceof ListenerMarshaller) {
((ListenerMarshaller) listener).setNoResponse();
}
}
/**
* Called by generated invocation marshaller code; packages up and
* sends the specified invocation service request.
@@ -74,8 +74,7 @@ public class SceneProvider
Log.info("Abandoning scene move, client gone " +
"[who=" + source.who() +
", dest=" + scmgr.where() + "].");
((InvocationMarshaller.ListenerMarshaller) listener).
setNoResponse();
InvocationMarshaller.setNoResponse(listener);
return;
}
finishMoveToRequest(source, scmgr, sceneVer, listener);
@@ -80,7 +80,7 @@ public class SpotProvider
Log.info("Ignoring stale traverse portal request " +
"[caller=" + caller.who() + ", oSceneId=" + sceneId +
", portalId=" + portalId + ", cSceneId=" + cSceneId + "].");
((InvocationMarshaller.ListenerMarshaller) listener).setNoResponse();
InvocationMarshaller.setNoResponse(listener);
return;
}
@@ -131,8 +131,7 @@ public class SpotProvider
Log.info("Abandoning portal traversal, client gone " +
"[who=" + fsource.who() +
", dest=" + scmgr.where() + "].");
((InvocationMarshaller.ListenerMarshaller) flistener).
setNoResponse();
InvocationMarshaller.setNoResponse(flistener);
return;
}