• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Shut down button?

 
Aaron Ting
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all,


I am currently doing on a project based on Spring and using Tomcat as the web server.

Was wondering if any of you guys have suggestion on how i can "lock" up the system by a click of a button, preventing any traffic from entering the server, on this period of time..

I thought that would be achievable using Tomcat and did some research online.. but, couldn't really get any source of information so far..

So, if you have any suggestion, kindly shed some light..

Thanks alot in advance..


Regards,
Aaron
 
Vivek Kr Singh
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are using Spring, you could probably write an Interceptor which checks if the system is ready to serve requests or not. You can also use a normal http filter to achieve the same.
 
Aaron Ting
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vivek Kr Singh wrote:Since you are using Spring, you could probably write an Interceptor which checks if the system is ready to serve requests or not. You can also use a normal http filter to achieve the same.


Greetings Vivek,


Thanks for the prompt reply..

Besides the mentioned two ways, have you got any idea on how to do so using tomcat?
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you looking for application stop/start capabilities? That was a feature of the admin app, but should also be possible using Tomcat's JMX interface.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Tomcat Manager web app can be used to start/stop individual web apps; its URL is usually something like http://localhost:8080/manager/html/list
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:The Tomcat Manager web app can be used to start/stop individual web apps; its URL is usually something like http://localhost:8080/manager/html/list


Providing it's installed, of course. It's no longer provided as part of the core Tomcat download.
 
Aaron Ting
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all for the prompt replies..

The suggestions listed out so far have been really constructive..

However, I was actually looking into adding the functionality(shut down function) on my web application itself..

So, please kindly fill me in if there is any other suggestion in this area..
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Providing it's installed, of course. It's no longer provided as part of the core Tomcat download.

I think it's the Admin web app that's no longer provided; the Manager web app is still there.
 
Kees Jan Koster
JavaMonitor Support
Rancher
Posts: 251
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Aaron,

Here is some code to programmatically stop and start the Tomcat HTTP connectors. Not sure how you would restart it from a servlet after you shut down the HTTP connector, but I'll leave that riddle for you to resolve.

http://java-monitor.com/forum/showthread.php?t=169

Hope this helps.

Kees Jan
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13073
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the use of the javax.servlet.UnavailableException

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic