public class BurlapClientInterceptor extends UrlBasedRemoteAccessor implements MethodInterceptor
MethodInterceptor
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: There is no requirement for services accessed with this proxy factory
to have been exported using Spring's BurlapServiceExporter
, as there is
no special handling involved. As a consequence, you can also access services that
have been exported using Caucho's BurlapServlet
.
RemoteAccessor.setServiceInterface(java.lang.Class)
,
UrlBasedRemoteAccessor.setServiceUrl(java.lang.String)
,
setUsername(java.lang.String)
,
setPassword(java.lang.String)
,
BurlapServiceExporter
,
BurlapProxyFactoryBean
,
BurlapProxyFactory
,
BurlapServlet
logger
Constructor and Description |
---|
BurlapClientInterceptor() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
|
protected RemoteAccessException |
convertBurlapAccessException(Throwable ex)
Convert the given Burlap access exception to an appropriate
Spring RemoteAccessException.
|
protected Object |
createBurlapProxy(com.caucho.burlap.client.BurlapProxyFactory proxyFactory)
Create the Burlap proxy that is wrapped by this interceptor.
|
Object |
invoke(MethodInvocation invocation) |
void |
prepare()
Initialize the Burlap proxy for this interceptor.
|
void |
setOverloadEnabled(boolean overloadEnabled)
Set whether overloaded methods should be enabled for remote invocations.
|
void |
setPassword(String password)
Set the password that this factory should use to access the remote service.
|
void |
setProxyFactory(com.caucho.burlap.client.BurlapProxyFactory proxyFactory)
Set the BurlapProxyFactory instance to use.
|
void |
setUsername(String username)
Set the username that this factory should use to access the remote service.
|
getServiceUrl, setServiceUrl
getServiceInterface, setServiceInterface
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
public void setProxyFactory(com.caucho.burlap.client.BurlapProxyFactory proxyFactory)
Allows to use an externally configured factory instance, in particular a custom BurlapProxyFactory subclass.
public void setUsername(String username)
The username will be sent by Burlap via HTTP Basic Authentication.
BurlapProxyFactory.setUser(java.lang.String)
public void setPassword(String password)
The password will be sent by Burlap via HTTP Basic Authentication.
BurlapProxyFactory.setPassword(java.lang.String)
public void setOverloadEnabled(boolean overloadEnabled)
BurlapProxyFactory.setOverloadEnabled(boolean)
public void afterPropertiesSet()
InitializingBean
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.
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class UrlBasedRemoteAccessor
public void prepare() throws RemoteLookupFailureException
RemoteLookupFailureException
- if the service URL is invalidprotected Object createBurlapProxy(com.caucho.burlap.client.BurlapProxyFactory proxyFactory) throws MalformedURLException
proxyFactory
- the proxy factory to useMalformedURLException
- if thrown by the proxy factoryBurlapProxyFactory.create(java.lang.String)
public Object invoke(MethodInvocation invocation) throws Throwable
invoke
in interface MethodInterceptor
Throwable
protected RemoteAccessException convertBurlapAccessException(Throwable ex)
ex
- the exception to convert