com.atlassian.confluence.cluster.hazelcast.shareddata
Class HazelcastPluginSharedDataStore

java.lang.Object
  extended by com.atlassian.confluence.cluster.hazelcast.shareddata.HazelcastPluginSharedDataStore
All Implemented Interfaces:
PluginSharedDataStore

@Internal
public class HazelcastPluginSharedDataStore
extends Object
implements PluginSharedDataStore

A Hazelcast-specific implementation of PluginSharedDataStore. Use a combination of distributed collections to keep the shared data synchronized between cluster nodes, and to record which plugins are using which shared data.

Since:
5.7

Constructor Summary
HazelcastPluginSharedDataStore(com.google.common.base.Supplier<com.hazelcast.core.HazelcastInstance> hazelcastRef)
           
 
Method Summary
 SharedData getPluginSharedData(PluginSharedDataKey sharedDataKey, com.atlassian.plugin.Plugin plugin)
          Obtain the stored SharedData instance for the given key and plugin information
 void unregisterPluginSharedData(com.atlassian.plugin.Plugin plugin)
          When a plugin gets uninstalled from the current cluster node, try and clean up.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HazelcastPluginSharedDataStore

public HazelcastPluginSharedDataStore(com.google.common.base.Supplier<com.hazelcast.core.HazelcastInstance> hazelcastRef)
Method Detail

getPluginSharedData

public SharedData getPluginSharedData(PluginSharedDataKey sharedDataKey,
                                      com.atlassian.plugin.Plugin plugin)
Description copied from interface: PluginSharedDataStore
Obtain the stored SharedData instance for the given key and plugin information

Specified by:
getPluginSharedData in interface PluginSharedDataStore

unregisterPluginSharedData

public void unregisterPluginSharedData(com.atlassian.plugin.Plugin plugin)
When a plugin gets uninstalled from the current cluster node, try and clean up. If other nodes are still using the shared data, then we don't do anything, but if this is the last cluster node to unregister, then we clear the shared data map to prevent a memory leak. Note that Hazelcast des not allow us to remove the actual shared map itself, so we have to settle for just removing its contents.

Specified by:
unregisterPluginSharedData in interface PluginSharedDataStore


Copyright © 2003–2015 Atlassian. All rights reserved.