|
Use this rule to detect classes that implement the WebLogic weblogic.application.ApplicationLifecycleListener
interface. These classes do not run on WebSphere Application Server. A recommended migration alternative is to use the
javax.servlet.ServletContextListener interface.
Depending on the complexity of the ApplicationLifecycleListener implementation, the
ServletContextListener contextInitialized method implementation could be used to wrap the
ApplicationLifecycleListener preStart and ApplicationLifecycleListener postStart methods.
Similarly, the ServletContextListener contextDestroyed method implementation could be used to wrap the
ApplicationLifecycleListener preStop and ApplicationLifecycleListener postStop methods.
After implementing the ServletContextListener, the web.xml for the war module will need to be updated.
Specifically, the implementation of the ServletContextListener interface needs to be added as a listener-class
element. Reference the following example for the proper syntax to update the web.xml.
<web-app id="WebApp_ID">
...
<listener>
<listener-class>com.acme.demo.impl.MyServletContextListenerImpl</listener-class>
</listener>
...
</web-app>
For more information, see the
javax.servlet.ServletContextListener interface Java documentation.
|