Package ru.bitel.bgbilling.apps.tv.access.om

# Class OrderManagerDeviceWorker

java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
ru.bitel.common.worker.WorkerTask<EventListenerContext>
ru.bitel.bgbilling.kernel.event.EventWorker
ru.bitel.bgbilling.kernel.event.AsyncEventWorker<ru.bitel.bgbilling.kernel.event.common.Event>
ru.bitel.bgbilling.apps.tv.access.om.OrderManagerDeviceWorker

All Implemented Interfaces:
  `Runnable`, `EventListener<ru.bitel.bgbilling.kernel.event.common.Event>`

public class OrderManagerDeviceWorker extends AsyncEventWorker<ru.bitel.bgbilling.kernel.event.common.Event>

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class ru.bitel.common.worker.WorkerTask

  `ru.bitel.common.worker.WorkerTask.BlockingExecutionHandler`

- ## Field Summary

  ### Fields inherited from class ru.bitel.bgbilling.kernel.event.AsyncEventWorker

  `batchPause, batchSize, errorCount, needAcknowledge, waitNextTask`

  ### Fields inherited from class ru.bitel.bgbilling.kernel.event.EventWorker

  `batchWait, consumer, errorPause, moduleId, working`

  ### Fields inherited from class ru.bitel.common.worker.WorkerTask

  `context`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OrderManagerDeviceWorker(ru.bitel.bgbilling.apps.tv.access.TvAccess access, ScheduledExecutorService scheduledExecutorService, int deviceId)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `doTask(Object task)`
  Выполнение отдельной задачи.
  `protected void`
  `processDoTaskException(Object task, boolean inDoTask, boolean putFirstIfInDoTask, ru.bitel.bgbilling.common.BGException ex, boolean throwException)`
  `protected void`
  `runImpl()`
  `protected boolean`
  `runWorker()`
  Вызывается, когда появляются задачи.
  `protected void`
  `taskDone(Object task, Object result)`
  `String`
  `toString()`

  ### Methods inherited from class ru.bitel.bgbilling.kernel.event.AsyncEventWorker

  `doTasks, internalDoTask, notify, poll, putFirst, putLast, taskTimeout`

  ### Methods inherited from class ru.bitel.bgbilling.kernel.event.EventWorker

  `internalRunWorker, pollFirstTask, setConsumer, shutdown`

  ### Methods inherited from class ru.bitel.common.worker.WorkerTask

  `newBlockingFixedThreadPool, newFixedThreadPool, newFixedThreadPool, newScheduledThreadPool, run, runSync, runSync, setContext`

  ### Methods inherited from class ru.bitel.bgbilling.kernel.base.server.logger.BGLogger

  `error, error, error, getLogger, logError, logError, warn`

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

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

- ## Constructor Details

  - ### OrderManagerDeviceWorker

    public OrderManagerDeviceWorker(ru.bitel.bgbilling.apps.tv.access.TvAccess access, ScheduledExecutorService scheduledExecutorService, int deviceId) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

- ## Method Details

  - ### runImpl

    protected void runImpl() throws Exception
    Overrides:
      `runImpl` in class `EventWorker`
    Throws:
      `Exception`

  - ### runWorker

    protected boolean runWorker() throws ru.bitel.bgbilling.common.BGException
    Description copied from class: `EventWorker`
    Вызывается, когда появляются задачи. Внутри данного метода нужно вызвать `EventWorker.doTasks()`, который выполняет последовательно появившиеся задачи. А перед и после вызова `EventWorker.doTasks()` можно инициализировать и освободить DAO.
    Specified by:
      `runWorker` in class `EventWorker`
    Returns:
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### doTask

    public Object doTask(Object task) throws ru.bitel.bgbilling.common.BGException
    Выполнение отдельной задачи. Очень важная часть - правильная реакция на события.
    Specified by:
      `doTask` in class `EventWorker`
    Parameters:
      `task` -
    Returns:
      обычно null.
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### taskDone

    protected void taskDone(Object task, Object result) throws ru.bitel.bgbilling.common.BGException
    Specified by:
      `taskDone` in class `AsyncEventWorker<ru.bitel.bgbilling.kernel.event.common.Event>`
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### processDoTaskException

    protected void processDoTaskException(Object task, boolean inDoTask, boolean putFirstIfInDoTask, ru.bitel.bgbilling.common.BGException ex, boolean throwException) throws ru.bitel.bgbilling.common.BGException
    Overrides:
      `processDoTaskException` in class `AsyncEventWorker<ru.bitel.bgbilling.kernel.event.common.Event>`
    Parameters:
      `task` -
      `inDoTask` - ошибка произошла в doTask или позже
      `putFirstIfInDoTask` -
      `ex` -
      `throwException` -
    Throws:
      `ru.bitel.bgbilling.common.BGException`