|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IStage
An abstraction for stages as described in the SEDA paper by Matt Welsh. For reference to the paper look over here SEDA: An Architecture for WellConditioned, Scalable Internet Services.
Method Summary | |
---|---|
java.util.concurrent.Future<java.lang.Object> |
execute(java.util.concurrent.Callable<java.lang.Object> callable)
This method is used to execute a piece of code on this stage which returns a Future pointer. |
void |
execute(java.lang.Runnable runnable)
This method is used to execute a piece of code on this stage. |
java.util.concurrent.ExecutorService |
getInternalThreadPool()
Get the thread pool used by this stage internally. |
java.lang.String |
getName()
Get the name of the associated stage. |
long |
getPendingTasks()
This method returns the number of tasks that are pending on this stage to be executed. |
boolean |
isShutdown()
Checks if the stage has been shutdown. |
java.util.concurrent.ScheduledFuture<?> |
schedule(java.lang.Runnable command,
long delay,
java.util.concurrent.TimeUnit unit)
This method is used to submit tasks to this stage that execute periodically. |
java.util.concurrent.ScheduledFuture<?> |
scheduleAtFixedRate(java.lang.Runnable command,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit)
This method is used to submit tasks to this stage that execute periodically. |
java.util.concurrent.ScheduledFuture<?> |
scheduleWithFixedDelay(java.lang.Runnable command,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit unit)
This method is used to submit tasks to this stage that execute periodically. |
void |
shutdown()
Shutdown the stage. |
Method Detail |
---|
java.lang.String getName()
java.util.concurrent.ExecutorService getInternalThreadPool()
void execute(java.lang.Runnable runnable)
runnable
- instance whose run() method needs to be invoked.java.util.concurrent.Future<java.lang.Object> execute(java.util.concurrent.Callable<java.lang.Object> callable)
callable
- instance that needs to be invoked.
java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
command
- the task to execute.delay
- the time to delay first executionunit
- the time unit of the initialDelay and period parameters
java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
command
- the task to execute.initialDelay
- the time to delay first executionperiod
- the period between successive executionsunit
- the time unit of the initialDelay and period parameters
java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
command
- the task to execute.initialDelay
- the time to delay first executiondelay
- the delay between the termination of one execution and the commencement of the next.unit
- the time unit of the initialDelay and delay parameters
void shutdown()
boolean isShutdown()
long getPendingTasks()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |