Class LocalCacheService
java.lang.Object
org.talend.sdk.component.runtime.manager.service.LocalCacheService
- All Implemented Interfaces:
Serializable,org.talend.sdk.component.api.service.cache.LocalCache
public class LocalCacheService
extends Object
implements org.talend.sdk.component.api.service.cache.LocalCache, Serializable
Implementation of LocalCache with in memory concurrent map.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCache configuration.Nested classes/interfaces inherited from interface org.talend.sdk.component.api.service.cache.LocalCache
org.talend.sdk.component.api.service.cache.LocalCache.Element -
Constructor Summary
ConstructorsConstructorDescriptionLocalCacheService(String plugin, Supplier<Long> timer, Supplier<ScheduledExecutorService> threadServiceGetter) -
Method Summary
Modifier and TypeMethodDescriptionvoidclean()<T> TcomputeIfAbsent(Class<T> expectedClass, String key, long timeoutMs, Supplier<T> value) <T> TcomputeIfAbsent(Class<T> expectedClass, String key, Predicate<org.talend.sdk.component.api.service.cache.LocalCache.Element> toRemove, long timeoutMs, Supplier<T> value) <T> TcomputeIfAbsent(Class<T> expectedClass, String key, Predicate<org.talend.sdk.component.api.service.cache.LocalCache.Element> toRemove, Supplier<T> value) <T> TcomputeIfAbsent(Class<T> expectedClass, String key, Supplier<T> value) voidEvict an object.voidevictIfValue(String key, Object expected) voidrelease()
-
Constructor Details
-
LocalCacheService
public LocalCacheService(String plugin, Supplier<Long> timer, Supplier<ScheduledExecutorService> threadServiceGetter)
-
-
Method Details
-
evict
Evict an object.- Specified by:
evictin interfaceorg.talend.sdk.component.api.service.cache.LocalCache- Parameters:
key- key to evict.
-
evictIfValue
- Specified by:
evictIfValuein interfaceorg.talend.sdk.component.api.service.cache.LocalCache
-
computeIfAbsent
public <T> T computeIfAbsent(Class<T> expectedClass, String key, Predicate<org.talend.sdk.component.api.service.cache.LocalCache.Element> toRemove, long timeoutMs, Supplier<T> value) - Specified by:
computeIfAbsentin interfaceorg.talend.sdk.component.api.service.cache.LocalCache
-
computeIfAbsent
public <T> T computeIfAbsent(Class<T> expectedClass, String key, Predicate<org.talend.sdk.component.api.service.cache.LocalCache.Element> toRemove, Supplier<T> value) - Specified by:
computeIfAbsentin interfaceorg.talend.sdk.component.api.service.cache.LocalCache
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceorg.talend.sdk.component.api.service.cache.LocalCache
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceorg.talend.sdk.component.api.service.cache.LocalCache
-
release
-
clean
-