Class ServiceActivatorDeviceWorker
java.lang.Object
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.inet.access.sa.ServiceActivatorDeviceWorker
- All Implemented Interfaces:
Runnable,EventListener<ru.bitel.bgbilling.kernel.event.common.Event>
public class ServiceActivatorDeviceWorker
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
FieldsModifier and TypeFieldDescriptionprotected longprotected longprotected longprotected longFields inherited from class ru.bitel.bgbilling.kernel.event.AsyncEventWorker
batchPause, batchSize, errorCount, needAcknowledge, waitNextTaskFields inherited from class ru.bitel.bgbilling.kernel.event.EventWorker
batchWait, consumer, errorPause, moduleId, workingFields inherited from class ru.bitel.common.worker.WorkerTask
context -
Constructor Summary
ConstructorsConstructorDescriptionServiceActivatorDeviceWorker(ru.bitel.bgbilling.apps.inet.access.Access access, ScheduledExecutorService scheduledExecutorService, int deviceId, long fetchDelay, long fetchTimeout) -
Method Summary
Modifier and TypeMethodDescriptionВыполнение отдельной задачи.voidexecute()intru.bitel.bgbilling.modules.inet.server.runtime.device.InetDeviceRuntimeprotected voidprocessDoTaskException(Object task, boolean inDoTask, boolean putFirstIfInDoTask, ru.bitel.bgbilling.common.BGException ex, boolean throwException) final voidprotected voidrunImpl()protected booleanВызывается, когда появляются задачи.voidvoidstart()protected voidprotected voidtaskTimeout(Object task) toString()Methods inherited from class ru.bitel.bgbilling.kernel.event.AsyncEventWorker
doTasks, internalDoTask, notify, poll, putFirstMethods inherited from class ru.bitel.bgbilling.kernel.event.EventWorker
internalRunWorker, pollFirstTask, setConsumer, shutdownMethods inherited from class ru.bitel.common.worker.WorkerTask
getLogger, newBlockingFixedThreadPool, newFixedThreadPool, newFixedThreadPool, newScheduledThreadPool, run, runSync, runSync, setContext
-
Field Details
-
errorAlarmCount
protected long errorAlarmCount -
errorRedeliveryCount
protected long errorRedeliveryCount -
errorRedeliveryTimeout
protected long errorRedeliveryTimeout -
connectErrorCount
protected long connectErrorCount
-
-
Constructor Details
-
ServiceActivatorDeviceWorker
public ServiceActivatorDeviceWorker(ru.bitel.bgbilling.apps.inet.access.Access access, ScheduledExecutorService scheduledExecutorService, int deviceId, long fetchDelay, long fetchTimeout) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
-
Method Details
-
start
public void start() -
getDeviceId
public int getDeviceId() -
getDeviceRuntime
public ru.bitel.bgbilling.modules.inet.server.runtime.device.InetDeviceRuntime getDeviceRuntime() -
runImpl
- Overrides:
runImplin classEventWorker- Throws:
Exception
-
execute
public void execute() -
runWorker
protected boolean runWorker() throws ru.bitel.bgbilling.common.BGExceptionDescription copied from class:EventWorkerВызывается, когда появляются задачи. Внутри данного метода нужно вызватьEventWorker.doTasks(), который выполняет последовательно появившиеся задачи. А перед и после вызоваEventWorker.doTasks()можно инициализировать и освободить DAO.- Specified by:
runWorkerin classEventWorker- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
putLast
- Overrides:
putLastin classAsyncEventWorker<ru.bitel.bgbilling.kernel.event.common.Event>- Throws:
InterruptedException
-
doTask
Выполнение отдельной задачи. Очень важная часть - правильная реакция на события.- Specified by:
doTaskin classEventWorker- Returns:
- обычно null.
- Throws:
ru.bitel.bgbilling.common.BGException
-
taskDone
- Specified by:
taskDonein classAsyncEventWorker<ru.bitel.bgbilling.kernel.event.common.Event>- Throws:
ru.bitel.bgbilling.common.BGException
-
toString
-
skipEvent
public void skipEvent() -
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:
processDoTaskExceptionin classAsyncEventWorker<ru.bitel.bgbilling.kernel.event.common.Event>inDoTask- ошибка произошла в doTask или позже- Throws:
ru.bitel.bgbilling.common.BGException
-
taskTimeout
- Overrides:
taskTimeoutin classAsyncEventWorker<ru.bitel.bgbilling.kernel.event.common.Event>
-