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
ConstructorDescriptionOrderManagerDeviceWorker
(ru.bitel.bgbilling.apps.tv.access.TvAccess access, ScheduledExecutorService scheduledExecutorService, int deviceId) -
Method Summary
Modifier and TypeMethodDescriptionВыполнение отдельной задачи.protected void
processDoTaskException
(Object task, boolean inDoTask, boolean putFirstIfInDoTask, ru.bitel.bgbilling.common.BGException ex, boolean throwException) protected void
runImpl()
protected boolean
Вызывается, когда появляются задачи.protected void
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
-
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
- Overrides:
runImpl
in classEventWorker
- Throws:
Exception
-
runWorker
protected boolean runWorker() throws ru.bitel.bgbilling.common.BGExceptionDescription copied from class:EventWorker
Вызывается, когда появляются задачи. Внутри данного метода нужно вызватьEventWorker.doTasks()
, который выполняет последовательно появившиеся задачи. А перед и после вызоваEventWorker.doTasks()
можно инициализировать и освободить DAO.- Specified by:
runWorker
in classEventWorker
- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
doTask
Выполнение отдельной задачи. Очень важная часть - правильная реакция на события.- Specified by:
doTask
in classEventWorker
- Returns:
- обычно null.
- Throws:
ru.bitel.bgbilling.common.BGException
-
taskDone
- Specified by:
taskDone
in classAsyncEventWorker<ru.bitel.bgbilling.kernel.event.common.Event>
- Throws:
ru.bitel.bgbilling.common.BGException
-
toString
-
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 classAsyncEventWorker<ru.bitel.bgbilling.kernel.event.common.Event>
inDoTask
- ошибка произошла в doTask или позже- Throws:
ru.bitel.bgbilling.common.BGException
-