diff --git a/build.gradle b/build.gradle index a7d56593ad..9d1d6de719 100644 --- a/build.gradle +++ b/build.gradle @@ -438,7 +438,7 @@ project("spring-web") { provided("javax.servlet:javax.servlet-api:3.0.1") provided("javax.servlet.jsp:jsp-api:2.1") provided("javax.activation:activation:1.1") - optional("com.caucho:hessian:3.2.1") + optional("com.caucho:hessian:4.0.7") optional("rome:rome:1.0") optional("commons-fileupload:commons-fileupload:1.3") optional("org.apache.httpcomponents:httpclient:4.2") diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapClientInterceptor.java b/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapClientInterceptor.java index 28b6bd5087..fca4c6c975 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapClientInterceptor.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapClientInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -57,7 +57,10 @@ import org.springframework.util.Assert; * @see BurlapProxyFactoryBean * @see com.caucho.burlap.client.BurlapProxyFactory * @see com.caucho.burlap.server.BurlapServlet + * @deprecated as of Spring 4.0, since Burlap hasn't evolved in years + * and is effectively retired (in contrast to its sibling Hessian) */ +@Deprecated public class BurlapClientInterceptor extends UrlBasedRemoteAccessor implements MethodInterceptor { private BurlapProxyFactory proxyFactory = new BurlapProxyFactory(); diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapExporter.java b/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapExporter.java index eca759bdb7..4eab6397dc 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapExporter.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -41,7 +41,10 @@ import org.springframework.util.Assert; * @see #invoke(java.io.InputStream, java.io.OutputStream) * @see BurlapServiceExporter * @see SimpleBurlapServiceExporter + * @deprecated as of Spring 4.0, since Burlap hasn't evolved in years + * and is effectively retired (in contrast to its sibling Hessian) */ +@Deprecated public class BurlapExporter extends RemoteExporter implements InitializingBean { private BurlapSkeleton skeleton; diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapProxyFactoryBean.java b/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapProxyFactoryBean.java index f15c1eda0e..6872893cbc 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapProxyFactoryBean.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -39,7 +39,10 @@ import org.springframework.beans.factory.FactoryBean; * @see org.springframework.remoting.caucho.HessianProxyFactoryBean * @see org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean * @see org.springframework.remoting.rmi.RmiProxyFactoryBean + * @deprecated as of Spring 4.0, since Burlap hasn't evolved in years + * and is effectively retired (in contrast to its sibling Hessian) */ +@Deprecated public class BurlapProxyFactoryBean extends BurlapClientInterceptor implements FactoryBean { private Object serviceProxy; diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapServiceExporter.java b/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapServiceExporter.java index ca25dd79bf..151ca5f24f 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapServiceExporter.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/BurlapServiceExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -48,7 +48,10 @@ import org.springframework.web.util.NestedServletException; * @see org.springframework.remoting.caucho.HessianServiceExporter * @see org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter * @see org.springframework.remoting.rmi.RmiServiceExporter + * @deprecated as of Spring 4.0, since Burlap hasn't evolved in years + * and is effectively retired (in contrast to its sibling Hessian) */ +@Deprecated public class BurlapServiceExporter extends BurlapExporter implements HttpRequestHandler { /** diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/HessianClientInterceptor.java b/spring-web/src/main/java/org/springframework/remoting/caucho/HessianClientInterceptor.java index ff89f1bb86..ed7f5b3816 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/HessianClientInterceptor.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/HessianClientInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -23,6 +23,7 @@ import java.net.MalformedURLException; import com.caucho.hessian.HessianException; import com.caucho.hessian.client.HessianConnectionException; +import com.caucho.hessian.client.HessianConnectionFactory; import com.caucho.hessian.client.HessianProxyFactory; import com.caucho.hessian.client.HessianRuntimeException; import com.caucho.hessian.io.SerializerFactory; @@ -44,6 +45,7 @@ import org.springframework.util.Assert; *

Hessian is a slim, binary RPC protocol. * For information on Hessian, see the * Hessian website + * Note: As of Spring 4.0, this client requires Hessian 4.0 or above. * *

Note: There is no requirement for services accessed with this proxy factory * to have been exported using Spring's {@link HessianServiceExporter}, as there is @@ -96,6 +98,14 @@ public class HessianClientInterceptor extends UrlBasedRemoteAccessor implements this.proxyFactory.getSerializerFactory().setSendCollectionType(sendCollectionType); } + /** + * Set whether to allow non-serializable types as Hessian arguments + * and return values. Default is "true". + */ + public void setAllowNonSerializable(boolean allowNonSerializable) { + this.proxyFactory.getSerializerFactory().setAllowNonSerializable(allowNonSerializable); + } + /** * Set whether overloaded methods should be enabled for remote invocations. * Default is "false". @@ -142,6 +152,21 @@ public class HessianClientInterceptor extends UrlBasedRemoteAccessor implements this.proxyFactory.setChunkedPost(chunkedPost); } + /** + * Specify a custom HessianConnectionFactory to use for the Hessian client. + */ + public void setConnectionFactory(HessianConnectionFactory connectionFactory) { + this.proxyFactory.setConnectionFactory(connectionFactory); + } + + /** + * Set the socket connect timeout to use for the Hessian client. + * @see com.caucho.hessian.client.HessianProxyFactory#setConnectTimeout + */ + public void setConnectTimeout(long timeout) { + this.proxyFactory.setConnectTimeout(timeout); + } + /** * Set the timeout to use when waiting for a reply from the Hessian service. * @see com.caucho.hessian.client.HessianProxyFactory#setReadTimeout @@ -207,7 +232,7 @@ public class HessianClientInterceptor extends UrlBasedRemoteAccessor implements */ protected Object createHessianProxy(HessianProxyFactory proxyFactory) throws MalformedURLException { Assert.notNull(getServiceInterface(), "'serviceInterface' is required"); - return proxyFactory.create(getServiceInterface(), getServiceUrl()); + return proxyFactory.create(getServiceInterface(), getServiceUrl(), getBeanClassLoader()); } diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/HessianExporter.java b/spring-web/src/main/java/org/springframework/remoting/caucho/HessianExporter.java index 5aba1cb154..a714b77f78 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/HessianExporter.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/HessianExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -30,6 +30,7 @@ import com.caucho.hessian.io.HessianDebugInputStream; import com.caucho.hessian.io.HessianDebugOutputStream; import com.caucho.hessian.io.HessianInput; import com.caucho.hessian.io.HessianOutput; +import com.caucho.hessian.io.HessianRemoteResolver; import com.caucho.hessian.io.SerializerFactory; import com.caucho.hessian.server.HessianSkeleton; import org.apache.commons.logging.Log; @@ -45,7 +46,7 @@ import org.springframework.util.CommonsLogWriter; *

Hessian is a slim, binary RPC protocol. * For information on Hessian, see the * Hessian website. - * Note: As of Spring 3.0, this exporter requires Hessian 3.2 or above. + * Note: As of Spring 4.0, this exporter requires Hessian 4.0 or above. * * @author Juergen Hoeller * @since 2.5.1 @@ -60,6 +61,8 @@ public class HessianExporter extends RemoteExporter implements InitializingBean private SerializerFactory serializerFactory = new SerializerFactory(); + private HessianRemoteResolver remoteResolver; + private Log debugLogger; private HessianSkeleton skeleton; @@ -83,6 +86,22 @@ public class HessianExporter extends RemoteExporter implements InitializingBean this.serializerFactory.setSendCollectionType(sendCollectionType); } + /** + * Set whether to allow non-serializable types as Hessian arguments + * and return values. Default is "true". + */ + public void setAllowNonSerializable(boolean allowNonSerializable) { + this.serializerFactory.setAllowNonSerializable(allowNonSerializable); + } + + /** + * Specify a custom HessianRemoteResolver to use for resolving remote + * object references. + */ + public void setRemoteResolver(HessianRemoteResolver remoteResolver) { + this.remoteResolver = remoteResolver; + } + /** * Set whether Hessian's debug mode should be enabled, logging to * this exporter's Commons Logging log. Default is "false". @@ -193,6 +212,9 @@ public class HessianExporter extends RemoteExporter implements InitializingBean in.setSerializerFactory(this.serializerFactory); out.setSerializerFactory(this.serializerFactory); } + if (this.remoteResolver != null) { + in.setRemoteResolver(this.remoteResolver); + } try { skeleton.invoke(in, out); diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/HessianProxyFactoryBean.java b/spring-web/src/main/java/org/springframework/remoting/caucho/HessianProxyFactoryBean.java index 7421d08f01..96325ddbe3 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/HessianProxyFactoryBean.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/HessianProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -26,6 +26,7 @@ import org.springframework.beans.factory.FactoryBean; *

Hessian is a slim, binary RPC protocol. * For information on Hessian, see the * Hessian website + * Note: As of Spring 4.0, this proxy factory requires Hessian 4.0 or above. * *

The service URL must be an HTTP URL exposing a Hessian service. * For details, see the {@link HessianClientInterceptor} javadoc. @@ -36,7 +37,6 @@ import org.springframework.beans.factory.FactoryBean; * @see #setServiceUrl * @see HessianClientInterceptor * @see HessianServiceExporter - * @see org.springframework.remoting.caucho.BurlapProxyFactoryBean * @see org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean * @see org.springframework.remoting.rmi.RmiProxyFactoryBean */ diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/HessianServiceExporter.java b/spring-web/src/main/java/org/springframework/remoting/caucho/HessianServiceExporter.java index 4c94d0aa63..a572d080d0 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/HessianServiceExporter.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/HessianServiceExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -35,7 +35,7 @@ import org.springframework.web.util.NestedServletException; *

Hessian is a slim, binary RPC protocol. * For information on Hessian, see the * Hessian website. - * Note: As of Spring 3.0, this exporter requires Hessian 3.2 or above. + * Note: As of Spring 4.0, this exporter requires Hessian 4.0 or above. * *

Hessian services exported with this class can be accessed by * any Hessian client, as there isn't any special handling involved. @@ -44,7 +44,6 @@ import org.springframework.web.util.NestedServletException; * @since 13.05.2003 * @see HessianClientInterceptor * @see HessianProxyFactoryBean - * @see org.springframework.remoting.caucho.BurlapServiceExporter * @see org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter * @see org.springframework.remoting.rmi.RmiServiceExporter */ diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleBurlapServiceExporter.java b/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleBurlapServiceExporter.java index 6e5471d6ad..d921ab4703 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleBurlapServiceExporter.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleBurlapServiceExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -44,7 +44,10 @@ import org.springframework.util.FileCopyUtils; * @see org.springframework.remoting.caucho.BurlapProxyFactoryBean * @see SimpleHessianServiceExporter * @see org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter + * @deprecated as of Spring 4.0, since Burlap hasn't evolved in years + * and is effectively retired (in contrast to its sibling Hessian) */ +@Deprecated public class SimpleBurlapServiceExporter extends BurlapExporter implements HttpHandler { /** diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleHessianServiceExporter.java b/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleHessianServiceExporter.java index a4e483657d..d56b1e0e3f 100644 --- a/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleHessianServiceExporter.java +++ b/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleHessianServiceExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -33,7 +33,7 @@ import org.springframework.util.FileCopyUtils; *

Hessian is a slim, binary RPC protocol. * For information on Hessian, see the * Hessian website. - * Note: As of Spring 3.0, this exporter requires Hessian 3.2 or above. + * Note: As of Spring 4.0, this exporter requires Hessian 4.0 or above. * *

Hessian services exported with this class can be accessed by * any Hessian client, as there isn't any special handling involved. @@ -42,7 +42,6 @@ import org.springframework.util.FileCopyUtils; * @since 2.5.1 * @see org.springframework.remoting.caucho.HessianClientInterceptor * @see org.springframework.remoting.caucho.HessianProxyFactoryBean - * @see SimpleBurlapServiceExporter * @see org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter */ public class SimpleHessianServiceExporter extends HessianExporter implements HttpHandler {