Class ClusteredReplicationPauserManager
java.lang.Object
com.atlassian.jira.cluster.cache.pauser.ClusteredReplicationPauserManager
- All Implemented Interfaces:
ReplicationPauserManager
@Internal
public class ClusteredReplicationPauserManager
extends Object
implements ReplicationPauserManager
Allows to run "some code" without triggering replication in clustered Jira
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if replication is paused for current threadvoid
pauseReplicationFor
(Runnable codeWillNotTriggerCacheReplication, String logContext) Disables sending cache replication events for the time of running codeWillNotTriggerCacheReplication.void
Start pausing the replication context.void
-
Constructor Details
-
ClusteredReplicationPauserManager
public ClusteredReplicationPauserManager()
-
-
Method Details
-
isReplicationPaused
public boolean isReplicationPaused()Description copied from interface:ReplicationPauserManager
Checks if replication is paused for current thread- Specified by:
isReplicationPaused
in interfaceReplicationPauserManager
-
pauseReplicationFor
Description copied from interface:ReplicationPauserManager
Disables sending cache replication events for the time of running codeWillNotTriggerCacheReplication. Note that codeWillNotTriggerCacheReplication should be run in the calling thread, i.e. only the code running in the calling thread will have the cache replication paused.- Specified by:
pauseReplicationFor
in interfaceReplicationPauserManager
- Parameters:
codeWillNotTriggerCacheReplication
- - code to be run without cache replicationlogContext
- - log context to be able to understand the reason cache replication is paused
-
start
Start pausing the replication context. Make surestop(String)
is called (in finally block) - if not this thread will stop replicate cache operations! -
stop
-