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.Meter
private final Semaphore
private static final Protocol.ErrorReplyFactory
private static final Protocol.ErrorReplyFactory
private com.codahale.metrics.Timer
Fields inherited from class ch.rswk.meta.engine.AbstractEngineIdleService
runtime
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
afterProcessWorkUnit
(T unit) protected void
beforeProcessWorkUnit
(T unit) protected boolean
protected com.google.common.util.concurrent.ListenableFuture
<R> offerWorkUnit
(T unit) protected abstract R
processWorkUnit
(T unit) protected void
startUp()
Methods inherited from class ch.rswk.meta.engine.AbstractEngineIdleService
configClass, configReference, onConfigWatcherNotification, serviceId, serviceName, shutDown
Methods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, startAsync, state, stopAsync, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.rswk.meta.engine.EngineServices.ConfigurableService
config, handleConfigWatcherNotification, onConfigChanged
Methods 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:
startUp
in classAbstractEngineIdleService<C>
- Throws:
Exception
-