AspectJ、Spring AOP 与 JBoss AOP 的异常处理
我正在为外部系统编写一个网络服务。
我的服务包装类有许多调用 Web 服务的所有 Soap 接口的方法。 该调用可能会引发异常,然后该异常会自动触发重新连接到 Web 服务。
为了处理这种情况,我想使用 AOP,这样所有调用 SOAP 接口的方法都应该由 try/catch 块“包装”。在 catch 块中重新连接完成。
我目前没有使用Spring,所以我正在考虑引入JBoss AOP。如果 AspectJ 或 Spring AOP 是更好的选择,我需要一些建议。
谢谢。
I'm writing a webservice to an external system.
My service wrapper class has a number of methods which call all the soap interface of the webservice.
The call can throw an exception which should then automatically trigger a reconnect to the webservice.
To handle that scenario I'd like to use AOP such that all methods which call the SOAP interface should be "wrapped" by an try/catch block. In the catch block the reconnect is done.
I'm not using Spring at the moment, so I'm thinking about introducing JBoss AOP. I need some advice if AspectJ or Spring AOP would be a better alternative.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的需求非常基本,因此 AspectJ、JBoss AOP 或 Spring AOP 都适合您。这表明采用最简单的选择效果最好。
Your requirements are pretty basic, so either AspectJ, JBoss AOP or Spring AOP would work for you. That would suggest that going with the simplest option would work best.