org.jboss.proxy.ejb
Class RetryInterceptor

java.lang.Object
  extended byorg.jboss.proxy.Interceptor (src) 
      extended byorg.jboss.proxy.ejb.RetryInterceptor
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class RetryInterceptor
extends Interceptor (src)

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 must be set via the setRetryEnv. Typically this is an HA-JNDI configuration with one or more bootstrap urls.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.proxy.Interceptor (src)
nextInterceptor
 
Constructor Summary
RetryInterceptor()
          No-argument constructor for externalization.
 
Method Summary
 boolean getRetry()
           
 java.lang.Object invoke(Invocation (src)  invocation)
          InvocationHandler implementation.
 void readExternal(java.io.ObjectInput in)
          Reads the next interceptor.
 void setRetry(boolean flag)
           
static void setRetryEnv(java.util.Properties env)
          Set the HA-JNDI InitialContext env used to lookup the invoker proxy
 void writeExternal(java.io.ObjectOutput out)
          Writes the next interceptor.
 
Methods inherited from class org.jboss.proxy.Interceptor (src)
getNext, setNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetryInterceptor

public RetryInterceptor()
No-argument constructor for externalization.

Method Detail

setRetryEnv

public static void setRetryEnv(java.util.Properties env)
Set the HA-JNDI InitialContext env used to lookup the invoker proxy

Parameters:
env - the InitialContext env used to lookup the invoker proxy

setRetry

public void setRetry(boolean flag)

getRetry

public boolean getRetry()

invoke

public java.lang.Object invoke(Invocation (src)  invocation)
                        throws java.lang.Throwable
InvocationHandler implementation.

Specified by:
invoke in class Interceptor (src)
Throws:
java.lang.Throwable - Any exception or error thrown while processing.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Writes the next interceptor.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class Interceptor (src)
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Reads the next interceptor.

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class Interceptor (src)
Throws:
java.io.IOException
java.lang.ClassNotFoundException