src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/Databinding.java

Thu, 31 Aug 2017 15:18:52 +0800

author
aoqi
date
Thu, 31 Aug 2017 15:18:52 +0800
changeset 637
9c07ef4934dd
parent 374
72e03566f0a6
parent 0
373ffda63c9a
permissions
-rw-r--r--

merge

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation. Oracle designates this
aoqi@0 8 * particular file as subject to the "Classpath" exception as provided
aoqi@0 9 * by Oracle in the LICENSE file that accompanied this code.
aoqi@0 10 *
aoqi@0 11 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 14 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 15 * accompanied this code).
aoqi@0 16 *
aoqi@0 17 * You should have received a copy of the GNU General Public License version
aoqi@0 18 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 20 *
aoqi@0 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 22 * or visit www.oracle.com if you need additional information or have any
aoqi@0 23 * questions.
aoqi@0 24 */
aoqi@0 25
aoqi@0 26 package com.oracle.webservices.internal.api.databinding;
aoqi@0 27
aoqi@0 28 import java.lang.reflect.Method;
aoqi@0 29 import java.net.URL;
aoqi@0 30
aoqi@0 31 import javax.xml.namespace.QName;
aoqi@0 32 import javax.xml.transform.Source;
aoqi@0 33 import javax.xml.ws.WebServiceFeature;
aoqi@0 34
aoqi@0 35 import org.xml.sax.EntityResolver;
aoqi@0 36
aoqi@0 37 import com.oracle.webservices.internal.api.message.MessageContext;
aoqi@0 38
aoqi@0 39 /**
aoqi@0 40 * {@code Databinding} is the entry point for all the WebService Databinding
aoqi@0 41 * functionality. Primarily, a Databinding is to serialize/deserialize an
aoqi@0 42 * XML(SOAP) message to/from a JAVA method invocation and return which are
aoqi@0 43 * represented as <code>JavaCallInfo</code> instances. A WSDLGenerator can
aoqi@0 44 * be created from a Databinding object to genreate WSDL representation of
aoqi@0 45 * a JAVA service endpoint interface.
aoqi@0 46 * <p>
aoqi@0 47 * </p>
aoqi@0 48 * The supported databinding modes(flavors) are:
aoqi@0 49 * <ul>
aoqi@0 50 * <li>"toplink.jaxb"</li>
aoqi@0 51 * <li>"glassfish.jaxb"</li>
aoqi@0 52 * </ul>
aoqi@0 53 * <blockquote> Following is an example that creates a {@code Databinding} which
aoqi@0 54 * provides the operations to serialize/deserialize a JavaCallInfo to/from a
aoqi@0 55 * SOAP message:<br/>
aoqi@0 56 *
aoqi@0 57 * <pre>
aoqi@0 58 * DatabindingFactory factory = DatabindingFactory.newInstance();
aoqi@0 59 * Databinding.Builder builder = factory.createBuilder(seiClass, endpointClass);
aoqi@0 60 * Databinding databinding = builder.build();
aoqi@0 61 * </pre>
aoqi@0 62 *
aoqi@0 63 * </blockquote>
aoqi@0 64 *
aoqi@0 65 * @see com.oracle.webservices.internal.api.databinding.DatabindingFactory
aoqi@0 66 *
aoqi@0 67 * @author shih-chang.chen@oracle.com
aoqi@0 68 */
aoqi@0 69 public interface Databinding {
aoqi@0 70
aoqi@0 71 /**
aoqi@0 72 * Creates a new instance of a <code>JavaCallInfo</code>.
aoqi@0 73 *
aoqi@0 74 * @param method The JAVA method
aoqi@0 75 * @param args The parameter objects
aoqi@0 76 *
aoqi@0 77 * @return New instance of a <code>JavaCallInfo</code>
aoqi@0 78 */
aoqi@0 79 JavaCallInfo createJavaCallInfo(Method method, Object[] args);
aoqi@0 80
aoqi@0 81 /**
aoqi@0 82 * Serializes a JavaCallInfo instance representing a JAVA method call to a
aoqi@0 83 * request XML(SOAP) message.
aoqi@0 84 *
aoqi@0 85 * @param call The JavaCallInfo representing a method call
aoqi@0 86 *
aoqi@0 87 * @return The request XML(SOAP) message
aoqi@0 88 */
aoqi@0 89 MessageContext serializeRequest(JavaCallInfo call);
aoqi@0 90
aoqi@0 91 /**
aoqi@0 92 * Deserializes a response XML(SOAP) message to a JavaCallInfo instance
aoqi@0 93 * representing the return value or exception of a JAVA method call.
aoqi@0 94 *
aoqi@0 95 * @param message The response message
aoqi@0 96 * @param call The JavaCallInfo instance to be updated
aoqi@0 97 *
aoqi@0 98 * @return The JavaCallInfo updated with the return value or exception of a
aoqi@0 99 * JAVA method call
aoqi@0 100 */
aoqi@0 101 JavaCallInfo deserializeResponse(MessageContext message, JavaCallInfo call);
aoqi@0 102
aoqi@0 103 /**
aoqi@0 104 * Deserializes a request XML(SOAP) message to a JavaCallInfo instance
aoqi@0 105 * representing a JAVA method call.
aoqi@0 106 *
aoqi@0 107 * @param message The request message
aoqi@0 108 *
aoqi@0 109 * @return The JavaCallInfo representing a method call
aoqi@0 110 */
aoqi@0 111 JavaCallInfo deserializeRequest(MessageContext message);
aoqi@0 112
aoqi@0 113 /**
aoqi@0 114 * Serializes a JavaCallInfo instance representing the return value or
aoqi@0 115 * exception of a JAVA method call to a response XML(SOAP) message.
aoqi@0 116 *
aoqi@0 117 * @param call The JavaCallInfo representing the return value or exception
aoqi@0 118 * of a JAVA method call
aoqi@0 119 *
aoqi@0 120 * @return The response XML(SOAP) message
aoqi@0 121 */
aoqi@0 122 MessageContext serializeResponse(JavaCallInfo call);
aoqi@0 123
aoqi@0 124 /**
aoqi@0 125 * Gets the MessageContextFactory
aoqi@0 126 *
aoqi@0 127 * @return The MessageContextFactory
aoqi@0 128 */
aoqi@0 129 //Wait for WLS/src1212 - wls.jaxrpc wrapper
aoqi@0 130 // MessageContextFactory getMessageContextFactory();
aoqi@0 131
aoqi@0 132 /**
aoqi@0 133 * {@code Databinding.Builder}, created from the DatabindingFactory, is used to
aoqi@0 134 * configure how a Databinding instance is to be built from this builder.
aoqi@0 135 *
aoqi@0 136 * @see com.oracle.webservices.internal.api.databinding.DatabindingFactory
aoqi@0 137 * @author shih-chang.chen@oracle.com
aoqi@0 138 */
aoqi@0 139 public interface Builder {
aoqi@0 140
aoqi@0 141 /**
aoqi@0 142 * Sets the targetNamespace of the WSDL
aoqi@0 143 *
aoqi@0 144 * @param targetNamespace The targetNamespace to set
aoqi@0 145 *
aoqi@0 146 * @return this Builder instance
aoqi@0 147 */
aoqi@0 148 Builder targetNamespace(String targetNamespace);
aoqi@0 149
aoqi@0 150 /**
aoqi@0 151 * Sets the service name of the WSDL
aoqi@0 152 *
aoqi@0 153 * @param serviceName The serviceName to set
aoqi@0 154 *
aoqi@0 155 * @return this Builder instance
aoqi@0 156 */
aoqi@0 157 Builder serviceName(QName serviceName);
aoqi@0 158
aoqi@0 159 /**
aoqi@0 160 * Sets the port name of the WSDL
aoqi@0 161 *
aoqi@0 162 * @param portName The portName to set
aoqi@0 163 *
aoqi@0 164 * @return this Builder instance
aoqi@0 165 */
aoqi@0 166 Builder portName(QName portName);
aoqi@0 167
aoqi@0 168 /**
aoqi@0 169 * @deprecated - no replacement - this was never implemented
aoqi@0 170 *
aoqi@0 171 * Sets the WSDL URL where the WSDL can be read from
aoqi@0 172 *
aoqi@0 173 * @param wsdlURL The wsdlURL to set
aoqi@0 174 *
aoqi@0 175 * @return this Builder instance
aoqi@0 176 */
aoqi@0 177 Builder wsdlURL(URL wsdlURL);
aoqi@0 178
aoqi@0 179 /**
aoqi@0 180 * @deprecated - no replacement - this was never implemented
aoqi@0 181 *
aoqi@0 182 * Sets the WSDL Source where the WSDL can be read from
aoqi@0 183 *
aoqi@0 184 * @param wsdlSource The wsdlSource to set
aoqi@0 185 *
aoqi@0 186 * @return this Builder instance
aoqi@0 187 */
aoqi@0 188 Builder wsdlSource(Source wsdlSource);
aoqi@0 189
aoqi@0 190 /**
aoqi@0 191 * @deprecated - no replacement - this was never implemented
aoqi@0 192 *
aoqi@0 193 * Sets the {@link EntityResolver} for reading the WSDL
aoqi@0 194 *
aoqi@0 195 * @param entityResolver The {@link EntityResolver} to set
aoqi@0 196 *
aoqi@0 197 * @return this Builder instance
aoqi@0 198 */
aoqi@0 199 Builder entityResolver(EntityResolver entityResolver);
aoqi@0 200
aoqi@0 201 /**
aoqi@0 202 * Sets the ClassLoader which is used to load the service endpoint
aoqi@0 203 * interface, implementation bean, and all the value types. If this
aoqi@0 204 * value is not set, the default it uses contractClass.getClassLoader().
aoqi@0 205 *
aoqi@0 206 * @param classLoader The classLoader to set
aoqi@0 207 *
aoqi@0 208 * @return this Builder instance
aoqi@0 209 */
aoqi@0 210 Builder classLoader(ClassLoader classLoader);
aoqi@0 211
aoqi@0 212 /**
aoqi@0 213 * Sets A list of WebServiceFeatures
aoqi@0 214 *
aoqi@0 215 * @param features The list of WebServiceFeatures
aoqi@0 216 *
aoqi@0 217 * @return this Builder instance
aoqi@0 218 */
aoqi@0 219 Builder feature(WebServiceFeature... features);
aoqi@0 220
aoqi@0 221 /**
aoqi@0 222 * Sets A property of the Databinding object to be created
aoqi@0 223 *
aoqi@0 224 * @param name The name of the property
aoqi@0 225 * @param value The value of the property
aoqi@0 226 *
aoqi@0 227 * @return this Builder instance
aoqi@0 228 */
aoqi@0 229 Builder property(String name, Object value);
aoqi@0 230
aoqi@0 231 /**
aoqi@0 232 * Builds a new Databinding instance
aoqi@0 233 *
aoqi@0 234 * @return The Builder instance
aoqi@0 235 */
aoqi@0 236 Databinding build();
aoqi@0 237
aoqi@0 238 /**
aoqi@0 239 * Creates the WSDLGenerator which can be used to generate the WSDL
aoqi@0 240 * representation of the service endpoint interface of this Databinding
aoqi@0 241 * object.
aoqi@0 242 *
aoqi@0 243 * @return WSDLGenerator The WSDLGenerator
aoqi@0 244 */
aoqi@0 245 com.oracle.webservices.internal.api.databinding.WSDLGenerator createWSDLGenerator();
aoqi@0 246 }
aoqi@0 247 }

mercurial