org.xnio.Result Maven / Gradle / Ivy
Go to download
This artifact provides a single jar that contains all classes required to use remote EJB and JMS, including
all dependencies. It is intended for use by those not using maven, maven users should just import the EJB and
JMS BOM's instead (shaded JAR's cause lots of problems with maven, as it is very easy to inadvertently end up
with different versions on classes on the class path).
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();
}