electric.util.async
Class Async

java.lang.Object
  extended byelectric.util.async.Async
All Implemented Interfaces:
java.io.Serializable

public class Async
extends java.lang.Object
implements java.io.Serializable

Async is a special argument for all async (oneway) operations Async supports pluggable transport handlers. Default handler provided by GLUE is JMS-based handler.

Author:
webMethods
See Also:
Serialized Form

Constructor Summary
Async()
           
Async(IAsyncCallback callback)
           
Async(IAsyncTransport transport)
           
 
Method Summary
 java.lang.Object getResponse()
           
 java.lang.Object getResponse(long timeout)
           
 java.lang.Object getResponseNoWait()
           
 IAsyncTransport getTransportHandler()
          Returns the currently assigned transport handler.
static boolean isAsyncSignature(java.lang.Class[] types)
           
 void receivedException(java.lang.Exception exception)
          This method is called when either an exception occurs while processing the response or an exception was returned by the server.
 void receivedResponse(java.lang.Object response)
          This method is called by async transport when a response from an asynchronous invocation becomes available.
 void setException(java.lang.Exception exception)
           
 void setResponse(java.lang.Object message)
           
 void setResponseCallback(IAsyncCallback callback)
           
 void setTransportHandler(IAsyncTransport transport)
          Sets the transport handler responsible for delivery of the response message or for handling of the receipt of the response.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Async

public Async()

Async

public Async(IAsyncCallback callback)
Parameters:
callback -

Async

public Async(IAsyncTransport transport)
Parameters:
transport -
Method Detail

toString

public java.lang.String toString()

setTransportHandler

public void setTransportHandler(IAsyncTransport transport)
Sets the transport handler responsible for delivery of the response message or for handling of the receipt of the response. If the implementation of IAsyncTransport is serializable (the default one is), async object can be persisted and used later for the delivery or the receipt of the response. This method is called by GLUE with the default transport handler. The default handler contains the information about the facilities to be used to send/receive the response. Those facilities are normally set by the request mechanism. For example, a request message could specify a queue to be used for the response. The information about that queue would be accessible via IAsyncTransport.

Parameters:
transport - implementation of IAsyncTransport

getTransportHandler

public IAsyncTransport getTransportHandler()
Returns the currently assigned transport handler. The handler is initially set by GLUE, but can be overridden by user.


getResponse

public java.lang.Object getResponse(long timeout)
                             throws java.lang.Exception
Parameters:
timeout -
Throws:
java.lang.Exception

getResponseNoWait

public java.lang.Object getResponseNoWait()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getResponse

public java.lang.Object getResponse()
                             throws java.lang.Exception
Throws:
java.lang.Exception

setResponseCallback

public void setResponseCallback(IAsyncCallback callback)
                         throws java.io.IOException
Parameters:
callback -
Throws:
java.io.IOException

setResponse

public void setResponse(java.lang.Object message)
                 throws java.io.IOException
Parameters:
message -
Throws:
java.io.IOException

setException

public void setException(java.lang.Exception exception)
                  throws java.io.IOException
Parameters:
exception -
Throws:
java.io.IOException

receivedResponse

public void receivedResponse(java.lang.Object response)
This method is called by async transport when a response from an asynchronous invocation becomes available. The response object may be cast to the same type sent by the server.

Parameters:
response - object sent by the server

receivedException

public void receivedException(java.lang.Exception exception)
This method is called when either an exception occurs while processing the response or an exception was returned by the server.

Parameters:
exception -

isAsyncSignature

public static boolean isAsyncSignature(java.lang.Class[] types)
Parameters:
types -


copyright© 2001-2004 by webMethods All Rights Reserved.