Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Programmatically undeploy an ear

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Is it possible to programmatically undeploy an ear by using EARDeployer or any other means?

We have a strange requirement in our project as follows-

"We have an EAR file, there has an InitServlet which check some external
resources ( like SMS server blah blah ) whether they are available or not
while starting the server.

Now I want an application which won't allow application server to deploy the
whole EAR file if some external entities are missing. Also if the
application is running ( deployed ) and in-between the same external
entities becomes unavailable then it should undeploy the whole EAR file and
whenever any user try to access the application ( at this time when the
application is undeployed ) s/he should get a message that xxx application
is unavailable because of XXX problem."
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That shouldn't be too bad. If you can do something from the JMX-console, you can do it by invoking methods on the underlying mbeans. You just need to lookup the service you wish to use, from the MBeanServer and invoke. If you're not familiar with MBean concepts, there are some JMX tutorials out there that should help.

Have a good one!
--Jeff
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you block requests using servlet-filter?
Regards,
Rafael Forte
 
reply
    Bookmark Topic Watch Topic
  • New Topic