org.aspectj.lang.annotation.Around.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中org.aspectj.lang.annotation.Around.<init>()方法的一些代码示例,展示了Around.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Around.<init>()方法的具体详情如下:
包路径:org.aspectj.lang.annotation.Around
类名称:Around
方法名:<init>

Around.<init>介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

@Around("execution(* increment*())")
public Object around(ProceedingJoinPoint pjp) throws Throwable {
  aroundExecutions++;
  return pjp.proceed();
}

代码示例来源:origin: spring-projects/spring-framework

@Around(value="execution(* org.springframework.tests.sample.beans.TestBean.*(..)) and this(bean) and args(argument)",
      argNames="bean,argument")
  public void increment(ProceedingJoinPoint pjp, TestBean bean, Object argument) throws Throwable {
    pjp.proceed();
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Around(value="org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactoryTests.Library.integerArgOperation(x)", argNames="x")
  public void doubleArg(ProceedingJoinPoint pjp, int x) throws Throwable {
    pjp.proceed(new Object[] {x*2});
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Around("execution(int *.getAge())")
public Object doubleReturnValue(ProceedingJoinPoint pjp) throws Throwable {
  ++this.invocations;
  int result = (Integer) pjp.proceed();
  return result * this.multiple;
}

代码示例来源:origin: spring-projects/spring-framework

@Around("execution(* setAge(int))")
  public Object test(ProceedingJoinPoint pjp) throws Throwable {
    return pjp.proceed();
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Around("execution(int *.getAge())")
  public Object doubleReturnValue(ProceedingJoinPoint pjp) throws Throwable {
    ++this.invocations;
    int result = (Integer) pjp.proceed();
    return result * this.multiple;
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Around("@annotation(org.springframework.aop.aspectj.autoproxy.Marker)")
  public Object doubleReturnValue(ProceedingJoinPoint pjp) throws Throwable {
    ++this.invocations;
    int result = (Integer) pjp.proceed();
    return result * this.multiple;
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Around(value="org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactoryTests.Library.integerArgOperation(x)", argNames="x")
  public void doubleArg(ProceedingJoinPoint pjp, int x) throws Throwable {
    pjp.proceed(new Object[] {x*2});
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Around("execution(int *.getAge())")
  public Object doubleReturnValue(ProceedingJoinPoint pjp) throws Throwable {
    int result = (Integer) pjp.proceed();
    return result + 3;
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Around(value="setAge(age)",argNames="age")
  // @ArgNames({"age"})	// AMC needs more work here? ignoring pjp arg... ok??
  // argNames should be supported in Around as it is in Pointcut
  public void changeReturnType(ProceedingJoinPoint pjp, int age) throws Throwable {
    pjp.proceed(new Object[] {age*2});
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Around("execution(* setAge(int)) && args(age)")
public Object test(ProceedingJoinPoint pjp, int age) throws Throwable {
  return pjp.proceed();
}

代码示例来源:origin: prontera/spring-cloud-rest-tcc

@Around(value = "within(com.github.prontera..*) " +
    "&& (@annotation(org.springframework.web.bind.annotation.ResponseBody)" +
    "|| @annotation(org.springframework.web.bind.annotation.RequestMapping))")
public Object aroundMethod(ProceedingJoinPoint joinPoint) throws Throwable {
  for (Object arg : joinPoint.getArgs()) {
    if (arg instanceof BindingResult) {
      throwIfInvalidModel((BindingResult) arg, throwIfInvalidModel);
    }
  }
  return joinPoint.proceed();
}

代码示例来源:origin: prontera/spring-cloud-rest-tcc

@Around("@annotation(com.github.prontera.Delay)")
public Object aroundMethod(ProceedingJoinPoint joinPoint) throws Throwable {
  final Object result = joinPoint.proceed();
  final long timeInMillseconds = delayProperties.getTimeInMillseconds();
  if (timeInMillseconds != 0L) {
    LOGGER.debug("method {} was made delay {} mills to return result", joinPoint.getSignature(), timeInMillseconds);
    TimeUnit.MILLISECONDS.sleep(timeInMillseconds);
  }
  return result;
}

代码示例来源:origin: stylefeng/Guns

@Around("cutService()")
public Object recordSysLog(ProceedingJoinPoint point) throws Throwable {
  //先执行业务
  Object result = point.proceed();
  try {
    handle(point);
  } catch (Exception e) {
    log.error("日志记录出错!", e);
  }
  return result;
}

代码示例来源:origin: spring-projects/spring-framework

@Around("execution(* setAge(*))")
  public Object doLog(ProceedingJoinPoint pjp) throws Throwable {
    LogFactory.getLog(LoggingAspectOnSetter.class).debug(Arrays.asList(pjp.getArgs()));
    return pjp.proceed();
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Around("execution(* doWithVarargs(*))")
  public Object doLog(ProceedingJoinPoint pjp) throws Throwable {
    LogFactory.getLog(LoggingAspectOnVarargs.class).debug(Arrays.asList(pjp.getArgs()));
    return pjp.proceed();
  }
}

代码示例来源:origin: apache/nifi

@Around("within(org.apache.nifi.web.dao.ProcessGroupDAO+) && "
    + "execution(org.apache.nifi.groups.ProcessGroup disconnectVersionControl(String)) && "
    + "args(groupId)")
public ProcessGroup disconnectVersionControlAdvice(final ProceedingJoinPoint proceedingJoinPoint, final String groupId) throws Throwable {
  final ProcessGroup updatedProcessGroup = (ProcessGroup) proceedingJoinPoint.proceed();
  saveUpdateAction(groupId, Operation.StopVersionControl);
  return updatedProcessGroup;
}

代码示例来源:origin: xfumihiro/ViewInspector

@Around("activityOnResumeCall()") public Object showViewInspector(ProceedingJoinPoint joinPoint)
  throws Throwable {
 mViewInspector.onResume();
 return joinPoint.proceed();
}

代码示例来源:origin: xfumihiro/ViewInspector

@Around("activityOnPauseCall()") public Object hideViewInspector(ProceedingJoinPoint joinPoint)
  throws Throwable {
 mViewInspector.onPause();
 return joinPoint.proceed();
}

代码示例来源:origin: xfumihiro/ViewInspector

@Around("activityOnPauseCall()") public Object hideViewInspector(ProceedingJoinPoint joinPoint)
  throws Throwable {
 if (!isRequestingOverlayPermission && !isRestarting) {
  mViewInspector.onPause();
 }
 return joinPoint.proceed();
}

相关文章

微信公众号

最新文章

更多

Around类方法