tigase.util

## Class WorkerThread

- java.lang.Object
- - java.lang.Thread
  - - tigase.util.WorkerThread

- All Implemented Interfaces:
    Runnable

      public abstract class WorkerThread
      extends Thread

  Created: Apr 21, 2009 9:02:57 PM
  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.lang.Thread

      `Thread.State, Thread.UncaughtExceptionHandler`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static Logger` | `log` Variable `log` is a class logger.

    - ### Fields inherited from class java.lang.Thread

      `MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WorkerThread()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getAverageProcessingTime()` Method description
    `abstract WorkerThread` | `getNewInstance()` Method description
    `long` | `getRunsCounter()` Method description
    `boolean` | `offer(QueueItem item)` Method description
    `abstract void` | `process(QueueItem item)` Method description
    `void` | `run()`
    `void` | `setQueueMaxSize(int maxSize)` Method description
    `void` | `shutdown()`
    `int` | `size()` Method description

    - ### Methods inherited from class java.lang.Thread

      `activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### log

          protected static final Logger log

      Variable `log` is a class logger.

  - ### Constructor Detail

    - #### WorkerThread

          public WorkerThread()

  - ### Method Detail

    - #### getNewInstance

          public abstract WorkerThread getNewInstance()

      Method description

    - #### process

          public abstract void process(QueueItem item)

      Method description
      Parameters:
        `item` -

    - #### getAverageProcessingTime

          public long getAverageProcessingTime()

      Method description

    - #### getRunsCounter

          public long getRunsCounter()

      Method description

    - #### offer

          public boolean offer(QueueItem item)

      Method description
      Parameters:
        `item` -

    - #### run

          public void run()

      Specified by:
        `run` in interface `Runnable`
      Overrides:
        `run` in class `Thread`

    - #### setQueueMaxSize

          public void setQueueMaxSize(int maxSize)

      Method description
      Parameters:
        `maxSize` -

    - #### size

          public int size()

      Method description

    - #### shutdown

          public void shutdown()

Copyright © 2015 "Tigase, Inc.". All rights reserved.