Package ch.rswk.meta.engine
Class AbstractEngineWorkQueueService<C,T,R>
java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
ch.rswk.meta.engine.AbstractEngineIdleService<C>
ch.rswk.meta.engine.AbstractEngineWorkQueueService<C,T,R>
- All Implemented Interfaces:
EngineServices.ConfigurableService<C>,EngineServices.InfoProvidingService,com.google.common.util.concurrent.Service
- Direct Known Subclasses:
LuceneService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate com.codahale.metrics.Meterprivate final Semaphoreprivate static final Protocol.ErrorReplyFactoryprivate static final Protocol.ErrorReplyFactoryprivate com.codahale.metrics.TimerFields inherited from class ch.rswk.meta.engine.AbstractEngineIdleService
runtime -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterProcessWorkUnit(T unit) protected voidbeforeProcessWorkUnit(T unit) protected booleanprotected com.google.common.util.concurrent.ListenableFuture<R> offerWorkUnit(T unit) protected abstract RprocessWorkUnit(T unit) protected voidstartUp()Methods inherited from class ch.rswk.meta.engine.AbstractEngineIdleService
configClass, configReference, onConfigWatcherNotification, serviceId, serviceName, shutDownMethods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, startAsync, state, stopAsync, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.rswk.meta.engine.EngineServices.ConfigurableService
config, handleConfigWatcherNotification, onConfigChangedMethods inherited from interface ch.rswk.meta.engine.EngineServices.InfoProvidingService
getServiceInfo
-
Field Details
-
WORK_QUEUE_ERROR
-
WORK_UNIT_ERROR
-
semaphore
-
processErrorMeter
private com.codahale.metrics.Meter processErrorMeter -
workUnitTimer
private com.codahale.metrics.Timer workUnitTimer
-
-
Constructor Details
-
AbstractEngineWorkQueueService
-
-
Method Details
-
isWorkQueueEmpty
protected boolean isWorkQueueEmpty() -
offerWorkUnit
-
beforeProcessWorkUnit
-
processWorkUnit
- Throws:
ErrorReplyException
-
afterProcessWorkUnit
-
startUp
- Overrides:
startUpin classAbstractEngineIdleService<C>- Throws:
Exception
-