Package org.somda.sdc.dpws.helper
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 TypeMethodDescription<T> voidmarshal(javax.xml.bind.JAXBElement<T> objectToMarshal, OutputStream outputStream) Marshals a JAXBElement into a stream.protected voidshutDown()protected voidstartUp()unmarshal(InputStream inputStream) Takes an input stream and unmarshals it.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
-
Method Details
-
startUp
- Specified by:
startUpin classcom.google.common.util.concurrent.AbstractIdleService- Throws:
Exception
-
shutDown
protected void shutDown()- Specified by:
shutDownin classcom.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 marshaloutputStream- to marshal into- Throws:
javax.xml.bind.JAXBException- on marshalling errors.
-
unmarshal
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
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.
-