Tue, 09 Apr 2013 14:51:13 +0100
8010393: Update JAX-WS RI to 2.2.9-b12941
Reviewed-by: alanb, erikj
Contributed-by: miroslav.kos@oracle.com, martin.grebac@oracle.com
1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3 *
4 * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
5 *
6 * The contents of this file are subject to the terms of either the GNU
7 * General Public License Version 2 only ("GPL") or the Common Development
8 * and Distribution License("CDDL") (collectively, the "License"). You
9 * may not use this file except in compliance with the License. You can
10 * obtain a copy of the License at
11 * http://glassfish.java.net/public/CDDL+GPL_1_1.html
12 * or packager/legal/LICENSE.txt. See the License for the specific
13 * language governing permissions and limitations under the License.
14 *
15 * When distributing the software, include this License Header Notice in each
16 * file and include the License file at packager/legal/LICENSE.txt.
17 *
18 * GPL Classpath Exception:
19 * Oracle designates this particular file as subject to the "Classpath"
20 * exception as provided by Oracle in the GPL Version 2 section of the License
21 * file that accompanied this code.
22 *
23 * Modifications:
24 * If applicable, add the following below the License Header, with the fields
25 * enclosed by brackets [] replaced by your own identifying information:
26 * "Portions Copyright [year] [name of copyright owner]"
27 *
28 * Contributor(s):
29 * If you wish your version of this file to be governed by only the CDDL or
30 * only the GPL Version 2, indicate your decision by adding "[Contributor]
31 * elects to include this software in this distribution under the [CDDL or GPL
32 * Version 2] license." If you don't indicate a single choice of license, a
33 * recipient has the option to distribute your version of this file under
34 * either the CDDL, the GPL Version 2 or to extend the choice of license to
35 * its licensees as provided above. However, if you add GPL Version 2 code
36 * and therefore, elected the GPL Version 2 license, then the option applies
37 * only if the new code is made subject to such option by the copyright
38 * holder.
39 */
41 package com.oracle.webservices.internal.api.message;
43 import java.io.IOException;
44 import java.io.OutputStream;
45 import java.nio.ByteBuffer;
46 import java.nio.channels.WritableByteChannel;
48 import javax.xml.soap.SOAPException;
49 import javax.xml.soap.SOAPMessage;
51 /**
52 * MessageContext represents a container of a SOAP message and all the properties
53 * including the transport headers.
54 *
55 * MessageContext is a composite {@link PropertySet} that combines properties exposed from multiple
56 * {@link PropertySet}s into one.
57 *
58 * <p>
59 * This implementation allows one {@link PropertySet} to assemble
60 * all properties exposed from other "satellite" {@link PropertySet}s.
61 * (A satellite may itself be a {@link DistributedPropertySet}, so
62 * in general this can form a tree.)
63 *
64 * @author shih-chang.chen@oracle.com
65 */
66 public interface MessageContext extends DistributedPropertySet {
67 /**
68 * Gets the SAAJ SOAPMessage representation of the SOAP message.
69 *
70 * @return The SOAPMessage
71 */
72 SOAPMessage getAsSOAPMessage() throws SOAPException;
74 /**
75 * Gets the SAAJ SOAPMessage representation of the SOAP message.
76 * @deprecated use getAsSOAPMessage
77 * @return The SOAPMessage
78 */
79 SOAPMessage getSOAPMessage() throws SOAPException;
81 /**
82 * Writes the XML infoset portion of this MessageContext
83 * (from <soap:Envelope> to </soap:Envelope>).
84 *
85 * @param out
86 * Must not be null. The caller is responsible for closing the stream,
87 * not the callee.
88 *
89 * @return
90 * The MIME content type of the encoded message (such as "application/xml").
91 * This information is often ncessary by transport.
92 *
93 * @throws IOException
94 * if a {@link OutputStream} throws {@link IOException}.
95 */
96 ContentType writeTo( OutputStream out ) throws IOException;
98 /**
99 * The version of {@link #writeTo(OutputStream)}
100 * that writes to NIO {@link ByteBuffer}.
101 *
102 * <p>
103 * TODO: for the convenience of implementation, write
104 * an adapter that wraps {@link WritableByteChannel} to {@link OutputStream}.
105 */
106 // ContentType writeTo( WritableByteChannel buffer );
108 /**
109 * Gets the Content-type of this message. For an out-bound message that this getContentType()
110 * method returns a null, the Content-Type can be determined only by calling the writeTo
111 * method to write the MessageContext to an OutputStream.
112 *
113 * @return The MIME content type of this message
114 */
115 ContentType getContentType();
116 }