public class AtomicCounterEditorProvider extends java.lang.Object implements EditorProvider
AtomicCounterEditor
. See AtomicCounterEditor
for
behavioural details.Constructor and Description |
---|
AtomicCounterEditorProvider()
OSGi oriented constructor where all the required dependencies will be taken care of.
|
AtomicCounterEditorProvider(@Nullable java.util.function.Supplier<Clusterable> clusterInfo,
@Nullable java.util.function.Supplier<java.util.concurrent.ScheduledExecutorService> executor,
@Nullable java.util.function.Supplier<NodeStore> store,
@Nullable java.util.function.Supplier<Whiteboard> whiteboard)
Plain Java oriented constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
activate(org.osgi.framework.BundleContext context) |
protected void |
bindCluster(Clusterable store) |
protected void |
bindStore(NodeStore store) |
void |
deactivate() |
Editor |
getRootEditor(NodeState before,
NodeState after,
NodeBuilder builder,
CommitInfo info)
Returns an editor for processing changes between the given two states.
|
protected void |
unbindCluster(Clusterable store) |
protected void |
unbindStore(NodeStore store) |
public AtomicCounterEditorProvider()
public AtomicCounterEditorProvider(@Nullable @Nullable java.util.function.Supplier<Clusterable> clusterInfo, @Nullable @Nullable java.util.function.Supplier<java.util.concurrent.ScheduledExecutorService> executor, @Nullable @Nullable java.util.function.Supplier<NodeStore> store, @Nullable @Nullable java.util.function.Supplier<Whiteboard> whiteboard)
Plain Java oriented constructor. Refer to
AtomicCounterEditor(NodeBuilder, String, ScheduledExecutorService, NodeStore, Whiteboard)
for constructions details of the actual editor.
Based on the use case this may need an already set of the constructor parameters during the repository construction. Please ensure they're registered before this provider is registered.
clusterInfo
- cluster node informationexecutor
- the executor for running asynchronously.store
- reference to the NodeStore.whiteboard
- the underlying board for picking up the registered CommitHook
public void activate(org.osgi.framework.BundleContext context)
public void deactivate()
protected void bindCluster(Clusterable store)
protected void unbindCluster(Clusterable store)
protected void bindStore(NodeStore store)
protected void unbindStore(NodeStore store)
public Editor getRootEditor(NodeState before, NodeState after, NodeBuilder builder, CommitInfo info) throws CommitFailedException
EditorProvider
null
if the changes don't require processing.
An implementation of this method should generally not compare the
given before and after states, as the caller is expected to compare
the states and invoke the respective callback methods on the
Editor
instance returned by this method. Instead the
implementation can use the opportunity for other preparatory work.
getRootEditor
in interface EditorProvider
before
- original root stateafter
- modified root statebuilder
- node builder based on the after stateinfo
- metadata associated with this commitnull
CommitFailedException
- if processing failedCopyright © 2012–2022 The Apache Software Foundation. All rights reserved.