]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
ae2bd1206b53a689a23f6935cdd289776cb29234
[tmp/jakarta-migration.git] /
1 package org.collectionspace.services.advancedsearch;
2
3 import javax.xml.bind.JAXBContext;
4 import javax.xml.bind.JAXBException;
5
6 import org.collectionspace.collectionspace_core.CollectionSpaceCore;
7 import org.collectionspace.services.collectionobject.CollectionobjectsCommon;
8
9 /**
10  * Singleton for the {@link JAXBContext} which the AdvancedSearch will use
11  * Eventually this should just be a bean which can be injected
12  * @since 8.3.0
13  */
14 public final class AdvancedSearchJAXBContext {
15         private static final AdvancedSearchJAXBContext INSTANCE = new AdvancedSearchJAXBContext();
16
17         private final JAXBContext jaxbContext;
18
19         private AdvancedSearchJAXBContext() {
20                 try {
21                         jaxbContext = JAXBContext.newInstance(CollectionSpaceCore.class, CollectionobjectsCommon.class);
22                 } catch (JAXBException e) {
23                         throw new RuntimeException("Unable to create JAXBContext for AdvancedSearch");
24                 }
25         }
26
27         public static JAXBContext getJaxbContext() {
28                 return INSTANCE.jaxbContext;
29         }
30 }