1 /*
2  * Copyright (c) 1997, 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 com.sun.xml.internal.ws.api.fastinfoset;
27 
28 import com.sun.xml.internal.ws.api.FeatureConstructor;
29 
30 import javax.xml.ws.WebServiceFeature;
31 
32 import com.sun.org.glassfish.gmbal.ManagedAttribute;
33 import com.sun.org.glassfish.gmbal.ManagedData;
34 
35 /**
36  * Enable or disable Fast Infoset on a Web service.
37  * <p>
38  * The following describes the affects of this feature with respect
39  * to being enabled or disabled:
40  * <ul>
41  *  <li> ENABLED: In this Mode, Fast Infoset will be enabled.
42  *  <li> DISABLED: In this Mode, Fast Infoset will be disabled and the
43  *       Web service will not process incoming messages or produce outgoing
44  *       messages encoded using Fast Infoset.
45  * </ul>
46  * <p>
47  * If this feature is not present on a Web service then the default behaviour
48  * is equivalent to this feature being present and enabled.
49  * @author Paul.Sandoz@Sun.Com
50  */
51 @ManagedData
52 public class FastInfosetFeature extends WebServiceFeature {
53     /**
54      * Constant value identifying the {@link FastInfosetFeature}
55      */
56     public static final String ID = "http://java.sun.com/xml/ns/jaxws/fastinfoset";
57 
58     /**
59      * Create a {@link FastInfosetFeature}. The instance created will be enabled.
60      */
FastInfosetFeature()61     public FastInfosetFeature() {
62         this.enabled = true;
63     }
64 
65     /**
66      * Create a {@link FastInfosetFeature}
67      *
68      * @param enabled specifies whether this feature should
69      *                be enabled or not.
70      */
71     @FeatureConstructor({"enabled"})
FastInfosetFeature(boolean enabled)72     public FastInfosetFeature(boolean enabled) {
73         this.enabled = enabled;
74     }
75 
76     /**
77      * {@inheritDoc}
78      */
79     @ManagedAttribute
getID()80     public String getID() {
81         return ID;
82     }
83 }
84