NetKernel APIs


org.ten60.netkernel.layer1.nkf.impl
Class NKFAsyncRequestHandleImpl

java.lang.Object
  extended byorg.ten60.netkernel.layer1.nkf.impl.NKFAsyncRequestHandleImpl
All Implemented Interfaces:
INKFAsyncRequestHandle, InvocationHandler, IURRequestor

public class NKFAsyncRequestHandleImpl
extends Object
implements INKFAsyncRequestHandle, IURRequestor, InvocationHandler


Constructor Summary
NKFAsyncRequestHandleImpl(NKFRequestImpl aRequest, NKFHelperImpl aHelper)
          Creates a new instance of NKFSubRequestImpl
 
Method Summary
 Object invoke(Object proxy, Method method, Object[] args)
          intercept the setResponse methods and capture response local to this request listener
 IURRepresentation join()
          Wait for an asynchronous subrequest to complete and return result - same effect as join(0)
 IURRepresentation join(long aTimeout)
          Wait for an asynchronous subrequest to complete and return result
 void receiveAsyncException(URResult aResult)
          A callback when execution of a previous request has failed
 void receiveAsyncResult(URResult aResult)
          A callback when a result to a previous request is available
 void setListener(INKFAsyncRequestListener aListener)
          Register a listener to be notified when the result of the request is available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NKFAsyncRequestHandleImpl

public NKFAsyncRequestHandleImpl(NKFRequestImpl aRequest,
                                 NKFHelperImpl aHelper)
Creates a new instance of NKFSubRequestImpl

Method Detail

join

public IURRepresentation join()
                       throws NKFException,
                              InterruptedException
Description copied from interface: INKFAsyncRequestHandle
Wait for an asynchronous subrequest to complete and return result - same effect as join(0)

Specified by:
join in interface INKFAsyncRequestHandle
Returns:
the result of executing the subrequest
Throws:
NKFException - an exception issued in trying to issue the sub request.
InterruptedException - thrown if waiting for the request to complete is interrupted

join

public IURRepresentation join(long aTimeout)
                       throws NKFException,
                              InterruptedException
Description copied from interface: INKFAsyncRequestHandle
Wait for an asynchronous subrequest to complete and return result

Specified by:
join in interface INKFAsyncRequestHandle
Returns:
the result of executing the subrequest, or null if a timeout
Throws:
NKFException - an exception issued in trying to issue the sub request.
InterruptedException - thrown if waiting for the request to complete is interrupted

setListener

public void setListener(INKFAsyncRequestListener aListener)
Description copied from interface: INKFAsyncRequestHandle
Register a listener to be notified when the result of the request is available. It is important to note that this method cannot be used to effect the response from an accessor as the callback may be made after the accessor completes. This method is more suitable for asynchronous transports.

Specified by:
setListener in interface INKFAsyncRequestHandle
Parameters:
aListener -

receiveAsyncException

public void receiveAsyncException(URResult aResult)
Description copied from interface: IURRequestor
A callback when execution of a previous request has failed

Specified by:
receiveAsyncException in interface IURRequestor
Parameters:
aResult - the exception result of a previous request

receiveAsyncResult

public void receiveAsyncResult(URResult aResult)
Description copied from interface: IURRequestor
A callback when a result to a previous request is available

Specified by:
receiveAsyncResult in interface IURRequestor
Parameters:
aResult - the result of a previous request

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
intercept the setResponse methods and capture response local to this request listener

Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.