本文整理匯總了Java中org.aspectj.lang.ProceedingJoinPoint.proceed方法的典型用法代碼示例。如果您正苦於以下問題:Java ProceedingJoinPoint.proceed方法的具體用法?Java ProceedingJoinPoint.proceed怎麽用?Java ProceedingJoinPoint.proceed使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.aspectj.lang.ProceedingJoinPoint的用法示例。
在下文中一共展示了ProceedingJoinPoint.proceed方法的20個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。
示例1: aroundAdvise
點讚 5
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
public int aroundAdvise(ProceedingJoinPoint joinPoint) {
long start_time=System.currentTimeMillis();
logger.info("around advise before "+joinPoint.getSignature()
+" B.L.method getting invoked");
Integer o=null;
try {
o=(Integer)joinPoint.proceed();
logger.info("number of rows affected:-"+o);
} catch (Throwable e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
logger.info("around advise after "+joinPoint.getSignature()+
" B.L.method getting invoked");
long end_time=System.currentTimeMillis();
logger.info(joinPoint.getSignature()+" took " +
(end_time-start_time)+" to complete");
return o.intValue();
}
開發者ID:PacktPublishing,項目名稱:Learning-Spring-5.0,代碼行數:23,
示例2: constructorAnnotatedTrace
點讚 3
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around("methodAnnotatedWithTrace() || constructorAnnotatedTrace()")
public Object traceMethod(final ProceedingJoinPoint joinPoint) throws Throwable {
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
Trace trace = methodSignature.getMethod().getAnnotation(Trace.class);
if (trace!=null && !trace.enable()) {
return joinPoint.proceed();
}
String className = methodSignature.getDeclaringType().getSimpleName();
String methodName = methodSignature.getName();
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
Object result = joinPoint.proceed();
stopWatch.stop();
if (Preconditions.isBlank(className)) {
className = "Anonymous class";
}
L.i(className, buildLogMessage(methodName, stopWatch.getElapsedTime()));
return result;
}
開發者ID:fengzhizi715,項目名稱:SAF-AOP,代碼行數:25,
示例3: executeWithoutPostProcessor
點讚 3
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
private Object executeWithoutPostProcessor(
ProceedingJoinPoint call, ArgumentDiscover argumentDiscover) throws Throwable {
final Object[] args = call.getArgs();
final Message message = argumentDiscover.message;
final String exchange = argumentDiscover.exchangeOfSender;
final String routingKey = argumentDiscover.routingKey;
before(message, exchange, routingKey);
try {
Object result = call.proceed(args);
spanManager.afterSend(null);
return result;
} catch (Exception e) {
spanManager.afterSend(e);
throw e;
}
}
開發者ID:netshoes,項目名稱:spring-cloud-sleuth-amqp,代碼行數:17,
示例4: returnValueHandle
點讚 3
import org.aspectj.lang.ProceedingJoinPoint; //導入方法依賴的package包/類
@Around( "execution(org.springframework.http.ResponseEntity com.aidijing.*.controller.*Controller.*(..)) )" )
public Object returnValueHandle ( ProceedingJoinPoint joinPoint ) throws Throwable {
Object returnValue = joinPoint.proceed();
ResponseEntity responseEntity = ( ResponseEntity ) returnValue;
// 用戶權限或者用戶自定義處理
final RolePermissionResource currentRequestRolePermissionResource = ContextUtils.getCurrentRequestRolePermissionResource();
if ( Objects.isNull( currentRequestRolePermissionResource ) ) {
return returnValue;
}
if ( ResponseEntityPro.WILDCARD_ALL.equals( currentRequestRolePermissionResource.getResourceApiUriShowFields() ) ) {
ContextUtils.removeCurrentRequestRolePermissionResource();
return returnValue;
}
final String resourceApiUriShowFields = currentRequestRolePermissionResource.getResource