1 /*
   2  * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.xml.ws.spi;
  27 
  28 import java.lang.annotation.Documented;
  29 import java.lang.annotation.Target;
  30 import java.lang.annotation.ElementType;
  31 import java.lang.annotation.Retention;
  32 import java.lang.annotation.RetentionPolicy;
  33 import javax.xml.ws.WebServiceFeature;
  34 import javax.xml.ws.WebServiceRef;
  35 import javax.xml.ws.WebServiceRefs;
  36 import javax.xml.ws.RespectBinding;
  37 import javax.xml.ws.soap.Addressing;
  38 import javax.xml.ws.soap.MTOM;
  39 
  40 /**
  41  * Annotation used to identify other annotations
  42  * as a {@code WebServiceFeature}.
  43  * <p>
  44  * Each {@code WebServiceFeature} annotation annotated with
  45  * this annotation MUST contain an
  46  * {@code enabled} property of type
  47  * {@code boolean} with a default value of {@code true}.
  48  * <p>
  49  * JAX-WS defines the following
  50  * {@code WebServiceFeature} annotations ({@code Addressing},
  51  * {@code MTOM}, {@code RespectBinding}), however, an implementation
  52  * may define vendors specific annotations for other features.
  53  * <p>
  54  * Annotations annotated with {@code WebServiceFeatureAnnotation} MUST
  55  * have the same @Target of {@link WebServiceRef} annotation, so that the resulting
  56  * feature annotation can be used in conjunction with the {@link WebServiceRef}
  57  * annotation if necessary.
  58  * <p>
  59  * If a JAX-WS implementation encounters an annotation annotated
  60  * with the {@code WebServiceFeatureAnnotation} that it does not
  61  * recognize/support an error MUST be given.
  62  *
  63  * @see Addressing
  64  * @see MTOM
  65  * @see RespectBinding
  66  *
  67  * @since 1.6, JAX-WS 2.1
  68  */
  69 @Target(ElementType.ANNOTATION_TYPE)
  70 @Retention(RetentionPolicy.RUNTIME)
  71 @Documented
  72 public @interface WebServiceFeatureAnnotation {
  73     /**
  74      * Unique identifier for the WebServiceFeature.  This
  75      * identifier MUST be unique across all implementations
  76      * of JAX-WS.
  77      */
  78     String id();
  79 
  80     /**
  81      * The {@code WebServiceFeature} bean that is associated
  82      * with the {@code WebServiceFeature} annotation
  83      */
  84     Class<? extends WebServiceFeature> bean();
  85 }