@ThreadSafe @Singleton public final class JAXBContextCache extends AbstractNotifyingCache<JAXBContextCacheKey,JAXBContext>
m_aCacheAccessStats, m_aRWLock, STATISTICS_PREFIX| Modifier and Type | Method and Description |
|---|---|
JAXBContext |
getFromCache(Class<?> aClass)
Get the
JAXBContext from an existing Class object. |
JAXBContext |
getFromCache(Class<?> aClass,
ClassLoader aClassLoader)
Get the
JAXBContext from an existing Class object. |
JAXBContext |
getFromCache(Package aPackage)
Special overload with package and default
ClassLoader. |
JAXBContext |
getFromCache(Package aPackage,
ClassLoader aClassLoader)
Special overload with package and
ClassLoader. |
static JAXBContextCache |
getInstance() |
JAXBContext |
getValueToCache(JAXBContextCacheKey aCacheKey)
This abstract method is invoked, once a new value needs to be put into the
cache.
|
static boolean |
isInstantiated() |
EChange |
removeFromCache(Package aPackage) |
getFromCacheclearCache, createCache, getFromCacheNoStats, getFromCacheNoStatsNotLocked, getFromCacheNotLocked, getMaxSize, getName, getSize, hasMaxSize, isEmpty, isNotEmpty, putInCache, putInCacheNotLocked, removeFromCache, toStringpublic static boolean isInstantiated()
@Nonnull public static JAXBContextCache getInstance()
@Nullable @IsLocked(value=WRITE) public JAXBContext getValueToCache(@Nullable JAXBContextCacheKey aCacheKey)
AbstractNotifyingCachegetValueToCache in class AbstractNotifyingCache<JAXBContextCacheKey,JAXBContext>aCacheKey - The key for which the value to cache is required. May be
nullable or not - depends upon the implementation.null.@Nullable public JAXBContext getFromCache(@Nonnull Package aPackage)
ClassLoader.aPackage - Package to load. May not be null.null if package is null.@Nullable public JAXBContext getFromCache(@Nonnull Package aPackage, @Nullable ClassLoader aClassLoader)
ClassLoader. In this case the
resulting value is NOT cached!aPackage - Package to load. May not be null.aClassLoader - Class loader to use. May be null in which case the
default class loader is used.null if package is null.@Nonnull public JAXBContext getFromCache(@Nonnull Class<?> aClass)
JAXBContext from an existing Class object. If the
class's owning package is a valid JAXB package, this method redirects to
getFromCache(Package) otherwise a new JAXB context is created and
NOT cached.aClass - The class for which the JAXB context is to be created. May not be
null.null.@Nonnull public JAXBContext getFromCache(@Nonnull Class<?> aClass, @Nullable ClassLoader aClassLoader)
JAXBContext from an existing Class object. If the
class's owning package is a valid JAXB package, this method redirects to
getFromCache(Package) otherwise a new JAXB context is created and
NOT cached.aClass - The class for which the JAXB context is to be created. May not be
null.aClassLoader - Class loader to use. May be null in which case the
default class loader is used.null.Copyright © 2014–2015 Philip Helger. All rights reserved.