Package org.somda.sdc.dpws.soap
Class JaxbSoapMarshalling
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractIdleService
-
- org.somda.sdc.dpws.soap.JaxbSoapMarshalling
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,SoapMarshalling
public class JaxbSoapMarshalling extends com.google.common.util.concurrent.AbstractIdleService implements SoapMarshalling
Creates XML input and output streams fromEnvelopeinstances by using JAXB.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmarshal(Envelope envelope, OutputStream outputStream)Takes a SOAP envelope and marshals it.protected voidshutDown()protected voidstartUp()Envelopeunmarshal(InputStream inputStream)Takes an input stream and unmarshals it.Envelopeunmarshal(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
-
-
-
-
Method Detail
-
startUp
protected void startUp() throws Exception- 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 void marshal(Envelope envelope, OutputStream outputStream) throws javax.xml.bind.JAXBException
Takes a SOAP envelope and marshals it.- Specified by:
marshalin interfaceSoapMarshalling- Parameters:
envelope- the source envelope to marshal.outputStream- the destination of the marshalled data.- Throws:
javax.xml.bind.JAXBException- if marshalling fails.
-
unmarshal
public Envelope unmarshal(InputStream inputStream) throws javax.xml.bind.JAXBException, ClassCastException
Takes an input stream and unmarshals it.- Specified by:
unmarshalin interfaceSoapMarshalling- Parameters:
inputStream- the input stream to unmarshal.- Returns:
- the unmarshalled SOAP envelope.
- Throws:
javax.xml.bind.JAXBException- if unmarshalling fails.ClassCastException- in case unmarshalled data could not be cast to a JAXB element.
-
unmarshal
public Envelope unmarshal(Reader reader) throws javax.xml.bind.JAXBException, ClassCastException
Takes a reader and unmarshals it.- Specified by:
unmarshalin interfaceSoapMarshalling- Parameters:
reader- the input stream to unmarshal.- Returns:
- the unmarshalled SOAP envelope.
- Throws:
javax.xml.bind.JAXBException- if unmarshalling fails.ClassCastException- in case unmarshalled data could not be cast to a JAXB element.
-
-