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
Modifier and TypeClassDescriptionstatic class
static class
static interface
Nested 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
-
Constructor Summary
ConstructorDescriptionNullCache
(String id, String name, LookupCacheConfiguration c, com.codahale.metrics.MetricRegistry metricRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doStart()
protected void
doStop()
get
(LookupCacheKey key, Callable<LookupResult> loader) void
purge()
void
purge
(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, startUp
Methods 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:
doStart
in classLookupCache
- Throws:
Exception
-
doStop
- Specified by:
doStop
in classLookupCache
- Throws:
Exception
-
get
- Specified by:
get
in classLookupCache
-
getIfPresent
- Specified by:
getIfPresent
in classLookupCache
-
purge
public void purge()- Specified by:
purge
in classLookupCache
-
purge
- Specified by:
purge
in classLookupCache
-