• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Shut down button?

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Saloon Keeper
Posts: 28766
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 28766
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
JavaMonitor Support
Posts: 251
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Consider the use of the javax.servlet.UnavailableException

Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic