Broadly remove deprecated core classes and methods
Issue: SPR-14430
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.http.converter.xml;
|
||||
|
||||
import javax.xml.transform.Source;
|
||||
|
||||
import org.springframework.http.converter.FormHttpMessageConverter;
|
||||
|
||||
/**
|
||||
* Extension of {@link org.springframework.http.converter.FormHttpMessageConverter},
|
||||
* adding support for XML-based parts through a {@link SourceHttpMessageConverter}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0.3
|
||||
* @deprecated in favor of
|
||||
* {@link org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter}
|
||||
*/
|
||||
@Deprecated
|
||||
public class XmlAwareFormHttpMessageConverter extends FormHttpMessageConverter {
|
||||
|
||||
public XmlAwareFormHttpMessageConverter() {
|
||||
super();
|
||||
addPartConverter(new SourceHttpMessageConverter<Source>());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,7 +26,6 @@ import javax.xml.ws.Endpoint;
|
||||
import javax.xml.ws.WebServiceFeature;
|
||||
import javax.xml.ws.WebServiceProvider;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.CannotLoadBeanClassException;
|
||||
@@ -34,13 +33,10 @@ import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Abstract exporter for JAX-WS services, autodetecting annotated service beans
|
||||
* (through the JAX-WS {@link javax.jws.WebService} annotation). Compatible with
|
||||
* JAX-WS 2.1 and 2.2, as included in JDK 6 update 4+ and Java 7/8.
|
||||
* (through the JAX-WS {@link javax.jws.WebService} annotation).
|
||||
*
|
||||
* <p>Subclasses need to implement the {@link #publishEndpoint} template methods
|
||||
* for actual endpoint exposure.
|
||||
@@ -62,8 +58,6 @@ public abstract class AbstractJaxWsServiceExporter implements BeanFactoryAware,
|
||||
|
||||
private WebServiceFeature[] endpointFeatures;
|
||||
|
||||
private Object[] webServiceFeatures;
|
||||
|
||||
private ListableBeanFactory beanFactory;
|
||||
|
||||
private final Set<Endpoint> publishedEndpoints = new LinkedHashSet<Endpoint>();
|
||||
@@ -106,20 +100,6 @@ public abstract class AbstractJaxWsServiceExporter implements BeanFactoryAware,
|
||||
this.endpointFeatures = endpointFeatures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows for providing JAX-WS 2.2 WebServiceFeature specifications:
|
||||
* in the form of actual {@link javax.xml.ws.WebServiceFeature} objects,
|
||||
* WebServiceFeature Class references, or WebServiceFeature class names.
|
||||
* <p>As of Spring 4.0, this is effectively just an alternative way of
|
||||
* specifying {@link #setEndpointFeatures "endpointFeatures"}. Do not specify
|
||||
* both properties at the same time; prefer "endpointFeatures" moving forward.
|
||||
* @deprecated as of Spring 4.0, in favor of {@link #setEndpointFeatures}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setWebServiceFeatures(Object[] webServiceFeatures) {
|
||||
this.webServiceFeatures = webServiceFeatures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtains all web service beans and publishes them as JAX-WS endpoints.
|
||||
*/
|
||||
@@ -190,46 +170,9 @@ public abstract class AbstractJaxWsServiceExporter implements BeanFactoryAware,
|
||||
* @see Endpoint#create(String, Object)
|
||||
*/
|
||||
protected Endpoint createEndpoint(Object bean) {
|
||||
if (this.endpointFeatures != null || this.webServiceFeatures != null) {
|
||||
WebServiceFeature[] endpointFeaturesToUse = this.endpointFeatures;
|
||||
if (endpointFeaturesToUse == null) {
|
||||
endpointFeaturesToUse = new WebServiceFeature[this.webServiceFeatures.length];
|
||||
for (int i = 0; i < this.webServiceFeatures.length; i++) {
|
||||
endpointFeaturesToUse[i] = convertWebServiceFeature(this.webServiceFeatures[i]);
|
||||
}
|
||||
}
|
||||
return Endpoint.create(this.bindingType, bean, endpointFeaturesToUse);
|
||||
}
|
||||
else {
|
||||
return Endpoint.create(this.bindingType, bean);
|
||||
}
|
||||
}
|
||||
|
||||
private WebServiceFeature convertWebServiceFeature(Object feature) {
|
||||
Assert.notNull(feature, "WebServiceFeature specification object must not be null");
|
||||
if (feature instanceof WebServiceFeature) {
|
||||
return (WebServiceFeature) feature;
|
||||
}
|
||||
else if (feature instanceof Class) {
|
||||
return (WebServiceFeature) BeanUtils.instantiate((Class<?>) feature);
|
||||
}
|
||||
else if (feature instanceof String) {
|
||||
try {
|
||||
Class<?> featureClass = getBeanClassLoader().loadClass((String) feature);
|
||||
return (WebServiceFeature) BeanUtils.instantiate(featureClass);
|
||||
}
|
||||
catch (ClassNotFoundException ex) {
|
||||
throw new IllegalArgumentException("Could not load WebServiceFeature class [" + feature + "]");
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException("Unknown WebServiceFeature specification type: " + feature.getClass());
|
||||
}
|
||||
}
|
||||
|
||||
private ClassLoader getBeanClassLoader() {
|
||||
return (beanFactory instanceof ConfigurableBeanFactory ?
|
||||
((ConfigurableBeanFactory) beanFactory).getBeanClassLoader() : ClassUtils.getDefaultClassLoader());
|
||||
return (this.endpointFeatures != null ?
|
||||
Endpoint.create(this.bindingType, bean, this.endpointFeatures) :
|
||||
Endpoint.create(this.bindingType, bean));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,21 +35,18 @@ import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.remoting.RemoteAccessException;
|
||||
import org.springframework.remoting.RemoteConnectFailureException;
|
||||
import org.springframework.remoting.RemoteLookupFailureException;
|
||||
import org.springframework.remoting.RemoteProxyFailureException;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* {@link org.aopalliance.intercept.MethodInterceptor} for accessing a
|
||||
* specific port of a JAX-WS service. Compatible with JAX-WS 2.1 and 2.2,
|
||||
* as included in JDK 6 update 4+ and Java 7/8.
|
||||
* specific port of a JAX-WS service.
|
||||
*
|
||||
* <p>Uses either {@link LocalJaxWsServiceFactory}'s facilities underneath,
|
||||
* or takes an explicit reference to an existing JAX-WS Service instance
|
||||
@@ -86,8 +83,6 @@ public class JaxWsPortClientInterceptor extends LocalJaxWsServiceFactory
|
||||
|
||||
private WebServiceFeature[] portFeatures;
|
||||
|
||||
private Object[] webServiceFeatures;
|
||||
|
||||
private Class<?> serviceInterface;
|
||||
|
||||
private boolean lookupServiceOnStartup = true;
|
||||
@@ -271,22 +266,6 @@ public class JaxWsPortClientInterceptor extends LocalJaxWsServiceFactory
|
||||
this.portFeatures = features;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify WebServiceFeature specifications for the JAX-WS port stub:
|
||||
* in the form of actual {@link javax.xml.ws.WebServiceFeature} objects,
|
||||
* WebServiceFeature Class references, or WebServiceFeature class names.
|
||||
* <p>As of Spring 4.0, this is effectively just an alternative way of
|
||||
* specifying {@link #setPortFeatures "portFeatures"}. Do not specify
|
||||
* both properties at the same time; prefer "portFeatures" moving forward.
|
||||
* @deprecated as of Spring 4.0, in favor of the differentiated
|
||||
* {@link #setServiceFeatures "serviceFeatures"} and
|
||||
* {@link #setPortFeatures "portFeatures"} properties
|
||||
*/
|
||||
@Deprecated
|
||||
public void setWebServiceFeatures(Object[] webServiceFeatures) {
|
||||
this.webServiceFeatures = webServiceFeatures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the interface of the service that this factory should create a proxy for.
|
||||
*/
|
||||
@@ -315,10 +294,8 @@ public class JaxWsPortClientInterceptor extends LocalJaxWsServiceFactory
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the bean ClassLoader to use for this interceptor:
|
||||
* for resolving WebServiceFeature class names as specified through
|
||||
* {@link #setWebServiceFeatures}, and also for building a client
|
||||
* proxy in the {@link JaxWsPortProxyFactoryBean} subclass.
|
||||
* Set the bean ClassLoader to use for this interceptor: primarily for
|
||||
* building a client proxy in the {@link JaxWsPortProxyFactoryBean} subclass.
|
||||
*/
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
@@ -429,16 +406,9 @@ public class JaxWsPortClientInterceptor extends LocalJaxWsServiceFactory
|
||||
* {@code Service.getPort(...)}
|
||||
*/
|
||||
protected Object getPortStub(Service service, QName portQName) {
|
||||
if (this.portFeatures != null || this.webServiceFeatures != null) {
|
||||
WebServiceFeature[] portFeaturesToUse = this.portFeatures;
|
||||
if (portFeaturesToUse == null) {
|
||||
portFeaturesToUse = new WebServiceFeature[this.webServiceFeatures.length];
|
||||
for (int i = 0; i < this.webServiceFeatures.length; i++) {
|
||||
portFeaturesToUse[i] = convertWebServiceFeature(this.webServiceFeatures[i]);
|
||||
}
|
||||
}
|
||||
return (portQName != null ? service.getPort(portQName, getServiceInterface(), portFeaturesToUse) :
|
||||
service.getPort(getServiceInterface(), portFeaturesToUse));
|
||||
if (this.portFeatures != null) {
|
||||
return (portQName != null ? service.getPort(portQName, getServiceInterface(), this.portFeatures) :
|
||||
service.getPort(getServiceInterface(), this.portFeatures));
|
||||
}
|
||||
else {
|
||||
return (portQName != null ? service.getPort(portQName, getServiceInterface()) :
|
||||
@@ -446,34 +416,6 @@ public class JaxWsPortClientInterceptor extends LocalJaxWsServiceFactory
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given feature specification object to a WebServiceFeature instance
|
||||
* @param feature the feature specification object, as passed into the
|
||||
* {@link #setWebServiceFeatures "webServiceFeatures"} bean property
|
||||
* @return the WebServiceFeature instance (never {@code null})
|
||||
*/
|
||||
private WebServiceFeature convertWebServiceFeature(Object feature) {
|
||||
Assert.notNull(feature, "WebServiceFeature specification object must not be null");
|
||||
if (feature instanceof WebServiceFeature) {
|
||||
return (WebServiceFeature) feature;
|
||||
}
|
||||
else if (feature instanceof Class) {
|
||||
return (WebServiceFeature) BeanUtils.instantiate((Class<?>) feature);
|
||||
}
|
||||
else if (feature instanceof String) {
|
||||
try {
|
||||
Class<?> featureClass = getBeanClassLoader().loadClass((String) feature);
|
||||
return (WebServiceFeature) BeanUtils.instantiate(featureClass);
|
||||
}
|
||||
catch (ClassNotFoundException ex) {
|
||||
throw new IllegalArgumentException("Could not load WebServiceFeature class [" + feature + "]");
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException("Unknown WebServiceFeature specification type: " + feature.getClass());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the given JAX-WS port stub, applying properties to it.
|
||||
* Called by {@link #prepare}.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,8 +31,7 @@ import org.springframework.beans.factory.FactoryBean;
|
||||
* @see #setServiceInterface
|
||||
* @see LocalJaxWsServiceFactoryBean
|
||||
*/
|
||||
public class JaxWsPortProxyFactoryBean extends JaxWsPortClientInterceptor
|
||||
implements FactoryBean<Object> {
|
||||
public class JaxWsPortProxyFactoryBean extends JaxWsPortClientInterceptor implements FactoryBean<Object> {
|
||||
|
||||
private Object serviceProxy;
|
||||
|
||||
|
||||
@@ -114,7 +114,6 @@ public class LocalJaxWsServiceFactory {
|
||||
/**
|
||||
* Specify WebServiceFeature objects (e.g. as inner bean definitions)
|
||||
* to apply to JAX-WS service creation.
|
||||
* <p>Note: This mechanism requires JAX-WS 2.2 or higher.
|
||||
* @since 4.0
|
||||
* @see Service#create(QName, WebServiceFeature...)
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,9 +31,9 @@ import javax.xml.ws.WebServiceProvider;
|
||||
* <p>Note that this exporter will only work if the JAX-WS runtime actually
|
||||
* supports publishing with an address argument, i.e. if the JAX-WS runtime
|
||||
* ships an internal HTTP server. This is the case with the JAX-WS runtime
|
||||
* that's inclued in Sun's JDK 1.6 but not with the standalone JAX-WS 2.1 RI.
|
||||
* that's included in Sun's JDK 6 but not with the standalone JAX-WS 2.1 RI.
|
||||
*
|
||||
* <p>For explicit configuration of JAX-WS endpoints with Sun's JDK 1.6
|
||||
* <p>For explicit configuration of JAX-WS endpoints with Sun's JDK 6
|
||||
* HTTP server, consider using {@link SimpleHttpServerJaxWsServiceExporter}!
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -181,23 +181,6 @@ public abstract class WebUtils {
|
||||
System.getProperties().remove(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether default HTML escaping is enabled for the web application,
|
||||
* i.e. the value of the "defaultHtmlEscape" context-param in {@code web.xml}
|
||||
* (if any). Falls back to {@code false} in case of no explicit default given.
|
||||
* @param servletContext the servlet context of the web application
|
||||
* @return whether default HTML escaping is enabled (default is {@code false})
|
||||
* @deprecated as of Spring 4.1, in favor of {@link #getDefaultHtmlEscape}
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isDefaultHtmlEscape(ServletContext servletContext) {
|
||||
if (servletContext == null) {
|
||||
return false;
|
||||
}
|
||||
String param = servletContext.getInitParameter(HTML_ESCAPE_CONTEXT_PARAM);
|
||||
return Boolean.valueOf(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether default HTML escaping is enabled for the web application,
|
||||
* i.e. the value of the "defaultHtmlEscape" context-param in {@code web.xml}
|
||||
|
||||
Reference in New Issue
Block a user