org.apache.jetspeed.util.interceptors
Class MethodReplayInterceptor

java.lang.Object
  extended by org.apache.jetspeed.util.interceptors.MethodReplayInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class MethodReplayInterceptor
extends Object
implements org.aopalliance.intercept.MethodInterceptor

Generic aspect that will attempt to replay a method invocation if one of a set of specified exceptions is thrown from its execution.

Author:
a336317

Field Summary
private  org.apache.commons.logging.Log log
          Log reference
private  TransactionalMethodReplayDecisionMaker replayDecisionMaker
          Object which decides whether or not a method invocation should be replayed
private  int retryCount
          How many times we should attempt to retry the method invocation if it fails
private  int retryInterval
          How long we should wait before retrying - specified in milliseconds *
private static long serialVersionUID
          Serialization version identifier
 
Constructor Summary
MethodReplayInterceptor()
           
 
Method Summary
 int getRetryCount()
           
 int getRetryInterval()
           
 Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
          Encloses super.invoke() in a try/catch block, where the catch block contains additional retry logic.
private  boolean isReplayable(org.aopalliance.intercept.MethodInvocation invocation, Exception exp)
          Determine if we should attempt to replay the method given that the previous invocation returned the passed exception.
 void setReplayDecisionMaker(TransactionalMethodReplayDecisionMaker replayDecisionMaker)
           
 void setRetryCount(int retryCount)
           
 void setRetryInterval(int retryInterval)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private org.apache.commons.logging.Log log
Log reference


serialVersionUID

private static final long serialVersionUID
Serialization version identifier

See Also:
Constant Field Values

retryCount

private int retryCount
How many times we should attempt to retry the method invocation if it fails


retryInterval

private int retryInterval
How long we should wait before retrying - specified in milliseconds *


replayDecisionMaker

private TransactionalMethodReplayDecisionMaker replayDecisionMaker
Object which decides whether or not a method invocation should be replayed

Constructor Detail

MethodReplayInterceptor

public MethodReplayInterceptor()
Method Detail

invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
              throws Throwable
Encloses super.invoke() in a try/catch block, where the catch block contains additional retry logic.

Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
Throwable

getRetryCount

public int getRetryCount()

setRetryCount

public void setRetryCount(int retryCount)

getRetryInterval

public int getRetryInterval()

setRetryInterval

public void setRetryInterval(int retryInterval)

isReplayable

private boolean isReplayable(org.aopalliance.intercept.MethodInvocation invocation,
                             Exception exp)
Determine if we should attempt to replay the method given that the previous invocation returned the passed exception.

Parameters:
exp -
Returns:
True if we should replay the method.

setReplayDecisionMaker

public void setReplayDecisionMaker(TransactionalMethodReplayDecisionMaker replayDecisionMaker)


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.