Class JaxbMarshalling

java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
org.somda.sdc.dpws.helper.JaxbMarshalling
All Implemented Interfaces:
com.google.common.util.concurrent.Service

public class JaxbMarshalling extends com.google.common.util.concurrent.AbstractIdleService
Creates XML input and output streams from/to JAXB instances.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service

    com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> void
    marshal(javax.xml.bind.JAXBElement<T> objectToMarshal, OutputStream outputStream)
    Marshals a JAXBElement into a stream.
    protected void
     
    protected void
     
    unmarshal(InputStream inputStream)
    Takes an input stream and unmarshals it.
    unmarshal(Reader reader)
    Takes a reader and unmarshals it.

    Methods inherited from class com.google.common.util.concurrent.AbstractIdleService

    addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • startUp

      protected void startUp() throws Exception
      Specified by:
      startUp in class com.google.common.util.concurrent.AbstractIdleService
      Throws:
      Exception
    • shutDown

      protected void shutDown()
      Specified by:
      shutDown in class com.google.common.util.concurrent.AbstractIdleService
    • marshal

      public <T> void marshal(javax.xml.bind.JAXBElement<T> objectToMarshal, OutputStream outputStream) throws javax.xml.bind.JAXBException
      Marshals a JAXBElement into a stream.
      Type Parameters:
      T - type of the wrapped element
      Parameters:
      objectToMarshal - to marshal
      outputStream - to marshal into
      Throws:
      javax.xml.bind.JAXBException - on marshalling errors.
    • unmarshal

      public Object unmarshal(InputStream inputStream) throws javax.xml.bind.JAXBException
      Takes an input stream and unmarshals it.
      Parameters:
      inputStream - the input stream to unmarshal.
      Returns:
      the unmarshalled SOAP envelope.
      Throws:
      javax.xml.bind.JAXBException - if unmarshalling fails.
    • unmarshal

      public Object unmarshal(Reader reader) throws javax.xml.bind.JAXBException
      Takes a reader and unmarshals it.
      Parameters:
      reader - the input stream to unmarshal.
      Returns:
      the unmarshalled SOAP envelope.
      Throws:
      javax.xml.bind.JAXBException - if unmarshalling fails.