Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Start a process as soon as Application Server starts

Reply
Thread Tools

Start a process as soon as Application Server starts

 
 
nkunapa
Guest
Posts: n/a
 
      01-18-2006
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.

 
Reply With Quote
 
 
 
 
Larry
Guest
Posts: n/a
 
      01-18-2006

nkunapa wrote:
> 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

 
Reply With Quote
 
 
 
 
nkunapa
Guest
Posts: n/a
 
      01-18-2006
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pc starts up as soon as Psu powered on. 002200 Hardware 0 04-06-2008 10:06 PM
[ANN] Free Online Ruby Course Starts Soon Satish Talim Ruby 0 12-08-2007 05:08 AM
A process serving application pool 'DefaultAppPool' exceeded time limits during start up. The process id was '216'. jack ASP .Net 0 08-01-2004 09:49 PM
Instant Messenger starts when Outlook Express 6 starts no matter what is checked! Route9w Computer Support 11 07-08-2004 01:13 PM



Advertisments