If you want to manage JBoss through script you should probably use twiddle
tool. More info here: http://community.jboss.org/wiki/Twiddle.
If you want stop WAR application you can make something like that:
- list WAR application and their bean name:
twiddle.sh query 'jboss.web.deployment:*'
jboss.web.deployment:war=/ROOT
jboss.web.deployment:war=/admin-console
twiddle.sh invoke 'jboss.web.deployment:war=/ROOT' stop
twiddle.sh invoke 'jboss.web.deployment:war=/ROOT' start
Unfortunately I cannot find some similar resolution for EJB application. You can find such application using these command:
twiddle.sh query 'jboss.j2ee:*'
And later you can try stop or start some application. Unfortunately it doesn't work for me correctly.
But you can always undeploy and deploy such application. You can make it such way:
twiddle.sh invoke "jboss.system:service=MainDeployer" deploy file:///path/to/ProjectEAR.ear
twiddle.sh invoke "jboss.system:service=MainDeployer" undeploy file:///path/to/ProjectEAR.ear
Deploy
twiddle.sh invoke "jboss.system:service=MainDeployer" deploy file:///path/to/ProjectEAR.ear
But it you have to remeber about such things:
- if you use hot deploy (HDScanner service) you cannot put application in
deploy
directory (it will be automatically deploy after undeploy)
- If your application is not in
deploy
directory then server doesn't install it during start and you have to install it by hand using twiddle
command