org.apache.axis2.jaxws.message.databinding
Class JAXBUtils

java.lang.Object
  extended by org.apache.axis2.jaxws.message.databinding.JAXBUtils

public class JAXBUtils
extends java.lang.Object

JAXB Utilites to pool JAXBContext and related objects.


Nested Class Summary
static class JAXBUtils.CONSTRUCTION_TYPE
           
 
Constructor Summary
JAXBUtils()
           
 
Method Summary
static javax.xml.bind.JAXBContext getJAXBContext(java.util.TreeSet<java.lang.String> contextPackages)
          Deprecated.  
static javax.xml.bind.JAXBContext getJAXBContext(java.util.TreeSet<java.lang.String> contextPackages, java.lang.ClassLoader cacheKey)
          Deprecated.  
static javax.xml.bind.JAXBContext getJAXBContext(java.util.TreeSet<java.lang.String> contextPackages, Holder<JAXBUtils.CONSTRUCTION_TYPE> constructionType, java.lang.String key)
           
static javax.xml.bind.JAXBContext getJAXBContext(java.util.TreeSet<java.lang.String> contextPackages, Holder<JAXBUtils.CONSTRUCTION_TYPE> constructionType, java.lang.String key, java.lang.ClassLoader cacheKey)
          Get a JAXBContext for the class Note: The contextPackage object is used by multiple threads.
static javax.xml.bind.JAXBIntrospector getJAXBIntrospector(javax.xml.bind.JAXBContext context)
          get JAXB Introspector
static javax.xml.bind.Marshaller getJAXBMarshaller(javax.xml.bind.JAXBContext context)
          Get JAXBMarshaller
static javax.xml.bind.Unmarshaller getJAXBUnmarshaller(javax.xml.bind.JAXBContext context)
          Get the unmarshaller.
static void releaseJAXBIntrospector(javax.xml.bind.JAXBContext context, javax.xml.bind.JAXBIntrospector introspector)
          Release JAXBIntrospector Do not call this method if an exception occurred while using the JAXBIntrospector.
static void releaseJAXBMarshaller(javax.xml.bind.JAXBContext context, javax.xml.bind.Marshaller marshaller)
          releaseJAXBMarshalller Do not call this method if an exception occurred while using the Marshaller.
static void releaseJAXBUnmarshaller(javax.xml.bind.JAXBContext context, javax.xml.bind.Unmarshaller unmarshaller)
          Release Unmarshaller Do not call this method if an exception occurred while using the Unmarshaller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAXBUtils

public JAXBUtils()
Method Detail

getJAXBContext

public static javax.xml.bind.JAXBContext getJAXBContext(java.util.TreeSet<java.lang.String> contextPackages)
                                                 throws javax.xml.bind.JAXBException
Deprecated. 

Get a JAXBContext for the class

Parameters:
contextPackage - Set
Returns:
JAXBContext
Throws:
javax.xml.bind.JAXBException

getJAXBContext

public static javax.xml.bind.JAXBContext getJAXBContext(java.util.TreeSet<java.lang.String> contextPackages,
                                                        java.lang.ClassLoader cacheKey)
                                                 throws javax.xml.bind.JAXBException
Deprecated. 

Get a JAXBContext for the class Note: The contextPackage object is used by multiple threads. It should be considered immutable and not altered by this method.

Parameters:
contextPackage - Set
cacheKey - ClassLoader
Returns:
JAXBContext
Throws:
javax.xml.bind.JAXBException

getJAXBContext

public static javax.xml.bind.JAXBContext getJAXBContext(java.util.TreeSet<java.lang.String> contextPackages,
                                                        Holder<JAXBUtils.CONSTRUCTION_TYPE> constructionType,
                                                        java.lang.String key)
                                                 throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

getJAXBContext

public static javax.xml.bind.JAXBContext getJAXBContext(java.util.TreeSet<java.lang.String> contextPackages,
                                                        Holder<JAXBUtils.CONSTRUCTION_TYPE> constructionType,
                                                        java.lang.String key,
                                                        java.lang.ClassLoader cacheKey)
                                                 throws javax.xml.bind.JAXBException
Get a JAXBContext for the class Note: The contextPackage object is used by multiple threads. It should be considered immutable and not altered by this method.

Parameters:
contextPackage - Set
contructionType - (output value that indicates how the context was constructed)
cacheKey - ClassLoader
Returns:
JAXBContext
Throws:
javax.xml.bind.JAXBException

getJAXBUnmarshaller

public static javax.xml.bind.Unmarshaller getJAXBUnmarshaller(javax.xml.bind.JAXBContext context)
                                                       throws javax.xml.bind.JAXBException
Get the unmarshaller. You must call releaseUnmarshaller to put it back into the pool

Parameters:
context - JAXBContext
Returns:
Unmarshaller
Throws:
javax.xml.bind.JAXBException

releaseJAXBUnmarshaller

public static void releaseJAXBUnmarshaller(javax.xml.bind.JAXBContext context,
                                           javax.xml.bind.Unmarshaller unmarshaller)
Release Unmarshaller Do not call this method if an exception occurred while using the Unmarshaller. We object my be in an invalid state.

Parameters:
context - JAXBContext
unmarshaller - Unmarshaller

getJAXBMarshaller

public static javax.xml.bind.Marshaller getJAXBMarshaller(javax.xml.bind.JAXBContext context)
                                                   throws javax.xml.bind.JAXBException
Get JAXBMarshaller

Parameters:
context - JAXBContext
Returns:
Marshaller
Throws:
javax.xml.bind.JAXBException

releaseJAXBMarshaller

public static void releaseJAXBMarshaller(javax.xml.bind.JAXBContext context,
                                         javax.xml.bind.Marshaller marshaller)
releaseJAXBMarshalller Do not call this method if an exception occurred while using the Marshaller. We object my be in an invalid state.

Parameters:
context - JAXBContext
marshaller - Marshaller

getJAXBIntrospector

public static javax.xml.bind.JAXBIntrospector getJAXBIntrospector(javax.xml.bind.JAXBContext context)
                                                           throws javax.xml.bind.JAXBException
get JAXB Introspector

Parameters:
context - JAXBContext
Returns:
JAXBIntrospector
Throws:
javax.xml.bind.JAXBException

releaseJAXBIntrospector

public static void releaseJAXBIntrospector(javax.xml.bind.JAXBContext context,
                                           javax.xml.bind.JAXBIntrospector introspector)
Release JAXBIntrospector Do not call this method if an exception occurred while using the JAXBIntrospector. We object my be in an invalid state.

Parameters:
context - JAXBContext
introspector - JAXBIntrospector


Copyright © 2007 Apache Web Services Project. All Rights Reserved.