public class RetryProxy extends Object
A factory for creating retry proxies.
Constructor and Description |
---|
RetryProxy() |
Modifier and Type | Method and Description |
---|---|
static <T> Object |
create(Class<T> iface,
FailoverProxyProvider<T> proxyProvider,
Map<String,RetryPolicy> methodNameToPolicyMap,
RetryPolicy defaultPolicy)
Create a proxy for an interface of implementations of that interface using
the given
FailoverProxyProvider and the a set of retry policies
specified by method name. |
static <T> Object |
create(Class<T> iface,
FailoverProxyProvider<T> proxyProvider,
RetryPolicy retryPolicy)
Create a proxy for an interface of implementations of that interface using
the given
FailoverProxyProvider and the same retry policy for each
method in the interface. |
static <T> Object |
create(Class<T> iface,
T implementation,
Map<String,RetryPolicy> methodNameToPolicyMap)
Create a proxy for an interface of an implementation class
using the a set of retry policies specified by method name.
|
static <T> Object |
create(Class<T> iface,
T implementation,
RetryPolicy retryPolicy)
Create a proxy for an interface of an implementation class
using the same retry policy for each method in the interface.
|
public static <T> Object create(Class<T> iface, T implementation, RetryPolicy retryPolicy)
Create a proxy for an interface of an implementation class using the same retry policy for each method in the interface.
iface
- the interface that the retry will implementimplementation
- the instance whose methods should be retriedretryPolicy
- the policy for retrying method call failurespublic static <T> Object create(Class<T> iface, FailoverProxyProvider<T> proxyProvider, RetryPolicy retryPolicy)
FailoverProxyProvider
and the same retry policy for each
method in the interface.iface
- the interface that the retry will implementproxyProvider
- provides implementation instances whose methods should be retriedretryPolicy
- the policy for retrying or failing over method call failurespublic static <T> Object create(Class<T> iface, T implementation, Map<String,RetryPolicy> methodNameToPolicyMap)
RetryPolicies.TRY_ONCE_THEN_FAIL
is used.iface
- the interface that the retry will implementimplementation
- the instance whose methods should be retriedmethodNameToPolicyMap
- a map of method names to retry policiespublic static <T> Object create(Class<T> iface, FailoverProxyProvider<T> proxyProvider, Map<String,RetryPolicy> methodNameToPolicyMap, RetryPolicy defaultPolicy)
FailoverProxyProvider
and the a set of retry policies
specified by method name. If no retry policy is defined for a method then a
default of RetryPolicies.TRY_ONCE_THEN_FAIL
is used.iface
- the interface that the retry will implementproxyProvider
- provides implementation instances whose methods should be retriedmethodNameToPolicyMapa
- map of method names to retry policiesCopyright © 2013 Apache Software Foundation. All rights reserved.