Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxws/src/share/jaxws_classes/javax/xml/ws/LogicalMessage.java
38890 views
/*1* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.xml.ws;2627import javax.xml.transform.Source;28import javax.xml.bind.JAXBContext;2930/** The <code>LogicalMessage</code> interface represents a31* protocol agnostic XML message and contains methods that32* provide access to the payload of the message.33*34* @since JAX-WS 2.035**/36public interface LogicalMessage {3738/** Gets the message payload as an XML source, may be called39* multiple times on the same LogicalMessage instance, always40* returns a new <code>Source</code> that may be used to retrieve the entire41* message payload.42*43* <p>If the returned <code>Source</code> is an instance of44* <code>DOMSource</code>, then45* modifications to the encapsulated DOM tree change the message46* payload in-place, there is no need to susequently call47* <code>setPayload</code>. Other types of <code>Source</code> provide only48* read access to the message payload.49*50* @return The contained message payload; returns <code>null</code> if no51* payload is present in this message.52**/53public Source getPayload();5455/** Sets the message payload56*57* @param payload message payload58* @throws WebServiceException If any error during the setting59* of the payload in this message60* @throws java.lang.UnsupportedOperationException If this61* operation is not supported62**/63public void setPayload(Source payload);6465/** Gets the message payload as a JAXB object. Note that there is no66* connection between the returned object and the message payload,67* changes to the payload require calling <code>setPayload</code>.68*69* @param context The JAXBContext that should be used to unmarshall70* the message payload71* @return The contained message payload; returns <code>null</code> if no72* payload is present in this message73* @throws WebServiceException If an error occurs when using a supplied74* JAXBContext to unmarshall the payload. The cause of75* the WebServiceException is the original JAXBException.76**/77public Object getPayload(JAXBContext context);7879/** Sets the message payload80*81* @param payload message payload82* @param context The JAXBContext that should be used to marshall83* the payload84* @throws java.lang.UnsupportedOperationException If this85* operation is not supported86* @throws WebServiceException If an error occurs when using the supplied87* JAXBContext to marshall the payload. The cause of88* the WebServiceException is the original JAXBException.89**/90public void setPayload(Object payload, JAXBContext context);91}929394