Esempio n. 1
0
  @Override
  public void before(Object target, Object[] args) {
    InterceptorGroupInvocation transaction = group.getCurrentInvocation();

    if (transaction.tryEnter(policy)) {
      if (before != null) {
        before.before(target, args);
      }
    } else {
      if (debugEnabled) {
        logger.debug(
            "tryBefore() returns false: interceptorGroupTransaction: {}, executionPoint: {}. Skip interceptor {}",
            new Object[] {transaction, policy, before == null ? null : before.getClass()});
      }
    }
  }
Esempio n. 2
0
  @Override
  public void after(Object target, Object[] args, Object result, Throwable throwable) {
    InterceptorGroupInvocation transaction = group.getCurrentInvocation();

    if (transaction.canLeave(policy)) {
      if (after != null) {
        after.after(target, args, result, throwable);
      }
      transaction.leave(policy);
    } else {
      if (debugEnabled) {
        logger.debug(
            "tryAfter() returns false: interceptorGroupTransaction: {}, executionPoint: {}. Skip interceptor {}",
            new Object[] {transaction, policy, after == null ? null : after.getClass()});
      }
    }
  }