org.springframework.remoting.caucho
Class BurlapClientInterceptor

java.lang.Object
  extended byorg.springframework.remoting.support.RemoteAccessor
      extended byorg.springframework.remoting.support.UrlBasedRemoteAccessor
          extended byorg.springframework.remoting.caucho.BurlapClientInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, InitializingBean, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor
Direct Known Subclasses:
BurlapProxyFactoryBean

public class BurlapClientInterceptor
extends UrlBasedRemoteAccessor
implements org.aopalliance.intercept.MethodInterceptor, InitializingBean

Interceptor for accessing a Burlap service. Supports authentication via username and password. The service URL must be an HTTP URL exposing a Burlap service.

Burlap is a slim, XML-based RPC protocol. For information on Burlap, see the Burlap website

Note: Burlap services accessed with this proxy factory do not have to be exported via BurlapServiceExporter, as there isn't any special handling involved. Therefore, you can also access services that are exported via Caucho's BurlapServlet.

Since:
29.09.2003
Author:
Juergen Hoeller
See Also:
RemoteAccessor.setServiceInterface(java.lang.Class), UrlBasedRemoteAccessor.setServiceUrl(java.lang.String), setUsername(java.lang.String), setPassword(java.lang.String), BurlapServiceExporter, BurlapProxyFactoryBean, BurlapProxyFactory

Field Summary
 
Fields inherited from class org.springframework.remoting.support.RemoteAccessor
logger
 
Constructor Summary
BurlapClientInterceptor()
           
 
Method Summary
 void afterPropertiesSet()
          Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
protected  RemoteAccessException convertBurlapAccessException(java.lang.Throwable ex)
          Convert the given Burlap access exception to an appropriate Spring RemoteAccessException.
protected  java.lang.Object createBurlapProxy(com.caucho.burlap.client.BurlapProxyFactory proxyFactory)
          Create the Burlap proxy that is wrapped by this interceptor.
 java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
           
 void setOverloadEnabled(boolean overloadEnabled)
          Set whether overloaded methods should be enabled for remote invocations.
 void setPassword(java.lang.String password)
          Set the password that this factory should use to access the remote service.
 void setUsername(java.lang.String username)
          Set the username that this factory should use to access the remote service.
 
Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor
getServiceUrl, setServiceUrl
 
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BurlapClientInterceptor

public BurlapClientInterceptor()
Method Detail

setUsername

public void setUsername(java.lang.String username)
Set the username that this factory should use to access the remote service. Default is none.

The username will be sent by Burlap via HTTP Basic Authentication.

See Also:
BurlapProxyFactory.setUser(java.lang.String)

setPassword

public void setPassword(java.lang.String password)
Set the password that this factory should use to access the remote service. Default is none.

The password will be sent by Burlap via HTTP Basic Authentication.

See Also:
BurlapProxyFactory.setPassword(java.lang.String)

setOverloadEnabled

public void setOverloadEnabled(boolean overloadEnabled)
Set whether overloaded methods should be enabled for remote invocations. Default is false.

See Also:
BurlapProxyFactory.setOverloadEnabled(boolean)

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.net.MalformedURLException
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
java.net.MalformedURLException

createBurlapProxy

protected java.lang.Object createBurlapProxy(com.caucho.burlap.client.BurlapProxyFactory proxyFactory)
                                      throws java.net.MalformedURLException
Create the Burlap proxy that is wrapped by this interceptor.

Parameters:
proxyFactory - the proxy factory to use
Returns:
the Burlap proxy
Throws:
java.net.MalformedURLException - if thrown by the proxy factory
See Also:
BurlapProxyFactory.create(java.lang.Class, java.lang.String)

invoke

public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
                        throws java.lang.Throwable
Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
java.lang.Throwable

convertBurlapAccessException

protected RemoteAccessException convertBurlapAccessException(java.lang.Throwable ex)
Convert the given Burlap access exception to an appropriate Spring RemoteAccessException.

Parameters:
ex - the exception to convert
Returns:
the RemoteAccessException to throw


Copyright (C) 2003-2004 The Spring Framework Project.