Module io.github.bucket4j.core
Class AbstractSelectForUpdateBasedProxyManager<K>
java.lang.Object
io.github.bucket4j.distributed.proxy.AbstractProxyManager<K>
io.github.bucket4j.distributed.proxy.generic.select_for_update.AbstractSelectForUpdateBasedProxyManager<K>
- Type Parameters:
K- the generic type for unique identifiers that used to point to the bucket in external storage.
- All Implemented Interfaces:
ProxyManager<K>
The base class for proxy managers that built on top of idea that underlining storage provide Compare-And-Swap functionality.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSelectForUpdateBasedProxyManager(ClientSideConfig clientSideConfig) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract SelectForUpdateBasedTransactionallocateTransaction(K key, Optional<Long> timeoutNanos) protected voidapplyTimeout(PreparedStatement statement, Optional<Long> requestTimeoutNanos) <T> CommandResult<T><T> CompletableFuture<CommandResult<T>>executeAsync(K key, Request<T> request) booleanDescribes whether this manager supports asynchronous API.protected CompletableFuture<Void>removeAsync(Object key) Methods inherited from class io.github.bucket4j.distributed.proxy.AbstractProxyManager
asAsync, builder, currentTimeNanos, getBackwardCompatibilityVersion, getClientSideConfig, getClientSideTime, getProxyConfigurationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.bucket4j.distributed.proxy.ProxyManager
getProxy, isExpireAfterWriteSupported, removeProxy, withMapper
-
Constructor Details
-
AbstractSelectForUpdateBasedProxyManager
-
-
Method Details
-
execute
- Specified by:
executein classAbstractProxyManager<K>
-
isAsyncModeSupported
public boolean isAsyncModeSupported()Description copied from interface:ProxyManagerDescribes whether this manager supports asynchronous API. If this method returnsfalsethen any invocation ofProxyManager.asAsync()will throwUnsupportedOperationException.- Returns:
trueif this manager supports asynchronous API
-
executeAsync
- Specified by:
executeAsyncin classAbstractProxyManager<K>
-
removeAsync
- Specified by:
removeAsyncin classAbstractProxyManager<K>
-
allocateTransaction
protected abstract SelectForUpdateBasedTransaction allocateTransaction(K key, Optional<Long> timeoutNanos) -
applyTimeout
protected void applyTimeout(PreparedStatement statement, Optional<Long> requestTimeoutNanos) throws SQLException - Throws:
SQLException
-