Package org.graylog2.lookup.caches
Class NullCache
java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
org.graylog2.plugin.lookup.LookupCache
org.graylog2.lookup.caches.NullCache
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
The cache that doesn't. Used in place when no cache is wanted, having a null implementation saves us ugly null checks.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic interfaceNested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNullCache(String id, String name, LookupCacheConfiguration c, com.codahale.metrics.MetricRegistry metricRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()protected voiddoStop()get(LookupCacheKey key, Callable<LookupResult> loader) voidpurge()voidpurge(LookupCacheKey purgeKey) Methods inherited from class org.graylog2.plugin.lookup.LookupCache
clearError, entryCount, getConfig, getError, id, incrHitCount, incrHitCount, incrMissCount, incrMissCount, incrTotalCount, incrTotalCount, lookupTimer, name, setError, setId, shutDown, startUpMethods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
NullCache
@Inject public NullCache(String id, String name, LookupCacheConfiguration c, com.codahale.metrics.MetricRegistry metricRegistry)
-
-
Method Details
-
doStart
- Specified by:
doStartin classLookupCache- Throws:
Exception
-
doStop
- Specified by:
doStopin classLookupCache- Throws:
Exception
-
get
- Specified by:
getin classLookupCache
-
getIfPresent
- Specified by:
getIfPresentin classLookupCache
-
purge
public void purge()- Specified by:
purgein classLookupCache
-
purge
- Specified by:
purgein classLookupCache
-