XNIO API 3.1.0.Beta1

org.xnio
Interface XnioExecutor

All Superinterfaces:
Executor

public interface XnioExecutor
extends Executor

An executor with the capability to run timed, cancellable tasks.

Author:
David M. Lloyd

Nested Class Summary
static interface XnioExecutor.Key
          A task key for a timeout task.
 
Method Summary
 void execute(Runnable command)
          Execute a task in this executor.
 XnioExecutor.Key executeAfter(Runnable command, long time, TimeUnit unit)
          Execute a command after a period of time.
 

Method Detail

execute

void execute(Runnable command)
Execute a task in this executor.

Specified by:
execute in interface Executor
Parameters:
command - the command to run

executeAfter

XnioExecutor.Key executeAfter(Runnable command,
                              long time,
                              TimeUnit unit)
Execute a command after a period of time. At least the amount of time given in time will have elapsed when the task is run. The returned key may be used to cancel the task before it runs.

Parameters:
command - the command to execute
time - the amount of time to delay, or 0 to run immediately
unit - the time unit to apply to time
Returns:
a key which may be used to cancel this task before it executes

XNIO API 3.1.0.Beta1

Copyright © 2010 JBoss, a division of Red Hat, Inc.