|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ov4j.retry.RetryHandler
public class RetryHandler
This is the main handler of all retried calls.
Constructor Summary | |
---|---|
RetryHandler(IContainer<ClassComparable,RetryableCallId> cont,
IContainer<ClassComparable,java.lang.Long> argCont)
Constructor. |
Method Summary | |
---|---|
java.lang.Long |
cacheArgs(java.lang.Object... args)
Cache arguments of the call. |
protected void |
callDone(RetryableCall call)
The call is done, remove it from cache. |
void |
clear()
Clear all retry data. |
void |
close()
Close the handler. |
protected IRetryable |
findInstance(java.lang.String className)
Find an instance of the given class. |
java.lang.Object[] |
getArgs(java.lang.Long id)
Retrieve the arguments from cache. |
int |
getMaximumRetries()
|
long |
getRetryInterval()
|
int |
getVersionRollover()
|
void |
register(java.lang.Class<?> cls,
IRetryable instance)
Registers the instance to receive retry callbacks. |
boolean |
retry(java.lang.reflect.Method theMethod,
java.lang.Object instance,
java.lang.Object... args)
Retry a call. |
void |
setMaximumRetries(int maximumRetries)
|
void |
setRetryInterval(long retryInterval)
|
void |
setVersionRollover(int versionRollover)
|
void |
unregister(java.lang.Class<?> cls)
Unregisters the instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RetryHandler(IContainer<ClassComparable,RetryableCallId> cont, IContainer<ClassComparable,java.lang.Long> argCont) throws java.io.IOException
cont
- The container in which to store data.argCont
- The container in which to store arguments
java.io.IOException
Method Detail |
---|
public java.lang.Long cacheArgs(java.lang.Object... args)
args
- Arguments to be cached.
protected void callDone(RetryableCall call) throws java.io.IOException
call
- Call which is done.
java.io.IOException
public void clear()
public void close()
protected IRetryable findInstance(java.lang.String className)
className
-
public java.lang.Object[] getArgs(java.lang.Long id) throws java.io.IOException
id
- Unique id to fetch.
java.io.IOException
public int getMaximumRetries()
public long getRetryInterval()
public int getVersionRollover()
public void register(java.lang.Class<?> cls, IRetryable instance)
cls
- Class handled by this instanceinstance
- public boolean retry(java.lang.reflect.Method theMethod, java.lang.Object instance, java.lang.Object... args)
theMethod
- Method to be called.instance
- Object on which to call the method.args
- Arguments to pass to the call.
public void setMaximumRetries(int maximumRetries)
maximumRetries
- The maximumRetries to set.public void setRetryInterval(long retryInterval)
retryInterval
- The retryInterval to set.public void setVersionRollover(int versionRollover)
versionRollover
- The version rollover to set.public void unregister(java.lang.Class<?> cls)
cls
- #register(IRetryable instance)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |