RE: Webapp with Adminstrative Console

2006-12-05 Thread Caldarale, Charles R
 From: chuanjiang lo [mailto:[EMAIL PROTECTED] 
 Subject: Re: Webapp with Adminstrative Console
 
 Is there any articles i can look at to implement the servlet watch for
 changes to the .ini file?

You can set a WatchedResource tag inside the Context element for
your webapp; changing the target of that should trigger a reload of the
app.  Look here for doc:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html#Nested%20Com
ponents

 I don't think i am able to redeploy the app, since the 
 adminstrator console changing the .ini file of the
 application that is currently running on tomcat..

Should be able to do it by sending a delayed refresh of the console page
back to the client, and also forwarding a request to the html-manager
app to do the redeploy.  A bit of a kludge, but it can probably be made
to work.  Shouldn't be needed with WatchedResource.

But better just to process the updated .ini file without redeploying the
app, if possible.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Webapp with Adminstrative Console

2006-12-05 Thread chuanjiang lo

On 12/6/06, Caldarale, Charles R [EMAIL PROTECTED] wrote:


Rather than restarting Tomcat, why don't you have the servlet watch for
changes to the .ini file and reload it as needed?  Seems a bit of
overkill to take the whole server down for just that.  You could also
just redeploy the app when needed, which can be accomplished
programmatically or via the Tomcat manager or html-manager webapps.




Is there any articles i can look at to implement the servlet watch for
changes to the .ini file?

I don't think i am able to redeploy the app, since the adminstrator console
changing the .ini file of the application that is currently running on
tomcat..

appreciate your advice :)


RE: Webapp with Adminstrative Console

2006-12-05 Thread Caldarale, Charles R
 From: chuanjiang lo [mailto:[EMAIL PROTECTED] 
 Subject: Webapp with Adminstrative Console
 
 I realize that if the config file is changed, i would
 need to restart Tomcat as such my servlet would read
 in the changed settings.

Rather than restarting Tomcat, why don't you have the servlet watch for
changes to the .ini file and reload it as needed?  Seems a bit of
overkill to take the whole server down for just that.  You could also
just redeploy the app when needed, which can be accomplished
programmatically or via the Tomcat manager or html-manager webapps.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Webapp with Adminstrative Console

2006-12-05 Thread Mikolaj Rydzewski

chuanjiang lo wrote:

I am having a web application that have some config files(.ini) that
contains some settings so that during runtime the servlet would take the
settings from the config file and perform some action.

Together with the web application, there is an adminstrator console that
allows user to change the settings of the config file . I realize that if
the config file is changed, i would need to restart Tomcat as such my
servlet would read in the changed settings.
I'd redesign the app. Of course you'll need time and source code for 
this ;-)


Since you're using a servlet to read config files, just map it to some 
URL and call it to reload configuration.


You could also use JMX to change configuration at runtime. Spring has 
nice JMX support.



--
Mikolaj Rydzewski  [EMAIL PROTECTED]http://ceti.pl/~miki/
   PGP KeyID: 8b12ab02
There are three kinds of people: men, women and unix.



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Webapp with Adminstrative Console

2006-12-05 Thread chuanjiang lo

On 12/6/06, Mikolaj Rydzewski [EMAIL PROTECTED] wrote:


You could also use JMX to change configuration at runtime. Spring has
nice JMX support.



Looks like the WatchedResource tag is the easiest solution of all but JMX
seems interesting and i can learn something new but is it possible to do
without Spring?


RE: Webapp with Adminstrative Console

2006-12-05 Thread Caldarale, Charles R
 From: chuanjiang lo [mailto:[EMAIL PROTECTED] 
 Subject: Re: Webapp with Adminstrative Console
 
 Looks like the WatchedResource tag is the easiest solution 
 of all but JMX seems interesting and i can learn something
 new but is it possible to do without Spring?

Yes, Tomcat uses JMX internally to manage itself.  Look at the source
code for the admin app, for example.  Looking at the LambdaProbe code
might be another way to learn how it's used with Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]