Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.util.threadpool
Interface Task

public interface Task

A task for a thread pool.

Version:
  $Revision: 1.1 $
Author:
  Adrian Brock

Field Summary
`static int` | `WAIT_FOR_COMPLETE` Synchronized task, wait for task to complete
`static int` | `WAIT_FOR_START` Synchronized start, wait for task to start
`static int` | `WAIT_NONE` Don't wait for task

Method Summary
`void` | `accepted(long time)` The task has been accepted
`void` | `completed(long time, Throwable t)` The task has been completed
`void` | `execute()` Execute the task
`long` | `getCompletionTimeout()` The time before the task must be completed
`int` | `getPriority()` The priority of the task
`long` | `getStartTimeout()` The time before the task must be accepted
`int` | `getWaitType()` Get the type of wait
`void` | `rejected(long time, Throwable t)` The task has been rejected
`void` | `started(long time)` The task has been started
`void` | `stop()` Invoked by the threadpool when it wants to stop the task

Field Detail

### WAIT_NONE

    public static final int WAIT_NONE

  Don't wait for task

  See Also:
    Constant Field Values

### WAIT_FOR_START

    public static final int WAIT_FOR_START

  Synchronized start, wait for task to start

  See Also:
    Constant Field Values

### WAIT_FOR_COMPLETE

    public static final int WAIT_FOR_COMPLETE

  Synchronized task, wait for task to complete

  See Also:
    Constant Field Values

Method Detail

### getWaitType

    public int getWaitType()

  Get the type of wait

  Returns:
    the wait type

### getPriority

    public int getPriority()

  The priority of the task

  Returns:
    the task priority

### getStartTimeout

    public long getStartTimeout()

  The time before the task must be accepted

  Returns:
    the start timeout

### getCompletionTimeout

    public long getCompletionTimeout()

  The time before the task must be completed

  Returns:
    the completion timeout

### execute

    public void execute()

  Execute the task

### stop

    public void stop()

  Invoked by the threadpool when it wants to stop the task

### accepted

    public void accepted(long time)

  The task has been accepted

  Parameters:
    `time` - the time taken to accept the task

### rejected

    public void rejected(long time,
                         Throwable t)

  The task has been rejected

  Parameters:
    `time` - the time taken to reject the task

### started

    public void started(long time)

  The task has been started

  Parameters:
    `time` - the time taken to start the task

### completed

    public void completed(long time,
                          Throwable t)

  The task has been completed

  Parameters:
    `time` - the time taken to reject the task

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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