Show Table of Contents
3.2.12. JBoss AOP 的修改
3.2.12.1. 更新使用 JBoss AOP 的应用程序
JBoss EAP 6 里不再包含 JBoss AOP (Aspect Oriented Programming,面向方面编程) 。在以前的版本里,EJB 容器使用了 JBoss AOP。然而,在 JBoss EAP 6 里,EJB 容器使用了新的机制。如果您的应用程序使用 JBoss AOP,您需要象下面这样修改您的代码。
重构应用程序
ejb3-interceptors-aop.xml里以前的标准 EJB3 配置现在已经在服务器配置文件里完成了。对于独立的服务器,就是standalone/configuration/standalone-full.xml文件。如果您在受管域里运行服务器,这个文件将是domain/configuration/domain.xml。- 您应该修改服务器端的 AOP 拦截器来使用标准的 Java EE
拦截器(Interceptor)。关于容器拦截器的更多信息以及如何使用客户端拦截器,请参考客户门户 https://access.redhat.com/site/documentation/JBoss_Enterprise_Application_Platform/ 上的《JBoss EAP 6 开发指南》里的《容器拦截器》章节。
使用 JBoss AOP 库
- 如果您无法重构代码,您可以获取 JBoss AOP 库的拷贝并将其与应用程序捆绑。AOP 库可以在 JBoss EAP 6 里运行,但不能进行部署。您可以使用下列命令行参数启动服务器来进行手动部署:
Djboss.aop.path=PATH_TO_AOP_CONFIG。注意
虽然 JBoss AOP 库可以在 JBoss EAP 6 里运行,但它并非受支持的配置。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.