src/share/jaxws_classes/com/sun/xml/internal/ws/api/BindingID.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 33,46 **** import com.sun.xml.internal.ws.binding.SOAPBindingImpl; import com.sun.xml.internal.ws.binding.WebServiceFeatureList; import com.sun.xml.internal.ws.encoding.SOAPBindingCodec; import com.sun.xml.internal.ws.encoding.XMLHTTPBindingCodec; import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants; - import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants; import com.sun.xml.internal.ws.util.ServiceFinder; import com.sun.xml.internal.ws.developer.JAXWSProperties; - import static com.sun.xml.internal.ws.binding.WebServiceFeatureList.toFeatureArray; import javax.xml.ws.BindingType; import javax.xml.ws.WebServiceException; import javax.xml.ws.WebServiceFeature; import javax.xml.ws.handler.Handler; --- 33,44 ----
*** 155,164 **** --- 153,163 ---- * (such as SOAP1.1, SOAP1.2, REST, ...) * * @return * Always non-null same value. */ + @Override public abstract String toString(); /** * Returna a new {@link WebServiceFeatureList} instance * that represents the features that are built into this binding ID.
*** 216,231 **** --- 215,232 ---- } /** * Compares the equality based on {@link #toString()}. */ + @Override public boolean equals(Object obj) { if(!(obj instanceof BindingID)) return false; return toString().equals(obj.toString()); } + @Override public int hashCode() { return toString().hashCode(); } /**
*** 351,369 **** --- 352,372 ---- /** * Constant that represents REST. */ public static final BindingID XML_HTTP = new Impl(SOAPVersion.SOAP_11, HTTPBinding.HTTP_BINDING,false) { + @Override public Codec createEncoder(WSBinding binding) { return new XMLHTTPBindingCodec(binding.getFeatures()); } }; /** * Constant that represents REST. */ private static final BindingID REST_HTTP = new Impl(SOAPVersion.SOAP_11, JAXWSProperties.REST_BINDING,true) { + @Override public Codec createEncoder(WSBinding binding) { return new XMLHTTPBindingCodec(binding.getFeatures()); } };
*** 376,394 **** --- 379,400 ---- this.version = version; this.lexical = lexical; this.canGenerateWSDL = canGenerateWSDL; } + @Override public SOAPVersion getSOAPVersion() { return version; } + @Override public String toString() { return lexical; } @Deprecated + @Override public boolean canGenerateWSDL() { return canGenerateWSDL; } }
*** 397,439 **** */ private static final class SOAPHTTPImpl extends Impl implements Cloneable { /*final*/ Map<String,String> parameters = new HashMap<String,String>(); static final String MTOM_PARAM = "mtom"; - Boolean mtomSetting = null; public SOAPHTTPImpl(SOAPVersion version, String lexical, boolean canGenerateWSDL) { super(version, lexical, canGenerateWSDL); } public SOAPHTTPImpl(SOAPVersion version, String lexical, boolean canGenerateWSDL, boolean mtomEnabled) { this(version, lexical, canGenerateWSDL); String mtomStr = mtomEnabled ? "true" : "false"; parameters.put(MTOM_PARAM, mtomStr); - mtomSetting = mtomEnabled; } ! public @NotNull Codec createEncoder(WSBinding binding) { return new SOAPBindingCodec(binding.getFeatures()); } private Boolean isMTOMEnabled() { String mtom = parameters.get(MTOM_PARAM); return mtom==null?null:Boolean.valueOf(mtom); } public WebServiceFeatureList createBuiltinFeatureList() { WebServiceFeatureList r=super.createBuiltinFeatureList(); Boolean mtom = isMTOMEnabled(); if(mtom != null) r.add(new MTOMFeature(mtom)); return r; } public String getParameter(String parameterName, String defaultValue) { if (parameters.get(parameterName) == null) return super.getParameter(parameterName, defaultValue); return parameters.get(parameterName); } } } --- 403,450 ---- */ private static final class SOAPHTTPImpl extends Impl implements Cloneable { /*final*/ Map<String,String> parameters = new HashMap<String,String>(); static final String MTOM_PARAM = "mtom"; public SOAPHTTPImpl(SOAPVersion version, String lexical, boolean canGenerateWSDL) { super(version, lexical, canGenerateWSDL); } public SOAPHTTPImpl(SOAPVersion version, String lexical, boolean canGenerateWSDL, boolean mtomEnabled) { this(version, lexical, canGenerateWSDL); String mtomStr = mtomEnabled ? "true" : "false"; parameters.put(MTOM_PARAM, mtomStr); } ! public @NotNull @Override Codec createEncoder(WSBinding binding) { return new SOAPBindingCodec(binding.getFeatures()); } private Boolean isMTOMEnabled() { String mtom = parameters.get(MTOM_PARAM); return mtom==null?null:Boolean.valueOf(mtom); } + @Override public WebServiceFeatureList createBuiltinFeatureList() { WebServiceFeatureList r=super.createBuiltinFeatureList(); Boolean mtom = isMTOMEnabled(); if(mtom != null) r.add(new MTOMFeature(mtom)); return r; } + @Override public String getParameter(String parameterName, String defaultValue) { if (parameters.get(parameterName) == null) return super.getParameter(parameterName, defaultValue); return parameters.get(parameterName); } + + @Override + public SOAPHTTPImpl clone() throws CloneNotSupportedException { + return (SOAPHTTPImpl) super.clone(); + } } }