Platform SDK Java 8.5 API Reference

com.genesyslab.platform.commons.protocol
Interface RequestFuture

All Superinterfaces:
java.util.concurrent.Future<Message>
All Known Implementing Classes:
ClusterProtocolImpl.RequestFutureWrapper

public interface RequestFuture
extends java.util.concurrent.Future<Message>


Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
          Marks this request as canceled and notifies all waiting threads on it.
 Message get()
          Waits if necessary for the request to complete, and then returns its result.
 Message get(long timeout)
          Deprecated.  
 Message get(long timeout, java.util.concurrent.TimeUnit unit)
          Waits if necessary for at most the given time for the request to complete, and then returns its result, if available.
 Message getRequest()
          Returns original request message.
 Message getResponse()
          Deprecated.  
 Message getResponse(long timeout)
          Deprecated.  
 boolean isCanceled()
          Deprecated.  
 boolean isDone()
          Returns true if this request completed.
 
Methods inherited from interface java.util.concurrent.Future
isCancelled
 

Method Detail

getRequest

Message getRequest()
Returns original request message.

Returns:
request message

isDone

boolean isDone()
Returns true if this request completed. Completion may be due to incoming message from server carrying the same ReferenceId, cancellation, or timeout - in all of these cases this method will return true.
By the other words, it reflects inverted value to "do we still expect for non-received response from server?".

Note: timeout feature is not enabled for beginRequest() by default.

Specified by:
isDone in interface java.util.concurrent.Future<Message>
Returns:
true if this request completed

cancel

boolean cancel(boolean mayInterruptIfRunning)
Marks this request as canceled and notifies all waiting threads on it. This call will have no effect if the task has already completed, already been canceled or timed out.

Parameter mayInterruptIfRunning has no effect here because real request execution is been done on server side and communication protocols usually do not support cancellation queries.

Specified by:
cancel in interface java.util.concurrent.Future<Message>
Parameters:
mayInterruptIfRunning - not used
Returns:
false if the task could not be canceled, typically because it has already completed normally; true otherwise

get

Message get()
            throws java.lang.InterruptedException
Waits if necessary for the request to complete, and then returns its result.

Specified by:
get in interface java.util.concurrent.Future<Message>
Returns:
Response for the request
Throws:
java.lang.InterruptedException - if thread is interrupted

get

@Deprecated
Message get(long timeout)
            throws java.lang.InterruptedException
Deprecated. 

Waits if necessary for at most the given time for the request to complete, and then returns its result, if available.

Parameters:
timeout - timeout in milliseconds
Returns:
Response for the request or null if timeout
Throws:
java.lang.InterruptedException - if thread is interrupted
See Also:
get(long, TimeUnit), TimeUnit.MILLISECONDS

get

Message get(long timeout,
            java.util.concurrent.TimeUnit unit)
            throws java.lang.InterruptedException
Waits if necessary for at most the given time for the request to complete, and then returns its result, if available.

Specified by:
get in interface java.util.concurrent.Future<Message>
Parameters:
timeout - the maximum time to wait
unit - the time unit of the timeout argument
Returns:
Response for the request or null if timeout
Throws:
java.lang.InterruptedException - if thread is interrupted
See Also:
get(long, TimeUnit), TimeUnit.MILLISECONDS

isCanceled

@Deprecated
boolean isCanceled()
Deprecated. 

Returns true if this task was canceled before it completed normally.

Returns:
true if task was canceled before it completed
See Also:
Future.isCancelled()

getResponse

@Deprecated
Message getResponse()
                    throws java.lang.InterruptedException
Deprecated. 

Waits if necessary for the request to complete, and then returns its result.

Returns:
Response for the request
Throws:
java.lang.InterruptedException - if thread is interrupted
See Also:
get()

getResponse

@Deprecated
Message getResponse(long timeout)
                    throws java.lang.InterruptedException
Deprecated. 

Waits if necessary for at most the given time for the request to complete, and then returns its result, if available.

Parameters:
timeout - timeout in milliseconds
Returns:
Response for the request or null if timeout
Throws:
java.lang.InterruptedException - if thread is interrupted
See Also:
get(long, TimeUnit), TimeUnit.MILLISECONDS

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.