@MBean(objectName="CacheLoader",
description="Component that handles loading entries from a CacheStore into memory.")
public class CacheLoaderInterceptor<K,V>
extends JmxStatsCommandInterceptor
implements EntryLoader<K,V>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
activation |
protected AtomicLong |
cacheLoads |
protected AtomicLong |
cacheMisses |
protected EntryFactory |
entryFactory |
protected ExecutorService |
nonBlockingExecutor |
protected CacheNotifier |
notifier |
protected PersistenceManager |
persistenceManager |
cacheConfiguration| Constructor and Description |
|---|
CacheLoaderInterceptor() |
getStatisticsEnabled, onStart, setStatisticsEnabledhandleDefault, visitClearCommand, visitCommand, visitCommitCommand, visitEvictCommand, visitInvalidateCommand, visitInvalidateL1Command, visitLockControlCommand, visitPrepareCommand, visitPutMapCommand, visitRollbackCommand, visitUnknownCommand, visitWriteOnlyKeyCommand, visitWriteOnlyKeyValueCommand, visitWriteOnlyManyCommand, visitWriteOnlyManyEntriesCommandasyncInvokeNext, asyncInvokeNext, asyncInvokeNext, asyncValue, delayedNull, delayedValue, delayedValue, invokeNext, invokeNextAndExceptionally, invokeNextAndFinally, invokeNextAndHandle, invokeNextThenAccept, invokeNextThenApply, isSuccessfullyDone, makeStage, setNextInterceptor, valueOrExceptionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitloadAndStoreInDataContainervisitRemoveExpiredCommandprotected final AtomicLong cacheLoads
protected final AtomicLong cacheMisses
protected PersistenceManager persistenceManager
protected CacheNotifier notifier
protected EntryFactory entryFactory
protected ExecutorService nonBlockingExecutor
protected boolean activation
public void start()
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command)
visitPutKeyValueCommand in interface VisitorvisitPutKeyValueCommand in class DDAsyncInterceptorpublic Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command)
visitGetKeyValueCommand in interface VisitorvisitGetKeyValueCommand in class DDAsyncInterceptorpublic Object visitGetCacheEntryCommand(InvocationContext ctx, GetCacheEntryCommand command)
visitGetCacheEntryCommand in interface VisitorvisitGetCacheEntryCommand in class DDAsyncInterceptorpublic Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command)
visitGetAllCommand in interface VisitorvisitGetAllCommand in class DDAsyncInterceptorpublic Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command)
visitRemoveCommand in interface VisitorvisitRemoveCommand in class DDAsyncInterceptorpublic Object visitReplaceCommand(InvocationContext ctx, ReplaceCommand command)
visitReplaceCommand in interface VisitorvisitReplaceCommand in class DDAsyncInterceptorpublic Object visitComputeCommand(InvocationContext ctx, ComputeCommand command)
visitComputeCommand in interface VisitorvisitComputeCommand in class DDAsyncInterceptorpublic Object visitComputeIfAbsentCommand(InvocationContext ctx, ComputeIfAbsentCommand command)
visitComputeIfAbsentCommand in interface VisitorvisitComputeIfAbsentCommand in class DDAsyncInterceptorpublic Object visitGetKeysInGroupCommand(InvocationContext ctx, GetKeysInGroupCommand command)
visitGetKeysInGroupCommand in interface VisitorvisitGetKeysInGroupCommand in class DDAsyncInterceptorpublic Object visitEntrySetCommand(InvocationContext ctx, EntrySetCommand command) throws Throwable
visitEntrySetCommand in interface VisitorvisitEntrySetCommand in class DDAsyncInterceptorThrowablepublic Object visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable
visitKeySetCommand in interface VisitorvisitKeySetCommand in class DDAsyncInterceptorThrowablepublic Object visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command)
visitReadOnlyKeyCommand in interface VisitorvisitReadOnlyKeyCommand in class DDAsyncInterceptorpublic Object visitReadOnlyManyCommand(InvocationContext ctx, ReadOnlyManyCommand command)
visitReadOnlyManyCommand in interface VisitorvisitReadOnlyManyCommand in class DDAsyncInterceptorpublic Object visitReadWriteKeyCommand(InvocationContext ctx, ReadWriteKeyCommand command) throws Throwable
visitReadWriteKeyCommand in interface VisitorvisitReadWriteKeyCommand in class DDAsyncInterceptorThrowablepublic Object visitReadWriteKeyValueCommand(InvocationContext ctx, ReadWriteKeyValueCommand command)
visitReadWriteKeyValueCommand in interface VisitorvisitReadWriteKeyValueCommand in class DDAsyncInterceptorpublic Object visitReadWriteManyCommand(InvocationContext ctx, ReadWriteManyCommand command)
visitReadWriteManyCommand in interface VisitorvisitReadWriteManyCommand in class DDAsyncInterceptorpublic Object visitReadWriteManyEntriesCommand(InvocationContext ctx, ReadWriteManyEntriesCommand command) throws Throwable
visitReadWriteManyEntriesCommand in interface VisitorvisitReadWriteManyEntriesCommand in class DDAsyncInterceptorThrowablepublic Object visitSizeCommand(InvocationContext ctx, SizeCommand command)
visitSizeCommand in interface VisitorvisitSizeCommand in class DDAsyncInterceptorprotected final boolean isConditional(WriteCommand cmd)
protected final boolean hasSkipLoadFlag(FlagAffectedCommand cmd)
protected boolean canLoad(Object key)
protected final CompletionStage<Void> loadIfNeeded(InvocationContext ctx, Object key, FlagAffectedCommand cmd)
ctx - The current invocation's contextkey - The key for the entry to look upcmd - The command that was called that now wants to query the cache loaderThrowableprotected CompletionStage<Void> loadInContext(InvocationContext ctx, Object key, FlagAffectedCommand cmd)
ctx - context for this invocationkey - key to find the entry forcmd - the command that initiated this loadpublic CompletionStage<InternalCacheEntry<K,V>> loadAndStoreInDataContainer(InvocationContext ctx, Object key, int segment, FlagAffectedCommand cmd)
EntryLoaderloadAndStoreInDataContainer in interface EntryLoader<K,V>ctx - context that generated this requestkey - key to load from the storesegment - segment of the key to loadcmd - the command that generated this load requestprotected boolean skipLoadForWriteCommand(WriteCommand cmd, Object key, InvocationContext ctx)
protected CompletionStage<Void> sendNotification(Object key, Object value, boolean pre, InvocationContext ctx, FlagAffectedCommand cmd)
@ManagedAttribute(description="Number of entries loaded from cache store",
displayName="Number of cache store loads",
measurementType=TRENDSUP)
public long getCacheLoaderLoads()
@ManagedAttribute(description="Number of entries that did not exist in cache store",
displayName="Number of cache store load misses",
measurementType=TRENDSUP)
public long getCacheLoaderMisses()
public void resetStatistics()
JmxStatsCommandInterceptorresetStatistics in interface JmxStatisticsExposerresetStatistics in class JmxStatsCommandInterceptor@ManagedAttribute(description="Returns a collection of cache loader types which are configured and enabled",
displayName="Returns a collection of cache loader types which are configured and enabled")
public Collection<String> getStores()
@ManagedOperation(description="Disable all stores of a given type, where type is a fully qualified class name of the cache loader to disable",
displayName="Disable all stores of a given type")
public void disableStore(@Parameter(name="storeType",description="Fully qualified class name of a store implementation")
String storeType)
storeType - fully qualified class name of the cache loader type to disableCopyright © 2022 JBoss by Red Hat. All rights reserved.