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, waitNextTask
batchWait, 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, putFirst
internalRunWorker, pollFirstTask, setConsumer, shutdown
protected 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.BGException
public 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 EventWorker
java.lang.Exception
public void execute()
protected boolean runWorker() throws ru.bitel.bgbilling.common.BGException
EventWorker
EventWorker.doTasks()
, который выполняет последовательно появившиеся задачи.
А перед и после вызова EventWorker.doTasks()
можно инициализировать и освободить DAO.runWorker
in class EventWorker
ru.bitel.bgbilling.common.BGException
public final void putLast(java.lang.Object task) throws java.lang.InterruptedException
putLast
in class AsyncEventWorker<Event>
java.lang.InterruptedException
public java.lang.Object doTask(java.lang.Object task) throws ru.bitel.bgbilling.common.BGException
doTask
in class EventWorker
ru.bitel.bgbilling.common.BGException
protected 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.BGException
public java.lang.String toString()
toString
in class java.lang.Object
public 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.BGException
protected void taskTimeout(java.lang.Object task)
taskTimeout
in class AsyncEventWorker<Event>