Class JAXBContextCache
java.lang.Object
com.atlassian.crowd.integration.rest.util.JAXBContextCache
Caches the instances of JAXBContext for each entity class for performance reasons
as suggested by the JAXB docs.
Note that we cache JAXBContext instances because they are thread-safe, but not Marshallers/Unmarshallers because
they are not thread-safe.
For an extra performance gain, we could have a pool of (un)marshallers in the style of JAXBStringReaderProviders
in Jersey Client.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
JAXBContextCache
public JAXBContextCache()
-
-
Method Details
-
getJAXBContext
- Parameters:
clazz- class for which a JAXBContext is requested- Returns:
- a thread-safe JAXBContext for the given class
-