Upgraded to Hessian 4.0.7; deprecated Burlap support

This commit is contained in:
Juergen Hoeller 2013-04-30 15:13:23 +02:00
parent bee3263322
commit 1295c6f340
11 changed files with 78 additions and 18 deletions

View File

@ -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")

View File

@ -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();

View File

@ -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;

View File

@ -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<Object> {
private Object serviceProxy;

View File

@ -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 {
/**

View File

@ -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;
* <p>Hessian is a slim, binary RPC protocol.
* For information on Hessian, see the
* <a href="http://www.caucho.com/hessian">Hessian website</a>
* <b>Note: As of Spring 4.0, this client requires Hessian 4.0 or above.</b>
*
* <p>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());
}

View File

@ -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;
* <p>Hessian is a slim, binary RPC protocol.
* For information on Hessian, see the
* <a href="http://www.caucho.com/hessian">Hessian website</a>.
* <b>Note: As of Spring 3.0, this exporter requires Hessian 3.2 or above.</b>
* <b>Note: As of Spring 4.0, this exporter requires Hessian 4.0 or above.</b>
*
* @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);

View File

@ -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;
* <p>Hessian is a slim, binary RPC protocol.
* For information on Hessian, see the
* <a href="http://www.caucho.com/hessian">Hessian website</a>
* <b>Note: As of Spring 4.0, this proxy factory requires Hessian 4.0 or above.</b>
*
* <p>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
*/

View File

@ -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;
* <p>Hessian is a slim, binary RPC protocol.
* For information on Hessian, see the
* <a href="http://www.caucho.com/hessian">Hessian website</a>.
* <b>Note: As of Spring 3.0, this exporter requires Hessian 3.2 or above.</b>
* <b>Note: As of Spring 4.0, this exporter requires Hessian 4.0 or above.</b>
*
* <p>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
*/

View File

@ -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 {
/**

View File

@ -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;
* <p>Hessian is a slim, binary RPC protocol.
* For information on Hessian, see the
* <a href="http://www.caucho.com/hessian">Hessian website</a>.
* <b>Note: As of Spring 3.0, this exporter requires Hessian 3.2 or above.</b>
* <b>Note: As of Spring 4.0, this exporter requires Hessian 4.0 or above.</b>
*
* <p>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 {