public class XinsClientInterceptor
extends org.springframework.remoting.support.UrlBasedRemoteAccessor
implements org.aopalliance.intercept.MethodInterceptor
Modifier and Type | Field and Description |
---|---|
protected AbstractCAPI |
capi
The CAPI used to call the web service.
|
Constructor and Description |
---|
XinsClientInterceptor() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected org.springframework.remoting.RemoteAccessException |
convertXinsAccessException(Throwable ex)
Convert the given XINS exception to an appropriate Spring RemoteAccessException.
|
AbstractCAPI |
createCapi()
Creates the CAPI to call the API.
|
Descriptor |
createDescriptor()
Creates the
Descriptor containing the location of the API. |
XINSServiceCaller |
createXinsServiceCaller()
Creates the XINSServiceCaller to call the API.
|
String |
getServiceName()
Gets the name of the API to call.
|
Object |
invoke(org.aopalliance.intercept.MethodInvocation invocation) |
void |
prepare() |
void |
setServiceName(String serviceName)
Sets the name of the API to call.
|
void |
setServiceProperties(Properties descriptorProperties)
Sets the location of the API to call.
|
void |
setTimeout(int timeout)
Sets the time-out for the call of the API.
|
getServiceUrl, setServiceUrl
protected AbstractCAPI capi
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class org.springframework.remoting.support.UrlBasedRemoteAccessor
public void prepare()
public void setServiceProperties(Properties descriptorProperties)
UrlBasedRemoteAccessor.setServiceUrl(java.lang.String)
and setTimeout(int)
methods.descriptorProperties
- the different destination as explained in
DescriptorBuilder.public void setTimeout(int timeout)
UrlBasedRemoteAccessor.setServiceUrl(java.lang.String)
.timeout
- the time-out for the call in milliseconds. This parameter will be used
for the connection time-out, socket time-out and total time-out.public void setServiceName(String serviceName)
serviceName
- the name of the API to call.public String getServiceName()
public Descriptor createDescriptor() throws Exception
Descriptor
containing the location of the API.null
no descriptorProperties or serviceURL is set.Exception
- if the descriptorProperties or serviceURL is incorrect.public AbstractCAPI createCapi() throws Exception
Exception
- if the CAPI class is not found or the descriptor cannot be created.public XINSServiceCaller createXinsServiceCaller() throws Exception
Exception
- if the descriptor cannot be created or is incorrect.public Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws Throwable
invoke
in interface org.aopalliance.intercept.MethodInterceptor
Throwable
protected org.springframework.remoting.RemoteAccessException convertXinsAccessException(Throwable ex)
ex
- the exception to convert.See http://www.xins.org/.