| |
|
| java.lang.Object org.jboss.proxy.Interceptor org.jboss.proxy.ejb.RetryInterceptor
All known Subclasses: org.jboss.proxy.ejb.SingleRetryInterceptor,
RetryInterceptor | public class RetryInterceptor extends Interceptor (Code) | | An interceptor that will retry failed invocations by restoring the
InvocationContext invoker. This is triggered by a ServiceUnavailableException
which causes the interceptor to fall into a while loop that retries the
lookup of the transport invoker using the jndi name obtained from the
invocation context under the key InvocationKey.JNDI_NAME, with the additional
extension of "-RemoteInvoker" if the invocation type is InvocationType.REMOTE
and "-HomeInvoker" if the invocation type is InvocationType.HOME.
The JNDI environment used for the lookup can be set via the setRetryEnv.
Typically this is an HA-JNDI configuration with one or more bootstrap
urls. If not set, an attempt will be made to use
NamingContextFactory.getInitialContext(Hashtable) to find the
JNDI environment. This will only be useful if java.naming.factory.initial
was set to org.jboss.naming.NamingContextFactory. If neither of the above
steps yield a set of naming environment properties, a default InitialContext
will be used.
author: Scott.Stark@jboss.org author: brian.stansberry@jboss.org version: $Revision: 57209 $ |
Constructor Summary | |
public | RetryInterceptor() No-argument constructor for externalization. | protected | RetryInterceptor(int maxRetries, long sleepTime) Create a new RetryInterceptor that will retry the specified
number of times.
Parameters: maxRetries - the maximum number of retries to attempt. |
RetryInterceptor | public RetryInterceptor()(Code) | | No-argument constructor for externalization.
|
RetryInterceptor | protected RetryInterceptor(int maxRetries, long sleepTime)(Code) | | Create a new RetryInterceptor that will retry the specified
number of times.
Parameters: maxRetries - the maximum number of retries to attempt. -1 (the default) means retry until successful. Parameters: sleepTime - number of ms to pause between each retry attempt |
getMaxRetries | public int getMaxRetries()(Code) | | Gets the maximum number of retries that will be attempted.
|
getRetry | public boolean getRetry()(Code) | | |
getSleepTime | public long getSleepTime()(Code) | | Gets the number of ms of sleep between each retry attempt.
|
setMaxRetries | public void setMaxRetries(int maxRetries)(Code) | | Sets the maximum number of retries that will be attempted.
Parameters: maxRetries - the maximum number of retries to attempt. -1 (the default) means retry until successful. |
setRetry | public void setRetry(boolean flag)(Code) | | |
setRetryEnv | public static void setRetryEnv(Properties env)(Code) | | Set the HA-JNDI InitialContext env used to lookup the invoker proxy
Parameters: env - the InitialContext env used to lookup the invoker proxy |
setSleepTime | public void setSleepTime(long sleepTime)(Code) | | Sets the number of ms of sleep between each retry attempt.
|
|
|
|