Class MtomCodec
- All Implemented Interfaces:
Codec
- Author:
- Vivek Pandey, Jitendra Kotamraju
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
FieldsFields inherited from class com.sun.xml.ws.encoding.MimeCodec
features, mimeRootCodec, MULTIPART_RELATED_MIME_TYPE, version -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a copy of thisCodec.protected voiddecode(MimeMultipartParser mpp, Packet packet) Parses aPacketfrom aMimeMultipartParser.static StringdeterminePacketEncoding(Packet packet) encode(Packet packet, OutputStream out) Encodes an XML infoset portion of theMessage(from <soap:Envelope> to </soap:Envelope>).encode(Packet packet, WritableByteChannel buffer) The version ofCodec.encode(Packet,OutputStream)that writes to NIOByteBuffer.static StringgetActionParameter(Packet packet, SOAPVersion version) static StringgetSOAPXopContentType(String encoding, SOAPVersion version, String actionParameter) getStaticContentType(Packet packet) Return the soap 1.1 and soap 1.2 specific XOP packaged ContentTypestatic ContentTypegetStaticContentTypeStatic(Packet packet, SOAPVersion version) static voidwriteMimeHeaders(String contentType, String contentId, OutputStream out) Methods inherited from class com.sun.xml.ws.encoding.MimeCodec
decode, decode, getMimeRootCodec, getMimeType, writeAsAscii, writeln, writeln
-
Field Details
-
XOP_XML_MIME_TYPE
- See Also:
-
XOP_LOCALNAME
- See Also:
-
XOP_NAMESPACEURI
- See Also:
-
-
Method Details
-
getStaticContentType
Return the soap 1.1 and soap 1.2 specific XOP packaged ContentType- Specified by:
getStaticContentTypein interfaceCodec- Overrides:
getStaticContentTypein classMimeCodec- Returns:
- A non-null content type for soap11 or soap 1.2 content type
-
getStaticContentTypeStatic
-
encode
Description copied from interface:CodecEncodes an XML infoset portion of theMessage(from <soap:Envelope> to </soap:Envelope>).Internally, this method is most likely invoke
Message.writeTo(XMLStreamWriter)to turn the message into infoset.- Specified by:
encodein interfaceCodec- Overrides:
encodein classMimeCodecout- Must not be null. The caller is responsible for closing the stream, not the callee.- Returns:
- The MIME content type of the encoded message (such as "application/xml"). This information is often ncessary by transport.
- Throws:
IOException- if aOutputStreamthrowsIOException.
-
getSOAPXopContentType
public static String getSOAPXopContentType(String encoding, SOAPVersion version, String actionParameter) -
getActionParameter
-
writeMimeHeaders
public static void writeMimeHeaders(String contentType, String contentId, OutputStream out) throws IOException - Throws:
IOException
-
encode
Description copied from interface:CodecThe version ofCodec.encode(Packet,OutputStream)that writes to NIOByteBuffer.TODO: for the convenience of implementation, write an adapter that wraps
WritableByteChanneltoOutputStream. -
copy
Description copied from interface:CodecCreates a copy of thisCodec.Since
Codecinstance is not re-entrant, the caller who needs to encode twoMessages simultaneously will want to have twoCodecinstances. That's what this method produces.Implentation Note
Note that this method might be invoked by one thread while another thread is executing one of the
Codec.encode(com.sun.xml.ws.api.message.Packet, java.io.OutputStream)methods. This should be OK because you'll be only copying things that are thread-safe, and creating new ones for thread-unsafe resources, but please let us know if this contract is difficult.- Specified by:
copyin interfaceCodec- Specified by:
copyin classMimeCodec- Returns:
- always non-null valid
Codecthat performs the encoding work in the same way --- that is, if you copy an FI codec, you'll get another FI codec.Once copied, two
Codecs may be invoked from two threads concurrently; therefore, they must not share any state that requires isolation (such as temporary buffer.)If the
Codecimplementation is already re-entrant and multi-thread safe to begin with, then this method may simply returnthis.
-
decode
Description copied from class:MimeCodecParses aPacketfrom aMimeMultipartParser.- Specified by:
decodein classMimeCodec- Throws:
IOException
-
determinePacketEncoding
-