Some JBoss applications use the technique of creating MBeans that implement MBeanRegistration to run application startup and shutdown logic. This rule flags classes that implement MBeanRegistration so that you can evaluate if this MBean is used for startup and shutdown logic. The preferred technique to run application startup and shutdown logic is to use a ServletContextListener that runs at application startup and shutdown time.
If your class implements MBeanRegistration and is a true MBean, do not run this quick fix in the source scanner. The quick fix provided for this rule changes the class to implement the ServletContextListener interface, rather than the MBeanRegistration interface. The contextInitialized() method calls the existing MBeanRegistration initialization methods, and the contextDestroyed() method calls the existing MBeanRegistration deregistration methods.
The web.xml file is also modified to define the context listener. If a web.xml file does not exist for this modules application, you are presented with a message to manually create one. After applying this quick fix, the j2ee.jar file from the target WebSphere Application Server installation must be included in the build path for your application for the application to compile successfully.