1 /*
2 * Copyright (c) 1997, 2013, 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
58 * sets the handler chain on the binding impl.
59 *
60 * <p>
61 * This class is made abstract as we don't see a situation when
62 * a BindingImpl has much meaning without binding id.
63 * IOW, for a specific binding there will be a class
64 * extending BindingImpl, for example SOAPBindingImpl.
65 *
66 * <p>
67 * The spi Binding interface extends Binding.
68 *
69 * @author WS Development Team
70 */
71 public abstract class BindingImpl implements WSBinding {
72
73 protected static final WebServiceFeature[] EMPTY_FEATURES = new WebServiceFeature[0];
74
75 //This is reset when ever Binding.setHandlerChain() or SOAPBinding.setRoles() is called.
76 private HandlerConfiguration handlerConfig;
77 private final Set<QName> addedHeaders = new HashSet<QName>();
78 private final Set<QName> knownHeaders = new HashSet<QName>();
79 private final Set<QName> unmodKnownHeaders = Collections.unmodifiableSet(knownHeaders);
80 private final BindingID bindingId;
81 // Features that are set(enabled/disabled) on the binding
82 protected final WebServiceFeatureList features;
83 // Features that are set(enabled/disabled) on the binding or an operation
84 protected final Map<QName, WebServiceFeatureList> operationFeatures = new HashMap<QName, WebServiceFeatureList>();
85 // Features that are set(enabled/disabled) on the binding, an operation or an input message
86 protected final Map<QName, WebServiceFeatureList> inputMessageFeatures = new HashMap<QName, WebServiceFeatureList>();
87 // Features that are set(enabled/disabled) on the binding, an operation or an output message
88 protected final Map<QName, WebServiceFeatureList> outputMessageFeatures = new HashMap<QName, WebServiceFeatureList>();
89 // Features that are set(enabled/disabled) on the binding, an operation or a fault message
90 protected final Map<MessageKey, WebServiceFeatureList> faultMessageFeatures = new HashMap<MessageKey, WebServiceFeatureList>();
91
92 protected javax.xml.ws.Service.Mode serviceMode = javax.xml.ws.Service.Mode.PAYLOAD;
93
94 protected MessageContextFactory messageContextFactory;
95
96 protected BindingImpl(BindingID bindingId, WebServiceFeature ... features) {
97 this.bindingId = bindingId;
98 handlerConfig = new HandlerConfiguration(Collections.<String>emptySet(), Collections.<Handler>emptyList());
|
1 /*
2 * Copyright (c) 1997, 2017, 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
58 * sets the handler chain on the binding impl.
59 *
60 * <p>
61 * This class is made abstract as we don't see a situation when
62 * a BindingImpl has much meaning without binding id.
63 * IOW, for a specific binding there will be a class
64 * extending BindingImpl, for example SOAPBindingImpl.
65 *
66 * <p>
67 * The spi Binding interface extends Binding.
68 *
69 * @author WS Development Team
70 */
71 public abstract class BindingImpl implements WSBinding {
72
73 protected static final WebServiceFeature[] EMPTY_FEATURES = new WebServiceFeature[0];
74
75 //This is reset when ever Binding.setHandlerChain() or SOAPBinding.setRoles() is called.
76 private HandlerConfiguration handlerConfig;
77 private final Set<QName> addedHeaders = new HashSet<QName>();
78 private final Set<QName> knownHeaders = Collections.synchronizedSet(new HashSet<QName>());
79 private final Set<QName> unmodKnownHeaders = Collections.unmodifiableSet(knownHeaders);
80 private final BindingID bindingId;
81 // Features that are set(enabled/disabled) on the binding
82 protected final WebServiceFeatureList features;
83 // Features that are set(enabled/disabled) on the binding or an operation
84 protected final Map<QName, WebServiceFeatureList> operationFeatures = new HashMap<QName, WebServiceFeatureList>();
85 // Features that are set(enabled/disabled) on the binding, an operation or an input message
86 protected final Map<QName, WebServiceFeatureList> inputMessageFeatures = new HashMap<QName, WebServiceFeatureList>();
87 // Features that are set(enabled/disabled) on the binding, an operation or an output message
88 protected final Map<QName, WebServiceFeatureList> outputMessageFeatures = new HashMap<QName, WebServiceFeatureList>();
89 // Features that are set(enabled/disabled) on the binding, an operation or a fault message
90 protected final Map<MessageKey, WebServiceFeatureList> faultMessageFeatures = new HashMap<MessageKey, WebServiceFeatureList>();
91
92 protected javax.xml.ws.Service.Mode serviceMode = javax.xml.ws.Service.Mode.PAYLOAD;
93
94 protected MessageContextFactory messageContextFactory;
95
96 protected BindingImpl(BindingID bindingId, WebServiceFeature ... features) {
97 this.bindingId = bindingId;
98 handlerConfig = new HandlerConfiguration(Collections.<String>emptySet(), Collections.<Handler>emptyList());
|