首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用AspectJ aspect检测Spring HttpRequestHandlingMessagingGateway

使用AspectJ aspect检测Spring HttpRequestHandlingMessagingGateway
EN

Stack Overflow用户
提问于 2015-08-26 23:00:34
回答 1查看 165关注 0票数 1

我们在JBoss 7.1.1上运行spring应用程序-最终我们需要在org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway,中拦截sendAndReceive方法的执行。我们有自己的AspectJ方面,可以很好地与我们自己的bean一起工作,但我们不能用它来编织(加载时) HttpRequestHandlingMessagingGateway类。编织springframework bean有什么限制吗?对如何做有什么建议吗?在我们的aop.xml中我们有

代码语言:javascript
复制
<weaver options="-verbose -showWeaveInfo -debug">
    <include within="org.springframework.integration.http.inbound.*"/>
</weaver>

我们还尝试在pom中添加weaveDependecies块,如下所示

代码语言:javascript
复制
<weaveDependencies>
  <weaveDependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-http</artifactId>
  </weaveDependency>
</weaveDependencies>

但这并没有帮助

EN

回答 1

Stack Overflow用户

发布于 2015-08-30 15:34:24

免责声明:我不是一个Spring用户,而是一个AspectJ专家。

sendAndReceive方法受保护,为true。但在AspectJ中,这不是问题,只要有正确的切入点,只在Spring AOP中。因此,如果您使用AspectJ LTW,这不是根本原因。

根据Javadoc的说法,在这个包中有三个带有sendAndReceive的类,但每个类都继承了org.springframework.integration.gateway.MessagingGatewaySupport类。因此,您可能希望编织该包或类,否则该类中的execution()连接点将被排除在编织之外。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32230131

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档