Deprecate support classes for Sun's JDK HTTP server

Issue: SPR-17143
This commit is contained in:
Juergen Hoeller 2018-08-07 20:35:53 +02:00
parent 34ddb88851
commit 2b051b8b32
11 changed files with 18 additions and 52 deletions

View File

@ -33,7 +33,6 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.lang.UsesSunHttpServer;
/** /**
* {@link org.springframework.beans.factory.FactoryBean} that creates a simple * {@link org.springframework.beans.factory.FactoryBean} that creates a simple
@ -51,8 +50,10 @@ import org.springframework.lang.UsesSunHttpServer;
* @since 2.5.1 * @since 2.5.1
* @see #setPort * @see #setPort
* @see #setContexts * @see #setContexts
* @deprecated as of Spring Framework 5.1, in favor of embedded Tomcat/Jetty/Undertow
*/ */
@UsesSunHttpServer @Deprecated
@org.springframework.lang.UsesSunHttpServer
public class SimpleHttpServerFactoryBean implements FactoryBean<HttpServer>, InitializingBean, DisposableBean { public class SimpleHttpServerFactoryBean implements FactoryBean<HttpServer>, InitializingBean, DisposableBean {
protected final Log logger = LogFactory.getLog(getClass()); protected final Log logger = LogFactory.getLog(getClass());

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -28,7 +28,9 @@ import java.lang.annotation.Target;
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @since 4.1 * @since 4.1
* @deprecated as of 5.1, along with Spring's Sun HTTP Server support classes
*/ */
@Deprecated
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE}) @Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE})
@Documented @Documented

View File

@ -53,7 +53,6 @@ import org.springframework.util.CommonsLogWriter;
* @since 2.5.1 * @since 2.5.1
* @see #invoke(java.io.InputStream, java.io.OutputStream) * @see #invoke(java.io.InputStream, java.io.OutputStream)
* @see HessianServiceExporter * @see HessianServiceExporter
* @see SimpleHessianServiceExporter
*/ */
public class HessianExporter extends RemoteExporter implements InitializingBean { public class HessianExporter extends RemoteExporter implements InitializingBean {

View File

@ -29,9 +29,6 @@ import org.springframework.web.util.NestedServletException;
* Servlet-API-based HTTP request handler that exports the specified service bean * Servlet-API-based HTTP request handler that exports the specified service bean
* as Hessian service endpoint, accessible via a Hessian proxy. * as Hessian service endpoint, accessible via a Hessian proxy.
* *
* <p><b>Note:</b> Spring also provides an alternative version of this exporter,
* for Sun's JRE 1.6 HTTP server: {@link SimpleHessianServiceExporter}.
*
* <p>Hessian is a slim, binary RPC protocol. * <p>Hessian is a slim, binary RPC protocol.
* For information on Hessian, see the * For information on Hessian, see the
* <a href="http://www.caucho.com/hessian">Hessian website</a>. * <a href="http://www.caucho.com/hessian">Hessian website</a>.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,6 @@ import java.io.IOException;
import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpHandler;
import org.springframework.lang.UsesSunHttpServer;
import org.springframework.util.FileCopyUtils; import org.springframework.util.FileCopyUtils;
/** /**
@ -43,9 +42,10 @@ import org.springframework.util.FileCopyUtils;
* @since 2.5.1 * @since 2.5.1
* @see org.springframework.remoting.caucho.HessianClientInterceptor * @see org.springframework.remoting.caucho.HessianClientInterceptor
* @see org.springframework.remoting.caucho.HessianProxyFactoryBean * @see org.springframework.remoting.caucho.HessianProxyFactoryBean
* @see org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter * @deprecated as of Spring Framework 5.1, in favor of {@link HessianServiceExporter}
*/ */
@UsesSunHttpServer @Deprecated
@org.springframework.lang.UsesSunHttpServer
public class SimpleHessianServiceExporter extends HessianExporter implements HttpHandler { public class SimpleHessianServiceExporter extends HessianExporter implements HttpHandler {
/** /**

View File

@ -36,9 +36,6 @@ import org.springframework.web.util.NestedServletException;
* Servlet-API-based HTTP request handler that exports the specified service bean * Servlet-API-based HTTP request handler that exports the specified service bean
* as HTTP invoker service endpoint, accessible via an HTTP invoker proxy. * as HTTP invoker service endpoint, accessible via an HTTP invoker proxy.
* *
* <p><b>Note:</b> Spring also provides an alternative version of this exporter,
* for Sun's JRE 1.6 HTTP server: {@link SimpleHttpInvokerServiceExporter}.
*
* <p>Deserializes remote invocation objects and serializes remote invocation * <p>Deserializes remote invocation objects and serializes remote invocation
* result objects. Uses Java serialization just like RMI, but provides the * result objects. Uses Java serialization just like RMI, but provides the
* same ease of setup as Caucho's HTTP-based Hessian protocol. * same ease of setup as Caucho's HTTP-based Hessian protocol.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -25,7 +25,6 @@ import java.io.OutputStream;
import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpHandler;
import org.springframework.lang.UsesSunHttpServer;
import org.springframework.remoting.rmi.RemoteInvocationSerializingExporter; import org.springframework.remoting.rmi.RemoteInvocationSerializingExporter;
import org.springframework.remoting.support.RemoteInvocation; import org.springframework.remoting.support.RemoteInvocation;
import org.springframework.remoting.support.RemoteInvocationResult; import org.springframework.remoting.support.RemoteInvocationResult;
@ -55,9 +54,10 @@ import org.springframework.remoting.support.RemoteInvocationResult;
* @since 2.5.1 * @since 2.5.1
* @see org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor * @see org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
* @see org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean * @see org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean
* @see org.springframework.remoting.caucho.SimpleHessianServiceExporter * @deprecated as of Spring Framework 5.1, in favor of {@link HttpInvokerServiceExporter}
*/ */
@UsesSunHttpServer @Deprecated
@org.springframework.lang.UsesSunHttpServer
public class SimpleHttpInvokerServiceExporter extends RemoteInvocationSerializingExporter implements HttpHandler { public class SimpleHttpInvokerServiceExporter extends RemoteInvocationSerializingExporter implements HttpHandler {
/** /**

View File

@ -48,7 +48,6 @@ import org.springframework.util.Assert;
* @see javax.jws.WebService * @see javax.jws.WebService
* @see javax.xml.ws.Endpoint * @see javax.xml.ws.Endpoint
* @see SimpleJaxWsServiceExporter * @see SimpleJaxWsServiceExporter
* @see SimpleHttpServerJaxWsServiceExporter
*/ */
public abstract class AbstractJaxWsServiceExporter implements BeanFactoryAware, InitializingBean, DisposableBean { public abstract class AbstractJaxWsServiceExporter implements BeanFactoryAware, InitializingBean, DisposableBean {

View File

@ -30,7 +30,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
import org.springframework.lang.UsesSunHttpServer;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**
@ -49,8 +48,10 @@ import org.springframework.util.Assert;
* @see javax.jws.WebService * @see javax.jws.WebService
* @see javax.xml.ws.Endpoint#publish(Object) * @see javax.xml.ws.Endpoint#publish(Object)
* @see SimpleJaxWsServiceExporter * @see SimpleJaxWsServiceExporter
* @deprecated as of Spring Framework 5.1, in favor of {@link SimpleJaxWsServiceExporter}
*/ */
@UsesSunHttpServer @Deprecated
@org.springframework.lang.UsesSunHttpServer
public class SimpleHttpServerJaxWsServiceExporter extends AbstractJaxWsServiceExporter { public class SimpleHttpServerJaxWsServiceExporter extends AbstractJaxWsServiceExporter {
protected final Log logger = LogFactory.getLog(getClass()); protected final Log logger = LogFactory.getLog(getClass());

View File

@ -30,17 +30,12 @@ import javax.xml.ws.WebServiceProvider;
* *
* <p>Note that this exporter will only work if the JAX-WS runtime actually * <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 * 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 * ships an internal HTTP server.
* 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 6
* HTTP server, consider using {@link SimpleHttpServerJaxWsServiceExporter}!
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.5 * @since 2.5
* @see javax.jws.WebService * @see javax.jws.WebService
* @see javax.xml.ws.Endpoint#publish(String) * @see javax.xml.ws.Endpoint#publish(String)
* @see SimpleHttpServerJaxWsServiceExporter
*/ */
public class SimpleJaxWsServiceExporter extends AbstractJaxWsServiceExporter { public class SimpleJaxWsServiceExporter extends AbstractJaxWsServiceExporter {

View File

@ -442,31 +442,6 @@ servlet name matching the bean name of the target exporter:
</servlet-mapping> </servlet-mapping>
---- ----
If you are running outside of a servlet container and are using Oracle's Java 6, then you
can use the built-in HTTP server implementation. You can configure the
`SimpleHttpServerFactoryBean` together with a `SimpleHttpInvokerServiceExporter` as is
shown in this example:
[source,xml,indent=0]
[subs="verbatim,quotes"]
----
<bean name="accountExporter"
class="org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter">
<property name="service" ref="accountService"/>
<property name="serviceInterface" value="example.AccountService"/>
</bean>
<bean id="httpServer"
class="org.springframework.remoting.support.SimpleHttpServerFactoryBean">
<property name="contexts">
<util:map>
<entry key="/remoting/AccountService" value-ref="accountExporter"/>
</util:map>
</property>
<property name="port" value="8080"/>
</bean>
----
[[remoting-httpinvoker-client]] [[remoting-httpinvoker-client]]
==== Linking in the service at the client ==== Linking in the service at the client