public class ServiceActivatorDeviceWorker extends AsyncEventWorker<Event>
| Modifier and Type | Field and Description |
|---|---|
protected long |
connectErrorCount |
protected long |
errorAlarmCount |
protected long |
errorRedeliveryCount |
protected long |
errorRedeliveryTimeout |
batchPause, batchSize, errorCount, needAcknowledge, waitNextTaskbatchWait, consumer, errorPause, moduleId, working| Constructor and Description |
|---|
ServiceActivatorDeviceWorker(ru.bitel.bgbilling.modules.inet.access.Access access,
java.util.concurrent.ScheduledExecutorService scheduledExecutorService,
int deviceId,
long fetchDelay,
long fetchTimeout) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
doTask(java.lang.Object task)
Выполнение отдельной задачи.
|
void |
execute() |
int |
getDeviceId() |
ru.bitel.bgbilling.modules.inet.runtime.device.InetDeviceRuntime |
getDeviceRuntime() |
protected void |
processDoTaskException(java.lang.Object task,
boolean inDoTask,
boolean putFirstIfInDoTask,
ru.bitel.bgbilling.common.BGException ex,
boolean throwException) |
void |
putLast(java.lang.Object task) |
protected void |
runImpl() |
protected boolean |
runWorker()
Вызывается, когда появляются задачи.
|
void |
skipEvent() |
void |
start() |
protected void |
taskDone(java.lang.Object task,
java.lang.Object result) |
protected void |
taskTimeout(java.lang.Object task) |
java.lang.String |
toString() |
doTasks, internalDoTask, notify, poll, putFirstinternalRunWorker, pollFirstTask, setConsumer, shutdownprotected long errorAlarmCount
protected long errorRedeliveryCount
protected long errorRedeliveryTimeout
protected long connectErrorCount
public ServiceActivatorDeviceWorker(ru.bitel.bgbilling.modules.inet.access.Access access,
java.util.concurrent.ScheduledExecutorService scheduledExecutorService,
int deviceId,
long fetchDelay,
long fetchTimeout)
throws ru.bitel.bgbilling.common.BGException
ru.bitel.bgbilling.common.BGExceptionpublic int getDeviceId()
public ru.bitel.bgbilling.modules.inet.runtime.device.InetDeviceRuntime getDeviceRuntime()
public void start()
protected void runImpl()
throws java.lang.Exception
runImpl in class EventWorkerjava.lang.Exceptionpublic void execute()
protected boolean runWorker()
throws ru.bitel.bgbilling.common.BGException
EventWorkerEventWorker.doTasks(), который выполняет последовательно появившиеся задачи.
А перед и после вызова EventWorker.doTasks() можно инициализировать и освободить DAO.runWorker in class EventWorkerru.bitel.bgbilling.common.BGExceptionpublic final void putLast(java.lang.Object task)
throws java.lang.InterruptedException
putLast in class AsyncEventWorker<Event>java.lang.InterruptedExceptionpublic java.lang.Object doTask(java.lang.Object task)
throws ru.bitel.bgbilling.common.BGException
doTask in class EventWorkerru.bitel.bgbilling.common.BGExceptionprotected void taskDone(java.lang.Object task,
java.lang.Object result)
throws ru.bitel.bgbilling.common.BGException
taskDone in class AsyncEventWorker<Event>ru.bitel.bgbilling.common.BGExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic void skipEvent()
protected void processDoTaskException(java.lang.Object task,
boolean inDoTask,
boolean putFirstIfInDoTask,
ru.bitel.bgbilling.common.BGException ex,
boolean throwException)
throws ru.bitel.bgbilling.common.BGException
processDoTaskException in class AsyncEventWorker<Event>inDoTask - ошибка произошла в doTask или позжеru.bitel.bgbilling.common.BGExceptionprotected void taskTimeout(java.lang.Object task)
taskTimeout in class AsyncEventWorker<Event>