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.resource.work
Class WorkWrapper

    java.lang.Object
      org.jboss.util.threadpool.BasicTaskWrapper
          org.jboss.resource.work.WorkWrapper

All Implemented Interfaces:
  Runnable, org.jboss.util.threadpool.Task, org.jboss.util.threadpool.TaskWrapper

public class WorkWrapper
extends org.jboss.util.threadpool.BasicTaskWrapper
implements org.jboss.util.threadpool.Task

Wraps the resource adapter's work.

Version:
  $Revision: 1.8 $
Author:
  Adrian Brock

Field Summary

Fields inherited from class org.jboss.util.threadpool.BasicTaskWrapper
`TASK_ACCEPTED, TASK_COMPLETED, TASK_NOT_ACCEPTED, TASK_REJECTED, TASK_STARTED, TASK_STOPPED`

Fields inherited from interface org.jboss.util.threadpool.Task
`WAIT_FOR_COMPLETE, WAIT_FOR_START, WAIT_NONE`

Constructor Summary
`WorkWrapper(JBossWorkManager workManager, javax.resource.spi.work.Work work, int waitType, long startTimeout, javax.resource.spi.work.ExecutionContext executionContext, javax.resource.spi.work.WorkListener workListener)` Create a new WorkWrapper

Method Summary
`void` | `accepted(long time)`
`void` | `completed(long time, Throwable throwable)`
`void` | `execute()`
`long` | `getBlockedElapsed()` Retrieve the time blocked
`long` | `getCompletionTimeout()`
`javax.resource.spi.work.ExecutionContext` | `getExecutionContext()` Retrieve the exection context
`int` | `getPriority()`
`long` | `getStartTimeout()`
`int` | `getWaitType()`
`javax.resource.spi.work.Work` | `getWork()` Retrieve the work
`javax.resource.spi.work.WorkException` | `getWorkException()` Get any exception
`javax.resource.spi.work.WorkListener` | `getWorkListener()` Retrieve the work listener
`JBossWorkManager` | `getWorkManager()` Get the work manager
`void` | `rejected(long time, Throwable throwable)`
`void` | `started(long time)`
`void` | `stop()`
`String` | `toString()`

Methods inherited from class org.jboss.util.threadpool.BasicTaskWrapper
`acceptTask, getElapsedTime, getTaskCompletionTimeout, getTaskPriority, getTaskStartTimeout, getTaskWaitType, isComplete, rejectTask, run, setTask, stopTask, taskAccepted, taskCompleted, taskRejected, taskStarted, taskStop, waitForTask`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### WorkWrapper

    public WorkWrapper(JBossWorkManager workManager,
                       javax.resource.spi.work.Work work,
                       int waitType,
                       long startTimeout,
                       javax.resource.spi.work.ExecutionContext executionContext,
                       javax.resource.spi.work.WorkListener workListener)

  Create a new WorkWrapper

Parameters:
  `workManager` - the work manager
  `work` - the work
  `waitType` - the waitType
  `executionContext` - the execution context
Throws:
  `IllegalArgumentException` - for null work, execution context or a negative start timeout

Method Detail

### getWorkManager

    public JBossWorkManager getWorkManager()

  Get the work manager

  Returns:
    the work manager

### getWork

    public javax.resource.spi.work.Work getWork()

  Retrieve the work

  Returns:
    the work

### getWorkListener

    public javax.resource.spi.work.WorkListener getWorkListener()

  Retrieve the work listener

  Returns:
    the WorkListener

### getExecutionContext

    public javax.resource.spi.work.ExecutionContext getExecutionContext()

  Retrieve the exection context

  Returns:
    the execution context

### getBlockedElapsed

    public long getBlockedElapsed()

  Retrieve the time blocked

  Returns:
    the blocked time

### getWorkException

    public javax.resource.spi.work.WorkException getWorkException()

  Get any exception

  Returns:
    the exception or null if there is none

### getWaitType

    public int getWaitType()

  Specified by:
    `getWaitType` in interface `org.jboss.util.threadpool.Task`

### getPriority

    public int getPriority()

  Specified by:
    `getPriority` in interface `org.jboss.util.threadpool.Task`

### getStartTimeout

    public long getStartTimeout()

  Specified by:
    `getStartTimeout` in interface `org.jboss.util.threadpool.Task`

### getCompletionTimeout

    public long getCompletionTimeout()

  Specified by:
    `getCompletionTimeout` in interface `org.jboss.util.threadpool.Task`

### execute

    public void execute()

  Specified by:
    `execute` in interface `org.jboss.util.threadpool.Task`

### stop

    public void stop()

  Specified by:
    `stop` in interface `org.jboss.util.threadpool.Task`

### accepted

    public void accepted(long time)

  Specified by:
    `accepted` in interface `org.jboss.util.threadpool.Task`

### rejected

    public void rejected(long time,
                         Throwable throwable)

  Specified by:
    `rejected` in interface `org.jboss.util.threadpool.Task`

### started

    public void started(long time)

  Specified by:
    `started` in interface `org.jboss.util.threadpool.Task`

### completed

    public void completed(long time,
                          Throwable throwable)

  Specified by:
    `completed` in interface `org.jboss.util.threadpool.Task`

### toString

    public String toString()

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.