[英]Apache CXF and Spring AOP
我已经使用Apache Came和Apache CXF以及“代码优先”方法部署了Web服务。 工作正常。
<cxf:cxfEndpoint id="operacionesWSEndpoint" address="/operaciones"
serviceClass="foo.bar.OperacionesService">
</cxf:cxfEndpoint>
但我想衡量我的服务的性能并进行记录。 为此,我通过以下切入点使用Spring AOP
@Pointcut("execution(* foo.bar.OperacionesService.*(..))")
public void operacionsMethods() {
}
@Around("operacionsMethods()")
public Object logTimeMethod(final ProceedingJoinPoint joinPoint) throws Throwable {
StopWatch stopWatch =
new StopWatch(joinPoint.getTarget().getClass().getSimpleName() + "."
+ joinPoint.getSignature().getName());
stopWatch.start();
Object retVal = joinPoint.proceed();
stopWatch.stop();
log.debug("performance: {}", stopWatch.shortSummary());
return retVal;
}
好吧,不行。 其他方法和服务正在使用相同的方法(AOP)进行记录,但Camel不会公开Web服务。
我认为我的代码没有任何错误:服务在正常工作,在其他方面也一样。 我觉得我在这里缺少有关Apache Camel的东西-CXF和Spring AOP,但我没有发现类似的问题。
有任何想法吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.