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 Tue Apr 09 14:51:13 2013 +0100 1.3 @@ -0,0 +1,126 @@ 1.4 +/* 1.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 1.6 + * 1.7 + * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. 1.8 + * 1.9 + * The contents of this file are subject to the terms of either the GNU 1.10 + * General Public License Version 2 only ("GPL") or the Common Development 1.11 + * and Distribution License("CDDL") (collectively, the "License"). You 1.12 + * may not use this file except in compliance with the License. You can 1.13 + * obtain a copy of the License at 1.14 + * http://glassfish.java.net/public/CDDL+GPL_1_1.html 1.15 + * or packager/legal/LICENSE.txt. See the License for the specific 1.16 + * language governing permissions and limitations under the License. 1.17 + * 1.18 + * When distributing the software, include this License Header Notice in each 1.19 + * file and include the License file at packager/legal/LICENSE.txt. 1.20 + * 1.21 + * GPL Classpath Exception: 1.22 + * Oracle designates this particular file as subject to the "Classpath" 1.23 + * exception as provided by Oracle in the GPL Version 2 section of the License 1.24 + * file that accompanied this code. 1.25 + * 1.26 + * Modifications: 1.27 + * If applicable, add the following below the License Header, with the fields 1.28 + * enclosed by brackets [] replaced by your own identifying information: 1.29 + * "Portions Copyright [year] [name of copyright owner]" 1.30 + * 1.31 + * Contributor(s): 1.32 + * If you wish your version of this file to be governed by only the CDDL or 1.33 + * only the GPL Version 2, indicate your decision by adding "[Contributor] 1.34 + * elects to include this software in this distribution under the [CDDL or GPL 1.35 + * Version 2] license." If you don't indicate a single choice of license, a 1.36 + * recipient has the option to distribute your version of this file under 1.37 + * either the CDDL, the GPL Version 2 or to extend the choice of license to 1.38 + * its licensees as provided above. However, if you add GPL Version 2 code 1.39 + * and therefore, elected the GPL Version 2 license, then the option applies 1.40 + * only if the new code is made subject to such option by the copyright 1.41 + * holder. 1.42 + */ 1.43 + 1.44 +package com.oracle.webservices.internal.api; 1.45 + 1.46 +import java.lang.annotation.Retention; 1.47 +import java.lang.annotation.RetentionPolicy; 1.48 + 1.49 +import javax.xml.ws.http.HTTPBinding; 1.50 +import javax.xml.ws.soap.SOAPBinding; 1.51 +import javax.xml.ws.spi.WebServiceFeatureAnnotation; 1.52 + 1.53 +/** 1.54 + * The EnvelopeStyle annotation is used to specify the message envelope style(s) 1.55 + * for a web service endpoint implementation class. To smooth the migration from 1.56 + * the BindingType annotation to this EnvelopeStyle annotation, each of the 1.57 + * styles is mapped to a binding identifier defined in JAX-WS specification. 1.58 + * Though a binding identifier includes both the envelope style and transport, 1.59 + * an envelope style defined herein does NOT imply or mandate any transport protocol 1.60 + * to be use together; HTTP is the default transport. An implementation may 1.61 + * chose to support other transport with any of the envelope styles. 1.62 + * 1.63 + * This annotation may be overriden programmatically or via deployment 1.64 + * descriptors, depending on the platform in use. 1.65 + * 1.66 + * @author shih-chang.chen@oracle.com 1.67 + */ 1.68 +@WebServiceFeatureAnnotation(id="", bean=com.oracle.webservices.internal.api.EnvelopeStyleFeature.class) 1.69 +@Retention(RetentionPolicy.RUNTIME) 1.70 +public @interface EnvelopeStyle { 1.71 + 1.72 + /** 1.73 + * The envelope styles. If not specified, the default is the SOAP 1.1. 1.74 + * 1.75 + * @return The enveloping styles 1.76 + */ 1.77 + Style[] style() default { Style.SOAP11 }; 1.78 + 1.79 + public enum Style { 1.80 + 1.81 + /** 1.82 + * SOAP1.1. For JAX-WS, this is mapped from: 1.83 + * javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING 1.84 + */ 1.85 + SOAP11(SOAPBinding.SOAP11HTTP_BINDING), 1.86 + 1.87 + /** 1.88 + * SOAP1.2. For JAX-WS, this is mapped from: 1.89 + * javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING 1.90 + */ 1.91 + SOAP12(SOAPBinding.SOAP12HTTP_BINDING), 1.92 + 1.93 + /** 1.94 + * The raw XML. For JAX-WS, this is mapped from: 1.95 + * javax.xml.ws.http.HTTPBinding.HTTP_BINDING 1.96 + */ 1.97 + XML(HTTPBinding.HTTP_BINDING); 1.98 + 1.99 + /** 1.100 + * The BindingID used by the BindingType annotation. 1.101 + */ 1.102 + public final String bindingId; 1.103 + 1.104 + private Style(String id) { 1.105 + bindingId = id; 1.106 + } 1.107 + 1.108 + /** 1.109 + * Checks if the style is SOAP 1.1. 1.110 + * 1.111 + * @return true if the style is SOAP 1.1. 1.112 + */ 1.113 + public boolean isSOAP11() { return this.equals(SOAP11); } 1.114 + 1.115 + /** 1.116 + * Checks if the style is SOAP 1.2. 1.117 + * 1.118 + * @return true if the style is SOAP 1.2. 1.119 + */ 1.120 + public boolean isSOAP12() { return this.equals(SOAP12); } 1.121 + 1.122 + /** 1.123 + * Checks if the style is XML. 1.124 + * 1.125 + * @return true if the style is XML. 1.126 + */ 1.127 + public boolean isXML() { return this.equals(XML); } 1.128 + } 1.129 +}