You said 'restart' so I assume that the app server is running already.
To stop the app server, you can do one of two things:
a) Use Runtime.exec() to call the shutdown script
b) Call the server MBean to shut down the app server (see how the shutdown script goes about this, and look at the org.jboss.Shutdown class in the source)
To start the app server, use Runtime.exec() to run the run script.
Or you could create a script to do the stop and start and simply call that script using Runtime.exec(). The service.bat and jboss_init_*.sh scripts contain such script code.
This is santhosh your document is very nice but i need script to restart the Jboss, in my project i have one screen that screen shows all the keys and values from struts resource bundle if we change any values in that screen it should affect all the screen but it is not working without restarting the jboss please help me.
in my project i have one screen that screen shows all the keys and values from struts resource bundle if we change any values in that screen it should affect all the screen but it is not working without restarting the jboss please help me.
So you are trying to restart the server through your program whenever someone changes a value on the screen, just so that it gets reflected across the application? That's not the right way to do it. You should first find why the changed value is not being reflected across the application and then try to fix that part.
You are telling correct but we are doing ERP Product so we have to sale to different customer at the time customer like to change the labels in that screen suppose we make this type of screen that would be helpful for ours and customer they can change the labels that is why i am asking please help me.
Provide a separate configuration application what displays the Struts resources. When the customer commits the changes, the app packages the bundle and deploys the real app.