You can use the JMX console to deploy and manage applications in the Spring container. The JMX console enables you to deploy applications, as well as stop, start, remove, and list applications that are running in the container. You can also get information on the application’s state. The name of the deployed WAR file is the name given to the application.
To use the JMX console to manage applications deployed to the Spring container, do the following:
Start the JMX console by running the following command from the
directory:InstallDir
/bin
Platform | Command |
---|---|
Windows | jmx_console_start.bat |
UNIX | jmx_console_start.sh |
Select the MBeans tag and expand the bean node to view the SpringContainer MBean (see Figure 5.2).
The SpringContainer
MBean is deployed as part of the Spring container. It provides access to the management interface for the
Spring Container and can be used to deploy, stop, start, remove and list applications. I can also get information on an application’s state.
The operations and their parameters are described in Table 5.2.
Table 5.2. JMX Console—SpringContainer MBean Operations
Operation | Description | Parameters |
---|---|---|
deploy | Deploys an application to the container repository. The deploy method copies a WAR file from a given URL or file location and puts the copy into
the container repository. |
|
stopApplication | Stops the specified application. It does not remove the application from the container repository. | name — Specifies the name of the application that you want to stop. The application name is the same as the WAR file name. |
startApplication
| Starts an application that has previously been deployed and subsequently stopped. | name — Specifies the name of the application
that you want to start. The application name is the same as the WAR
file name. |
removeApplication
| Stops and removes an application. It completely removes an application from the container repository. | name — Specifies the name of the application
that you want to stop and remove. The application name is the same
as the WAR file name. |
listApplicationNames | Lists all of the applications that have been deployed. The applications can be in one of three states: start, stop, or failed. An application’s name is the same as its WAR file name. | None |
getApplicationState | Reports whether an application is running or not. | name — Specifies the name of the application whose state you want to know. The application name is the same as the WAR file name. |