FileDocCategorySizeDatePackage
TxJAXBContext.javaAPI DocExample4274Tue May 29 16:57:16 BST 2007com.sun.xml.ws.tx.common

TxJAXBContext

public class TxJAXBContext extends Object
author
jf39279

Fields Summary
private static final TxLogger
logger
private static JAXBContext
jc
Constructors Summary
Methods Summary
public static javax.xml.bind.MarshallercreateMarshaller()
Marshal xml fragment, not an XML document.

        try {
            final Marshaller marshaller = getJAXBContext().createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
            return marshaller;
        } catch (JAXBException e) {
            logger.severe("createMarshaller", LocalizationMessages.FAILED_TO_CREATE_MARSHALLER_2003(e));
            return null;
        }
    
public static javax.xml.bind.UnmarshallercreateUnmarshaller()

        try {
            return getJAXBContext().createUnmarshaller();
        } catch (JAXBException e) {
            logger.severe("createUnmarshaller", LocalizationMessages.FAILED_TO_CREATE_UNMARSHALLER_2004(e));
            return null;
        }
    
private static java.util.ListgetClassesToBeBound()

        final Class[] classes;
        final ArrayList<Class> classList;

        classes = new Class[]{
                Class.forName("com.sun.xml.ws.tx.webservice.member.coord.CoordinationContext")
        };
        classList = new ArrayList<Class>(Arrays.asList(classes));
        return classList;
    
public static javax.xml.bind.JAXBContextgetJAXBContext()


     
        try {
            final List<Class> classes = getClassesToBeBound();
            jc = JAXBContext.newInstance(classes.toArray(new Class[classes.size()]));
        } catch (JAXBException e) {
            logger.severe("getJAXBContext", LocalizationMessages.FAILED_TO_CREATE_JAXBCONTEXT_2002(e));
        } catch (ClassNotFoundException e) {
            logger.severe("getJAXBContext", LocalizationMessages.FAILED_TO_CREATE_JAXBCONTEXT_2002(e));
        }
    
        return jc;