Class HazelcastMetadataStore
java.lang.Object
org.springframework.integration.hazelcast.metadata.HazelcastMetadataStore
- All Implemented Interfaces:
InitializingBean
,ConcurrentMetadataStore
,ListenableMetadataStore
,MetadataStore
public class HazelcastMetadataStore
extends Object
implements ListenableMetadataStore, InitializingBean
The Hazelcast
IMap
-based ListenableMetadataStore
implementation.- Author:
- Vinicius Carvalho, Artem Bilan
-
Constructor Summary
ConstructorDescriptionHazelcastMetadataStore
(com.hazelcast.core.HazelcastInstance hazelcastInstance) HazelcastMetadataStore
(com.hazelcast.map.IMap<String, String> map) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(MetadataStoreListener callback) Register a listener with the metadata store.void
Reads a value for the given key from this MetadataStore.void
Writes a key value pair to this MetadataStore.putIfAbsent
(String key, String value) Atomically insert the key into the store.Remove a value for the given key from this MetadataStore.void
removeListener
(MetadataStoreListener callback) Unregister a listener.boolean
Atomically replace the value for the key in the store if the old value matches the oldValue argument.
-
Constructor Details
-
HazelcastMetadataStore
public HazelcastMetadataStore(com.hazelcast.core.HazelcastInstance hazelcastInstance) -
HazelcastMetadataStore
-
-
Method Details
-
putIfAbsent
Description copied from interface:ConcurrentMetadataStore
Atomically insert the key into the store.- Specified by:
putIfAbsent
in interfaceConcurrentMetadataStore
- Parameters:
key
- The key.value
- The value.- Returns:
- null if successful, the old value otherwise.
-
replace
Description copied from interface:ConcurrentMetadataStore
Atomically replace the value for the key in the store if the old value matches the oldValue argument.- Specified by:
replace
in interfaceConcurrentMetadataStore
- Parameters:
key
- The key.oldValue
- The old value.newValue
- The new value.- Returns:
- true if successful.
-
put
Description copied from interface:MetadataStore
Writes a key value pair to this MetadataStore.- Specified by:
put
in interfaceMetadataStore
- Parameters:
key
- The key.value
- The value.
-
get
Description copied from interface:MetadataStore
Reads a value for the given key from this MetadataStore.- Specified by:
get
in interfaceMetadataStore
- Parameters:
key
- The key.- Returns:
- The value.
-
remove
Description copied from interface:MetadataStore
Remove a value for the given key from this MetadataStore.- Specified by:
remove
in interfaceMetadataStore
- Parameters:
key
- The key.- Returns:
- The previous value associated with key, or null if there was no mapping for key.
-
addListener
Description copied from interface:ListenableMetadataStore
Register a listener with the metadata store.- Specified by:
addListener
in interfaceListenableMetadataStore
- Parameters:
callback
- the callback to be registered
-
removeListener
Description copied from interface:ListenableMetadataStore
Unregister a listener.- Specified by:
removeListener
in interfaceListenableMetadataStore
- Parameters:
callback
- the callback to be unregistered
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceInitializingBean
-