1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/jaxws_classes/com/oracle/webservices/internal/api/EnvelopeStyle.java Wed Apr 27 01:27:09 2016 +0800 1.3 @@ -0,0 +1,111 @@ 1.4 +/* 1.5 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Oracle designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Oracle in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 + * or visit www.oracle.com if you need additional information or have any 1.26 + * questions. 1.27 + */ 1.28 + 1.29 +package com.oracle.webservices.internal.api; 1.30 + 1.31 +import java.lang.annotation.Retention; 1.32 +import java.lang.annotation.RetentionPolicy; 1.33 + 1.34 +import javax.xml.ws.http.HTTPBinding; 1.35 +import javax.xml.ws.soap.SOAPBinding; 1.36 +import javax.xml.ws.spi.WebServiceFeatureAnnotation; 1.37 + 1.38 +/** 1.39 + * The EnvelopeStyle annotation is used to specify the message envelope style(s) 1.40 + * for a web service endpoint implementation class. To smooth the migration from 1.41 + * the BindingType annotation to this EnvelopeStyle annotation, each of the 1.42 + * styles is mapped to a binding identifier defined in JAX-WS specification. 1.43 + * Though a binding identifier includes both the envelope style and transport, 1.44 + * an envelope style defined herein does NOT imply or mandate any transport protocol 1.45 + * to be use together; HTTP is the default transport. An implementation may 1.46 + * chose to support other transport with any of the envelope styles. 1.47 + * 1.48 + * This annotation may be overriden programmatically or via deployment 1.49 + * descriptors, depending on the platform in use. 1.50 + * 1.51 + * @author shih-chang.chen@oracle.com 1.52 + */ 1.53 +@WebServiceFeatureAnnotation(id="", bean=com.oracle.webservices.internal.api.EnvelopeStyleFeature.class) 1.54 +@Retention(RetentionPolicy.RUNTIME) 1.55 +public @interface EnvelopeStyle { 1.56 + 1.57 + /** 1.58 + * The envelope styles. If not specified, the default is the SOAP 1.1. 1.59 + * 1.60 + * @return The enveloping styles 1.61 + */ 1.62 + Style[] style() default { Style.SOAP11 }; 1.63 + 1.64 + public enum Style { 1.65 + 1.66 + /** 1.67 + * SOAP1.1. For JAX-WS, this is mapped from: 1.68 + * javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING 1.69 + */ 1.70 + SOAP11(SOAPBinding.SOAP11HTTP_BINDING), 1.71 + 1.72 + /** 1.73 + * SOAP1.2. For JAX-WS, this is mapped from: 1.74 + * javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING 1.75 + */ 1.76 + SOAP12(SOAPBinding.SOAP12HTTP_BINDING), 1.77 + 1.78 + /** 1.79 + * The raw XML. For JAX-WS, this is mapped from: 1.80 + * javax.xml.ws.http.HTTPBinding.HTTP_BINDING 1.81 + */ 1.82 + XML(HTTPBinding.HTTP_BINDING); 1.83 + 1.84 + /** 1.85 + * The BindingID used by the BindingType annotation. 1.86 + */ 1.87 + public final String bindingId; 1.88 + 1.89 + private Style(String id) { 1.90 + bindingId = id; 1.91 + } 1.92 + 1.93 + /** 1.94 + * Checks if the style is SOAP 1.1. 1.95 + * 1.96 + * @return true if the style is SOAP 1.1. 1.97 + */ 1.98 + public boolean isSOAP11() { return this.equals(SOAP11); } 1.99 + 1.100 + /** 1.101 + * Checks if the style is SOAP 1.2. 1.102 + * 1.103 + * @return true if the style is SOAP 1.2. 1.104 + */ 1.105 + public boolean isSOAP12() { return this.equals(SOAP12); } 1.106 + 1.107 + /** 1.108 + * Checks if the style is XML. 1.109 + * 1.110 + * @return true if the style is XML. 1.111 + */ 1.112 + public boolean isXML() { return this.equals(XML); } 1.113 + } 1.114 +}