Module io.github.bucket4j.hazelcast
Class HazelcastProxyManager<K>
- java.lang.Object
-
- io.github.bucket4j.distributed.proxy.AbstractProxyManager<K>
-
- io.github.bucket4j.grid.hazelcast.HazelcastProxyManager<K>
-
- All Implemented Interfaces:
ProxyManager<K>
public class HazelcastProxyManager<K> extends AbstractProxyManager<K>
The extension of Bucket4j library addressed to support Hazelcast in-memory data grid.
-
-
Constructor Summary
Constructors Constructor Description HazelcastProxyManager(com.hazelcast.map.IMap<K,byte[]> map)HazelcastProxyManager(com.hazelcast.map.IMap<K,byte[]> map, ClientSideConfig clientSideConfig)HazelcastProxyManager(com.hazelcast.map.IMap<K,byte[]> map, ClientSideConfig clientSideConfig, String offlodableExecutorName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddCustomSerializers(com.hazelcast.config.SerializationConfig serializationConfig, int typeIdBase)Registers custom Hazelcast serializers for all classes from Bucket4j library which can be transferred over network.<T> CommandResult<T>execute(K key, Request<T> request)<T> CompletableFuture<CommandResult<T>>executeAsync(K key, Request<T> request)booleanisAsyncModeSupported()booleanisExpireAfterWriteSupported()protected CompletableFuture<Void>removeAsync(K key)voidremoveProxy(K key)-
Methods inherited from class io.github.bucket4j.distributed.proxy.AbstractProxyManager
asAsync, builder, getBackwardCompatibilityVersion, getClientSideConfig, getClientSideTime, getProxyConfiguration
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.bucket4j.distributed.proxy.ProxyManager
withMapper
-
-
-
-
Constructor Detail
-
HazelcastProxyManager
public HazelcastProxyManager(com.hazelcast.map.IMap<K,byte[]> map)
-
HazelcastProxyManager
public HazelcastProxyManager(com.hazelcast.map.IMap<K,byte[]> map, ClientSideConfig clientSideConfig)
-
HazelcastProxyManager
public HazelcastProxyManager(com.hazelcast.map.IMap<K,byte[]> map, ClientSideConfig clientSideConfig, String offlodableExecutorName)
-
-
Method Detail
-
execute
public <T> CommandResult<T> execute(K key, Request<T> request)
- Specified by:
executein classAbstractProxyManager<K>
-
isAsyncModeSupported
public boolean isAsyncModeSupported()
-
isExpireAfterWriteSupported
public boolean isExpireAfterWriteSupported()
-
executeAsync
public <T> CompletableFuture<CommandResult<T>> executeAsync(K key, Request<T> request)
- Specified by:
executeAsyncin classAbstractProxyManager<K>
-
removeProxy
public void removeProxy(K key)
-
removeAsync
protected CompletableFuture<Void> removeAsync(K key)
- Specified by:
removeAsyncin classAbstractProxyManager<K>
-
addCustomSerializers
public static void addCustomSerializers(com.hazelcast.config.SerializationConfig serializationConfig, int typeIdBase)Registers custom Hazelcast serializers for all classes from Bucket4j library which can be transferred over network. Each serializer will have different typeId, and this id will not be changed in the feature releases.Note: it would be better to leave an empty space in the Ids in order to handle the extension of Bucket4j library when new classes can be added to library. For example if you called
getAllSerializers(10000)then it would be reasonable to avoid registering your custom types in the interval 10000-10100.- Parameters:
typeIdBase- a starting number from for typeId sequence
-
-