public class JaxbContextCacheImpl extends java.lang.Object implements JaxbContextCache
ConcurrentHashMap without eviction. This implementation is aimed to avoid additional
third party dependencies. For a more robust solution You can easily implement your own cache with Guava, Ecache,
Caffeine or any other cache library. See some code references in the JaxbContextCache interface.| Constructor and Description |
|---|
JaxbContextCacheImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Drops all cached contexts
|
javax.xml.bind.JAXBContext |
clear(java.lang.Class clazz)
Drops the cached context for the specific MX implementation class
|
javax.xml.bind.JAXBContext |
get(java.lang.Class messageClass,
java.lang.Class<?>[] classes)
Gets a context from the static cache.
|
int |
size() |
public javax.xml.bind.JAXBContext get(java.lang.Class messageClass,
java.lang.Class<?>[] classes)
throws javax.xml.bind.JAXBException
get in interface JaxbContextCachemessageClass - class of the message to be read or writtenclasses - comprehensive list of classes for the contextjavax.xml.bind.JAXBExceptionpublic void clear()
public javax.xml.bind.JAXBContext clear(java.lang.Class clazz)
public int size()