de.fzj.unicore.wsrflite.xfire
Class ReliableProxy
java.lang.Object
de.fzj.unicore.wsrflite.xfire.ReliableProxy
- All Implemented Interfaces:
- InvocationHandler
public class ReliableProxy
- extends Object
- implements InvocationHandler
Replacement for XFireProxy
The behaviour in case of errors can be controlled by configuring
this class with an instance of ReliableProxy.RetryDecider, allowing
to decide whether a particular call shall be retried.
By default, no retries will be attempted.
- Author:
- schuller
|
Nested Class Summary |
static interface |
ReliableProxy.RetryDecider
this interface encapsulates the rules that shall be
followed when dealing with failed webservice calls
|
|
Constructor Summary |
ReliableProxy(org.codehaus.xfire.client.Client client)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
retryDecider
protected ReliableProxy.RetryDecider retryDecider
ReliableProxy
public ReliableProxy(org.codehaus.xfire.client.Client client)
getClient
public org.codehaus.xfire.client.Client getClient()
setRetryDecider
public void setRetryDecider(ReliableProxy.RetryDecider handler)
invoke
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
- Handles the object invocation.
- Specified by:
invoke in interface InvocationHandler
- Parameters:
proxy - the proxy object to invokemethod - the method to callargs - the arguments to the proxy object
- Throws:
Throwable
doInvoke
protected Object doInvoke(Object proxy,
Method method,
Object[] args)
throws Throwable
- Handles the object invocation.
- Parameters:
proxy - the proxy object to invokemethod - the method to callargs - the arguments to the proxy object
- Throws:
Throwable
getMaxSubmits
public Integer getMaxSubmits()
setMaxSubmits
public void setMaxSubmits(int maxSubmits)
getFailedSubmits
public int getFailedSubmits()
getDefaultDecider
public static ReliableProxy.RetryDecider getDefaultDecider(ReliableProxy parent)
- creates and returns a default
ReliableProxy.RetryDecider implementation
that will resubmit a fixed number of times, and will throw any
application errors indicated by XFireFault or FaultInfoException
- Parameters:
maxSubmits - - the number of tries a failed call shall be retried
- Returns:
- a
ReliableProxy.RetryDecider instance
Copyright © 2010. All Rights Reserved.