use of com.shulie.instrument.simulator.api.scope.InterceptorScopeInvocation in project LinkAgent by shulieTech.
the class ScopedTraceInterceptor method doException.
@Override
public void doException(Advice advice) throws Throwable {
final InterceptorScopeInvocation transaction = getScope(advice).getCurrentInvocation();
boolean success = transaction.canLeave(policy);
try {
if (success) {
interceptor.doException(advice);
} else {
if (logger.isDebugEnabled()) {
logger.debug("doException() returns false: interceptorScopeTransaction: {}, executionPoint: {}. Skip interceptor {}", transaction, policy, interceptor.getClass());
}
}
} finally {
if (success) {
transaction.leave(policy);
}
}
}
use of com.shulie.instrument.simulator.api.scope.InterceptorScopeInvocation in project LinkAgent by shulieTech.
the class ScopedTraceInterceptor method doAfter.
@Override
public void doAfter(Advice advice) throws Throwable {
final InterceptorScopeInvocation transaction = getScope(advice).getCurrentInvocation();
boolean success = transaction.canLeave(policy);
try {
if (success) {
interceptor.doAfter(advice);
} else {
if (logger.isDebugEnabled()) {
logger.debug("tryAfter() returns false: interceptorScopeTransaction: {}, executionPoint: {}. Skip interceptor {}", transaction, policy, interceptor.getClass());
}
}
} finally {
if (success) {
transaction.leave(policy);
}
}
}
Aggregations