I have developed a web service using JAX-WS and in the web.xml i had this servlet context listener registered.
<listener>
<listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
</listener>
But, now i have some specific function to be done when the web service is UP and when web service is DOWN. The only way i could think of, was to create a ServletContextlistener and and add it in web.xml.
But this would override the one which was specified (as shown above <listener> tag).
My worry in this case is that WSServletContextListener might be already implementing the ServletContextListener methods and must be doing specific work in it.
I tried to extend WSServletContextListener class but its final so cannot. Another way is that i can take WSServletContextListener as instance member into my listener class and wrap all methods provided by it. But is that good practice?
Make your own listener and declare it in a new
<listener>..</listener>tag. The two listeners should be invoked in the order they are specified in web.xml.