Class RateLimitedCreateLifeCycle<T>
- java.lang.Object
-
- com.linkedin.alpini.base.pool.impl.LifeCycleFilter<T>
-
- com.linkedin.alpini.base.pool.impl.RateLimitedCreateLifeCycle<T>
-
- All Implemented Interfaces:
AsyncPool.LifeCycle<T>
public class RateLimitedCreateLifeCycle<T> extends LifeCycleFilter<T>
-
-
Constructor Summary
Constructors Constructor Description RateLimitedCreateLifeCycle(AsyncPool.LifeCycle<T> lifeCycle, java.util.concurrent.ScheduledExecutorService executor, long minimumTimeDelay, long maximumTimeDelay, long timeIncrement, java.util.concurrent.TimeUnit unit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<T>
create()
java.util.concurrent.CompletableFuture<java.lang.Void>
destroy(T entity)
java.util.concurrent.CompletableFuture<java.lang.Boolean>
testAfterIdle(T entity)
java.util.concurrent.CompletableFuture<java.lang.Boolean>
testOnRelease(T entity)
-
Methods inherited from class com.linkedin.alpini.base.pool.impl.LifeCycleFilter
isWrapperFor, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.linkedin.alpini.base.pool.AsyncPool.LifeCycle
shutdown
-
-
-
-
Constructor Detail
-
RateLimitedCreateLifeCycle
public RateLimitedCreateLifeCycle(@Nonnull AsyncPool.LifeCycle<T> lifeCycle, @Nonnull java.util.concurrent.ScheduledExecutorService executor, long minimumTimeDelay, long maximumTimeDelay, long timeIncrement, @Nonnull java.util.concurrent.TimeUnit unit)
-
-
Method Detail
-
create
public java.util.concurrent.CompletableFuture<T> create()
- Specified by:
create
in interfaceAsyncPool.LifeCycle<T>
- Overrides:
create
in classLifeCycleFilter<T>
-
testOnRelease
public java.util.concurrent.CompletableFuture<java.lang.Boolean> testOnRelease(T entity)
- Specified by:
testOnRelease
in interfaceAsyncPool.LifeCycle<T>
- Overrides:
testOnRelease
in classLifeCycleFilter<T>
-
testAfterIdle
public java.util.concurrent.CompletableFuture<java.lang.Boolean> testAfterIdle(T entity)
- Specified by:
testAfterIdle
in interfaceAsyncPool.LifeCycle<T>
- Overrides:
testAfterIdle
in classLifeCycleFilter<T>
-
destroy
public java.util.concurrent.CompletableFuture<java.lang.Void> destroy(T entity)
- Specified by:
destroy
in interfaceAsyncPool.LifeCycle<T>
- Overrides:
destroy
in classLifeCycleFilter<T>
-
-