/** * <p> * Create a proxy for an interface of an implementation class * using the same retry policy for each method in the interface. * </p> * @param iface the interface that the retry will implement * @param implementation the instance whose methods should be retried * @param retryPolicy the policy for retrying method call failures * @return the retry proxy */ public static <T> Object create(Class<T> iface, T implementation, RetryPolicy retryPolicy) { return RetryProxy.create(iface, new DefaultFailoverProxyProvider<T>(iface, implementation), retryPolicy); }
/** * Create a proxy for an interface of an implementation class * using the a set of retry policies specified by method name. * If no retry policy is defined for a method then a default of * {@link RetryPolicies#TRY_ONCE_THEN_FAIL} is used. * * @param iface the interface that the retry will implement * @param implementation the instance whose methods should be retried * @param methodNameToPolicyMap a map of method names to retry policies * @return the retry proxy */ public static <T> Object create(Class<T> iface, T implementation, Map<String,RetryPolicy> methodNameToPolicyMap) { return create(iface, new DefaultFailoverProxyProvider<T>(iface, implementation), methodNameToPolicyMap, RetryPolicies.TRY_ONCE_THEN_FAIL); }
/** * <p> * Create a proxy for an interface of an implementation class * using the same retry policy for each method in the interface. * </p> * @param iface the interface that the retry will implement * @param implementation the instance whose methods should be retried * @param retryPolicy the policy for retrying method call failures * @return the retry proxy */ public static <T> Object create(Class<T> iface, T implementation, RetryPolicy retryPolicy) { return RetryProxy.create(iface, new DefaultFailoverProxyProvider<T>(iface, implementation), retryPolicy); }
/** * <p> * Create a proxy for an interface of an implementation class * using the same retry policy for each method in the interface. * </p> * @param iface the interface that the retry will implement * @param implementation the instance whose methods should be retried * @param retryPolicy the policy for retrying method call failures * @return the retry proxy */ public static <T> Object create(Class<T> iface, T implementation, RetryPolicy retryPolicy) { return RetryProxy.create(iface, new DefaultFailoverProxyProvider<T>(iface, implementation), retryPolicy); }
/** * <p> * Create a proxy for an interface of an implementation class * using the same retry policy for each method in the interface. * </p> * @param iface the interface that the retry will implement * @param implementation the instance whose methods should be retried * @param retryPolicy the policy for retrying method call failures * @return the retry proxy */ public static <T> Object create(Class<T> iface, T implementation, RetryPolicy retryPolicy) { return RetryProxy.create(iface, new DefaultFailoverProxyProvider<T>(iface, implementation), retryPolicy); }
/** * <p> * Create a proxy for an interface of an implementation class * using the same retry policy for each method in the interface. * </p> * @param iface the interface that the retry will implement * @param implementation the instance whose methods should be retried * @param retryPolicy the policy for retrying method call failures * @return the retry proxy */ public static <T> Object create(Class<T> iface, T implementation, RetryPolicy retryPolicy) { return RetryProxy.create(iface, new DefaultFailoverProxyProvider<T>(iface, implementation), retryPolicy); }
/** * Create a proxy for an interface of an implementation class * using the a set of retry policies specified by method name. * If no retry policy is defined for a method then a default of * {@link RetryPolicies#TRY_ONCE_THEN_FAIL} is used. * * @param iface the interface that the retry will implement * @param implementation the instance whose methods should be retried * @param methodNameToPolicyMap a map of method names to retry policies * @return the retry proxy */ public static <T> Object create(Class<T> iface, T implementation, Map<String,RetryPolicy> methodNameToPolicyMap) { return create(iface, new DefaultFailoverProxyProvider<T>(iface, implementation), methodNameToPolicyMap, RetryPolicies.TRY_ONCE_THEN_FAIL); }
/** * Create a proxy for an interface of an implementation class * using the a set of retry policies specified by method name. * If no retry policy is defined for a method then a default of * {@link RetryPolicies#TRY_ONCE_THEN_FAIL} is used. * * @param iface the interface that the retry will implement * @param implementation the instance whose methods should be retried * @param methodNameToPolicyMap a map of method names to retry policies * @return the retry proxy */ public static <T> Object create(Class<T> iface, T implementation, Map<String,RetryPolicy> methodNameToPolicyMap) { return create(iface, new DefaultFailoverProxyProvider<T>(iface, implementation), methodNameToPolicyMap, RetryPolicies.TRY_ONCE_THEN_FAIL); }
/** * Create a proxy for an interface of an implementation class * using the a set of retry policies specified by method name. * If no retry policy is defined for a method then a default of * {@link RetryPolicies#TRY_ONCE_THEN_FAIL} is used. * * @param iface the interface that the retry will implement * @param implementation the instance whose methods should be retried * @param methodNameToPolicyMap a map of method names to retry policies * @return the retry proxy */ public static <T> Object create(Class<T> iface, T implementation, Map<String,RetryPolicy> methodNameToPolicyMap) { return create(iface, new DefaultFailoverProxyProvider<T>(iface, implementation), methodNameToPolicyMap, RetryPolicies.TRY_ONCE_THEN_FAIL); }
/** * Create a proxy for an interface of an implementation class * using the a set of retry policies specified by method name. * If no retry policy is defined for a method then a default of * {@link RetryPolicies#TRY_ONCE_THEN_FAIL} is used. * * @param iface the interface that the retry will implement * @param implementation the instance whose methods should be retried * @param methodNameToPolicyMap a map of method names to retry policies * @return the retry proxy */ public static <T> Object create(Class<T> iface, T implementation, Map<String,RetryPolicy> methodNameToPolicyMap) { return create(iface, new DefaultFailoverProxyProvider<T>(iface, implementation), methodNameToPolicyMap, RetryPolicies.TRY_ONCE_THEN_FAIL); }
return (ClientProtocol) RetryProxy.create( ClientProtocol.class, new DefaultFailoverProxyProvider<>(ClientProtocol.class, translatorProxy), methodNameToPolicyMap,
return (ClientProtocol) RetryProxy.create( ClientProtocol.class, new DefaultFailoverProxyProvider<ClientProtocol>( ClientProtocol.class, translatorProxy), methodNameToPolicyMap,
return (ClientProtocol) RetryProxy.create( ClientProtocol.class, new DefaultFailoverProxyProvider<ClientProtocol>( ClientProtocol.class, translatorProxy), methodNameToPolicyMap,