Package ch.rswk.meta.engine
Class ActionService
java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
ch.rswk.meta.engine.AbstractEngineIdleService<ActionService.ActionServiceConfig>
ch.rswk.meta.engine.ActionService
- All Implemented Interfaces:
EngineServices.ConfigurableService<ActionService.ActionServiceConfig>,EngineServices.InfoProvidingService,com.google.common.util.concurrent.Service
@Singleton
public class ActionService
extends AbstractEngineIdleService<ActionService.ActionServiceConfig>
ActionService receives and dispatches
MetaAction to services that are registered to handle them. Does validation of parameter and
result schemas, in case schemas are defined.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic final recordprivate 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 final Map<String, ActionService.DelegateWrapper> private com.codahale.metrics.Meterprivate com.codahale.metrics.Meterprivate static final Protocol.ErrorReplyFactoryprivate static final Protocol.ErrorReplyFactoryprivate static final Protocol.ErrorReplyFactoryprivate static final org.slf4j.Loggerprivate final MetaServiceprivate static final Protocol.ErrorReplyFactoryprivate com.codahale.metrics.Meterprivate com.codahale.metrics.Meterprivate static final Protocol.ErrorReplyFactoryprivate static final Protocol.ErrorReplyFactoryprivate final MetaValidatorFields inherited from class ch.rswk.meta.engine.AbstractEngineIdleService
runtime -
Constructor Summary
ConstructorsConstructorDescriptionActionService(ActionService.ActionServiceConfig config, MetaService metaService, EngineRuntime runtime, MetaValidator validator) -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.util.concurrent.ListenableFuture<ExecuteReply> execute(@Nullable String clientId, @Nullable String ipAddress, ExecuteRequest request, @Nullable String userName) com.google.common.util.concurrent.ListenableFuture<Void> registerExecuteDelegate(String actionId, ActionService.ActionExecuteDelegate delegate) protected voidshutDown()protected voidstartUp()Methods inherited from class ch.rswk.meta.engine.AbstractEngineIdleService
configClass, configReference, onConfigWatcherNotification, serviceId, serviceNameMethods 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
-
LOG
private static final org.slf4j.Logger LOG -
EXECUTION_ERROR
-
INVALID_PARAM_ERROR
-
INVALID_RESULT_ERROR
-
NO_ACTIONID_ERROR
-
UNHANDLED_ACTION_ERROR
-
UNKNOWN_ACTION_ERROR
-
delegates
-
metaService
-
validator
-
executeErrorMeter
private com.codahale.metrics.Meter executeErrorMeter -
executeMeter
private com.codahale.metrics.Meter executeMeter -
paramErrorMeter
private com.codahale.metrics.Meter paramErrorMeter -
resultErrorMeter
private com.codahale.metrics.Meter resultErrorMeter
-
-
Constructor Details
-
ActionService
@Inject public ActionService(ActionService.ActionServiceConfig config, MetaService metaService, EngineRuntime runtime, MetaValidator validator)
-
-
Method Details
-
execute
public com.google.common.util.concurrent.ListenableFuture<ExecuteReply> execute(@Nullable String clientId, @Nullable String ipAddress, ExecuteRequest request, @Nullable String userName) -
registerExecuteDelegate
public com.google.common.util.concurrent.ListenableFuture<Void> registerExecuteDelegate(String actionId, ActionService.ActionExecuteDelegate delegate) -
startUp
- Overrides:
startUpin classAbstractEngineIdleService<ActionService.ActionServiceConfig>- Throws:
Exception
-
shutDown
- Overrides:
shutDownin classAbstractEngineIdleService<ActionService.ActionServiceConfig>- Throws:
Exception
-