org.xnio.Result Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xnio-api Show documentation
Show all versions of xnio-api Show documentation
The API JAR of the XNIO project
package org.xnio;
import java.io.IOException;
/**
* A handler for the result of an operation. May be used to populate an {@link IoFuture}.
*/
public interface Result {
/**
* Set the result for this operation. Any threads blocking on this instance will be unblocked.
*
* @param result the result to set
*
* @return {@code false} if the operation was already completed, {@code true} otherwise
*/
boolean setResult(T result);
/**
* Set the exception for this operation. Any threads blocking on this instance will be unblocked.
*
* @param exception the exception to set
*
* @return {@code false} if the operation was already completed, {@code true} otherwise
*/
boolean setException(IOException exception);
/**
* Acknowledge the cancellation of this operation.
*
* @return {@code false} if the operation was already completed, {@code true} otherwise
*/
boolean setCancelled();
}