Spot stuff in AbjectScript.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4144 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package com.threerings.presents.client {
|
||||
|
||||
public class ConfirmAdapter
|
||||
implements ConfirmListener
|
||||
{
|
||||
public function ConfirmAdapter (processed :Function, failed :Function)
|
||||
{
|
||||
_processed = processed;
|
||||
_failed = failed;
|
||||
}
|
||||
|
||||
// documentation inherited from interface ConfirmListener
|
||||
public function requestProcessed () :void
|
||||
{
|
||||
_processed();
|
||||
}
|
||||
|
||||
// documentation inherited from interface ConfirmListener
|
||||
public function requestFailed (cause :String) :void
|
||||
{
|
||||
_failed(cause);
|
||||
}
|
||||
|
||||
protected var _processed :Function;
|
||||
protected var _failed :Function;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,14 @@
|
||||
package com.threerings.presents.client {
|
||||
|
||||
/**
|
||||
* Extends the {@link InvocationListener} with a basic success
|
||||
* callback.
|
||||
*/
|
||||
public interface ConfirmListener extends InvocationListener
|
||||
{
|
||||
/**
|
||||
* Indicates that the request was successfully processed.
|
||||
*/
|
||||
function requestProcessed () :void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,30 @@
|
||||
package com.threerings.presents.client {
|
||||
|
||||
/**
|
||||
* Invocation service methods that require a response should take a
|
||||
* listener argument that can be notified of request success or
|
||||
* failure. The listener argument should extend this interface so that
|
||||
* generic failure can be reported in all cases. For example:
|
||||
*
|
||||
* <pre>
|
||||
* // Used to communicate responses to <code>moveTo</code> requests.
|
||||
* public interface MoveListener extends InvocationListener
|
||||
* {
|
||||
* // Called in response to a successful <code>moveTo</code>
|
||||
* // request.
|
||||
* public void moveSucceeded (PlaceConfig config);
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public interface InvocationListener
|
||||
{
|
||||
/**
|
||||
* Called to report request failure. If the invocation services
|
||||
* system detects failure of any kind, it will report it via this
|
||||
* callback. Particular services may also make use of this
|
||||
* callback to report failures of their own, or they may opt to
|
||||
* define more specific failure callbacks.
|
||||
*/
|
||||
function requestFailed (cause :String) :void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
package com.threerings.presents.client {
|
||||
|
||||
/**
|
||||
* Extends the {@link InvocationListener} with a basic success
|
||||
* callback that delivers a result object.
|
||||
*/
|
||||
public interface ResultListener extends InvocationListener
|
||||
{
|
||||
/**
|
||||
* Indicates that the request was successfully processed.
|
||||
*/
|
||||
function requestProcessed (result :Object) :void;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user