mx.rpc
Interface Responder



interface Responder

The Responder interface declares the required methods for implementing a responder for remoting method calls. The RelayResponder implements this interface.

Example
The following example shows an implementation of the Responder interface, which calls the method gotData and gotFault on the object specified within the constructor.
   import mx.rpc.Responder;
   import mx.rpc.ResultEvent;
   import mx.rpc.FaultEvent;
   
   class my.company.com.MyResponder extends Object implements Responder {
    
    function MyResponder( obj:Object ) {
     super();
     _obj = obj;
    }
    
    function onResult( result:ResultEvent ): Void {
     _obj.gotData( result );
    }
    
    function onFault( fault:FaultEvent ): Void {
     _obj.gotFault( fault );
    }
    
    private var _obj:Object;
   }
     

See Also
    mx.rpc.RelayResponder



Methods
      onFault( fault: mx.rpc.FaultEvent)  : Void
This method is called when an error occurs during a remoting method call at the server.
      onResult( result: mx.rpc.ResultEvent)  : Void
This method is called when the results of a remoting method call have been returned to the client.


Method Detail

onFault

onFault( fault: mx.rpc.FaultEvent)  : Void

This method is called when an error occurs during a remoting method call at the server.

Parameters
    fault: mx.rpc.FaultEvent - The FaultEvent constructed after the remote method fault has been returned

Example
The following example shows an implementation of the Responder interface, which calls the method gotData and gotFault on the object specified within the constructor.
    import mx.rpc.Responder;
    import mx.rpc.ResultEvent;
    import mx.rpc.FaultEvent;
    
    class my.company.com.MyResponder extends Object implements Responder {
     
     function MyResponder( obj:Object ) {
      super();
      _obj = obj;
     }
     
     function onResult( result:ResultEvent ): Void {
      _obj.gotData( result );
     }
     
     function onFault( fault:FaultEvent ): Void {
      _obj.gotFault( fault );
     }
    }
       


onResult

onResult( result: mx.rpc.ResultEvent)  : Void

This method is called when the results of a remoting method call have been returned to the client.

Parameters
    result: mx.rpc.ResultEvent - The ResultEvent constructed after the remote method has been returned

Example
The following example shows an implementation of the Responder interface, which calls the method gotData and gotFault on the object specified within the constructor.
    import mx.rpc.Responder;
    import mx.rpc.ResultEvent;
    import mx.rpc.FaultEvent;
    
    class my.company.com.MyResponder extends Object implements Responder {
     
     function MyResponder( obj:Object ) {
      super();
      _obj = obj;
     }
     
     function onResult( result:ResultEvent ): Void {
      _obj.gotData( result );
     }
     
     function onFault( fault:FaultEvent ): Void {
      _obj.gotFault( fault );
     }
    }
       

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flashremoting/mx2004/actionscript_api_reference/mx/rpc/Responder.html