Package ch.rswk.meta.engine
Class AbstractEngineWorkQueueService<C,T,R>
java.lang.Object
com.google.common.util.concurrent.AbstractExecutionThreadService
ch.rswk.meta.engine.AbstractEngineExecutionThreadService<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
public abstract class AbstractEngineWorkQueueService<C,T,R>
extends AbstractEngineExecutionThreadService<C>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordNested 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 static final org.slf4j.Loggerprivate static final AbstractEngineWorkQueueService.Wrapper<Object, Object> private com.codahale.metrics.Meterprivate final BlockingDeque<AbstractEngineWorkQueueService.Wrapper<T, R>> private static final Protocol.ErrorReplyFactoryprivate static final Protocol.ErrorReplyFactoryprivate com.codahale.metrics.TimerFields inherited from class ch.rswk.meta.engine.AbstractEngineExecutionThreadService
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 voidrun()protected voidstartUp()protected voidMethods inherited from class ch.rswk.meta.engine.AbstractEngineExecutionThreadService
configClass, configReference, onConfigWatcherNotification, serviceId, serviceName, shutDownMethods inherited from class com.google.common.util.concurrent.AbstractExecutionThreadService
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
-
LOG
private static final org.slf4j.Logger LOG -
POISON
-
WORK_QUEUE_ERROR
-
WORK_UNIT_ERROR
-
queue
-
processErrorMeter
private com.codahale.metrics.Meter processErrorMeter -
workUnitTimer
private com.codahale.metrics.Timer workUnitTimer
-
-
Constructor Details
-
AbstractEngineWorkQueueService
-
-
Method Details
-
startUp
- Overrides:
startUpin classAbstractEngineExecutionThreadService<C>- Throws:
Exception
-
triggerShutdown
protected void triggerShutdown()- Overrides:
triggerShutdownin classcom.google.common.util.concurrent.AbstractExecutionThreadService
-
offerWorkUnit
-
isWorkQueueEmpty
protected boolean isWorkQueueEmpty() -
run
-
beforeProcessWorkUnit
-
processWorkUnit
- Throws:
ErrorReplyException
-
afterProcessWorkUnit
-