Configuration Platform SDK 7.6 API Reference

com.genesyslab.platform.commons.protocol
Interface RequestFuture


public interface RequestFuture


Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
          Attempts to cancel execution of this task.
 Message get()
          Waits if necessary for the request to complete, and then retrieves its result.
 Message get(long timeout)
          Waits if necessary for at most the given time for the request to complete, and then retrieves its result, if available.
 Message getRequest()
           
 Message getResponse()
          Waits if necessary for the request to complete, and then retrieves its result.
 Message getResponse(long timeout)
          Waits if necessary for at most the given time for the request to complete, and then retrieves its result, if available.
 boolean isCanceled()
          Returns true if this task was cancelled before it completed normally.
 boolean isDone()
          Returns true if this task completed.
 

Method Detail

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Attempts to cancel execution of this task. This attempt will fail if the task has already completed, already been cancelled, or could not be cancelled for some other reason. If successful, and this task has not started when cancel is called, this task should never run. If the task has already started, then the mayInterruptIfRunning parameter determines whether the thread executing this task should be interrupted in an attempt to stop the task.

Parameters:
mayInterruptIfRunning - true if the thread executing this task should be interrupted; otherwise, in-progress tasks are allowed to complete
Returns:
false if the task could not be cancelled, typically because it has already completed normally; true otherwise

get

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

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

get

public Message get(long timeout)
            throws java.lang.InterruptedException
Waits if necessary for at most the given time for the request to complete, and then retrieves 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:
getResponse(long)

isCanceled

public boolean isCanceled()
Returns true if this task was cancelled before it completed normally.

Returns:
true if task was cancelled before it completed

isDone

public boolean isDone()
Returns true if this task completed. Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true.

Returns:
true if this task completed.

getResponse

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

Returns:
Response for the request
Throws:
java.lang.InterruptedException - if thread is interrupted

getResponse

public Message getResponse(long timeout)
                    throws java.lang.InterruptedException
Waits if necessary for at most the given time for the request to complete, and then retrieves 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

getRequest

public Message getRequest()

Configuration Platform SDK 7.6 API Reference

Send comments on this topic.
Copyright © 2006–2008 Genesys Telecommunication Laboratories, Inc. All rights reserved.