public class DiagnosticRequestCacheContext extends Object implements RequestCacheContext
| Constructor and Description |
|---|
DiagnosticRequestCacheContext(RequestCacheContext delegate,
java.time.Clock clock,
java.time.Instant birthTime,
int longRunningThreshold) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearAll()
Clears all local storage for this thread.
|
void |
clearLocalMap(RequestCache<?,?> requestCache)
Clears a specific request cache's local storage for this thread.
|
void |
close()
Should be called to indicate the attempt to stop the context.
|
Map<Object,Object> |
getLocalMap(RequestCache<?,?> requestCache)
Returns the request-scoped storage for the given request cache.
|
Map<Object,Object> |
getLocalMapIfExists(RequestCache<?,?> requestCache)
Returns the request-scoped storage for the given request cache, if it exists.
|
void |
markValueLoading()
Track number of cache loads in order to detect long running contexts
|
void |
open()
Should be called to indicate the start of the context.
|
public DiagnosticRequestCacheContext(RequestCacheContext delegate, java.time.Clock clock, java.time.Instant birthTime, int longRunningThreshold)
@Nonnull public Map<Object,Object> getLocalMap(RequestCache<?,?> requestCache)
RequestCacheContextgetLocalMap in interface RequestCacheContextrequestCache - the cache for which to locate@Nullable public Map<Object,Object> getLocalMapIfExists(RequestCache<?,?> requestCache)
RequestCacheContextgetLocalMapIfExists in interface RequestCacheContextrequestCache - the cache for which to locatenull.public void clearAll()
RequestCacheContextclearAll in interface RequestCacheContextpublic void clearLocalMap(RequestCache<?,?> requestCache)
RequestCacheContextclearLocalMap in interface RequestCacheContextrequestCache - the cache for which to clear the current thread's local storagepublic void open()
RequestCacheContextRequestCacheContext.close()open in interface RequestCacheContextpublic void close()
RequestCacheContextRequestCacheContext.open()close in interface RequestCacheContextpublic void markValueLoading()
markValueLoading in interface RequestCacheContextCopyright © 2002-2019 Atlassian. All Rights Reserved.