Package org.nuxeo.runtime.pubsub
Class ClusterActionServiceImpl
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.runtime.pubsub.ClusterActionServiceImpl
- All Implemented Interfaces:
Adaptable
,Component
,Extensible
,ClusterActionService
,TimestampedService
- Since:
- 2023.0
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
PubSub to propagate an action to all nodes in the cluster. -
Field Summary
Modifier and TypeFieldDescriptionprotected final Map<String,
Consumer<ClusterActionMessage>> static final String
static final String
static final String
static final String
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate
(ComponentContext context) Activates the component.void
executeAction
(ClusterActionMessage message) Propagate an action to all others nodes in the cluster.protected Consumer<ClusterActionMessage>
int
The component notification order forComponent.start(ComponentContext)
.void
registerAction
(String action, Consumer<ClusterActionMessage> consumer) Registers an action for a requested propagationvoid
start
(ComponentContext context) Start the component.void
stop
(ComponentContext context) Stop the component.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtension
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.runtime.pubsub.ClusterActionService
executeAction
-
Field Details
-
STREAM_START_PROCESSOR_ACTION
- See Also:
-
STREAM_STOP_PROCESSOR_ACTION
- See Also:
-
STREAM_START_CONSUMER_ACTION
- See Also:
-
STREAM_STOP_CONSUMER_ACTION
- See Also:
-
clusterActions
-
clusterActionPubSub
-
-
Constructor Details
-
ClusterActionServiceImpl
public ClusterActionServiceImpl()
-
-
Method Details
-
activate
Description copied from interface:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
start
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
stop
Description copied from interface:Component
Stop the component.- Specified by:
stop
in interfaceComponent
- Overrides:
stop
in classDefaultComponent
- Throws:
InterruptedException
-
getApplicationStartedOrder
public int getApplicationStartedOrder()Description copied from interface:Component
The component notification order forComponent.start(ComponentContext)
.Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.
- Specified by:
getApplicationStartedOrder
in interfaceComponent
- Returns:
- the order, 1000 by default
-
registerAction
Description copied from interface:ClusterActionService
Registers an action for a requested propagation- Specified by:
registerAction
in interfaceClusterActionService
-
getAction
-
executeAction
Description copied from interface:ClusterActionService
Propagate an action to all others nodes in the cluster.- Specified by:
executeAction
in interfaceClusterActionService
-