org.infinispan.distexec.DistributedTaskBuilder Maven / Gradle / Ivy
package org.infinispan.distexec;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
/**
* DistributedTaskBuilder is a factory interface for DistributedTask
*
* @author Manik Surtani
* @author Vladimir Blagojevic
* @since 5.2
*/
public interface DistributedTaskBuilder {
/**
* Provide relevant {@link Callable} for the {@link DistributedTask}
*
* @param callable
* for the DistribtuedTask being built
* @return this DistributedTaskBuilder
*/
DistributedTaskBuilder callable(Callable callable);
/**
* Provide {@link DistributedTask} task timeout
*
* @param timeout
* for the task
* @param tu
* {@link TimeUnit} for the task being built
* @return this DistributedTaskBuilder
*/
DistributedTaskBuilder timeout(long timeout, TimeUnit tu);
/**
* Provide {@link DistributedTaskExecutionPolicy} for the task being built
*
* @param policy
* DistributedTaskExecutionPolicy for the task
* @return this DistributedTaskBuilder
*/
DistributedTaskBuilder executionPolicy(DistributedTaskExecutionPolicy policy);
/**
* Provide {@link DistributedTaskFailoverPolicy} for the task being built
*
* @param policy
* DistributedTaskFailoverPolicy for the task
* @return this DistributedTaskBuilder
*/
DistributedTaskBuilder failoverPolicy(DistributedTaskFailoverPolicy policy);
/**
* Completes creation of DistributedTask with the currently provided attributes of this
* DistributedTaskBuilder
*
* @return the built task ready for use
*/
DistributedTask build();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy