站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

RunnableTaskWrapper (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util.threadpool
Class RunnableTaskWrapper

java.lang.Object
  extended byorg.jboss.util.threadpool.RunnableTaskWrapper
All Implemented Interfaces:
Runnable, TaskWrapper

public class RunnableTaskWrapper
extends Object
implements TaskWrapper

Makes a runnable a task.

Version:
$Revision: 1.1.8.1 $
Author:
Adrian Brock

Constructor Summary
RunnableTaskWrapper(Runnable runnable)
          Create a new RunnableTaskWrapper
RunnableTaskWrapper(Runnable runnable, long startTimeout, long completeTimeout)
           
 
Method Summary
 void acceptTask()
          The task has been accepted
 long getTaskCompletionTimeout()
          The time before the task must be completed
 int getTaskPriority()
          The priority of the task
 long getTaskStartTimeout()
          The time before the task must be accepted
 int getTaskWaitType()
          Get the type of wait
 boolean isComplete()
          Indicate if the task has exited the Runnable#run method
 void rejectTask(RuntimeException t)
          The task has been rejected
 void run()
           
 void stopTask()
          Invoked by the threadpool when it wants to stop the task
 void waitForTask()
          Wait according the wait type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunnableTaskWrapper

public RunnableTaskWrapper(Runnable runnable)
Create a new RunnableTaskWrapper

Parameters:
runnable - the runnable
Throws:
IllegalArgumentException - for a null runnable

RunnableTaskWrapper

public RunnableTaskWrapper(Runnable runnable,
                           long startTimeout,
                           long completeTimeout)
Method Detail

getTaskWaitType

public int getTaskWaitType()
Description copied from interface: TaskWrapper
Get the type of wait

Specified by:
getTaskWaitType in interface TaskWrapper
Returns:
the wait type

getTaskPriority

public int getTaskPriority()
Description copied from interface: TaskWrapper
The priority of the task

Specified by:
getTaskPriority in interface TaskWrapper
Returns:
the task priority

getTaskStartTimeout

public long getTaskStartTimeout()
Description copied from interface: TaskWrapper
The time before the task must be accepted

Specified by:
getTaskStartTimeout in interface TaskWrapper
Returns:
the start timeout

getTaskCompletionTimeout

public long getTaskCompletionTimeout()
Description copied from interface: TaskWrapper
The time before the task must be completed

Specified by:
getTaskCompletionTimeout in interface TaskWrapper
Returns:
the completion timeout

acceptTask

public void acceptTask()
Description copied from interface: TaskWrapper
The task has been accepted

Specified by:
acceptTask in interface TaskWrapper

rejectTask

public void rejectTask(RuntimeException t)
Description copied from interface: TaskWrapper
The task has been rejected

Specified by:
rejectTask in interface TaskWrapper
Parameters:
t - any error associated with the rejection

stopTask

public void stopTask()
Description copied from interface: TaskWrapper
Invoked by the threadpool when it wants to stop the task

Specified by:
stopTask in interface TaskWrapper

waitForTask

public void waitForTask()
Description copied from interface: TaskWrapper
Wait according the wait type

Specified by:
waitForTask in interface TaskWrapper

isComplete

public boolean isComplete()
Description copied from interface: TaskWrapper
Indicate if the task has exited the Runnable#run method

Specified by:
isComplete in interface TaskWrapper
Returns:
true if the task has exited the Runnable#run method

run

public void run()
Specified by:
run in interface Runnable


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.