> I have a process which is packaged in a JAR file and what it does is
> collect some statistics on the server and email it as soon as the
> Application Server (Tomcat/WebSphere...etc) starts automatically? Can
> this be achieved?
>
> Thanks.
Yes, you can. First, create a servlet and reference your process in
the servlet's init() method. Then, in your web.xml file, put this line
in your servlet's <servlet> definition block:
<load-on-startup>1</load-on-startup> This will force the app server to
load your servlet when it starts and the servlet's init() method will
run as soon as the servlet is loaded, kicking off your process.
Larry
nkunapa - 18 Jan 2006 21:11 GMT
Thanks Larry for the information. In that case, will it possible for
the same process to get kicked off say every 2 minutes. Also, add a
check that if the previous process was still not finished don't start
the subsequent process. Should all this be implemented in my code using
Timer classes etc or is there any builtin functionality to achieve the
same?
Thanks.