Access the application management function
The com.ibm.websphere.management.application.AppManagementProxy class provides uniform access to application management functionality, regardless of whether the functionality is accessed from the server process, administrative client process, or a stand-alone Java program in the absence of WAS. We can use the code excerpts to learn how to obtain an AppManagementProxy instance in a variety of cases.
This task assumes a basic familiarity with WebSphere Application Server programming interfaces and MBean programming. Read about WebSphere Application Server programming interfaces and MBean programming in the APIs documentation.
Perform any of the following tasks to access application management functionality through programming.
- To access application management functionality from WebSphere Application Server code, for example, as a custom service, create the AppManagementProxy class.
AppManagement appMgmt = AppManagementProxy.getJMXProxyForServer();
- To access application management functionality from outside WebSphere Application Server through the AppManagement MBean, create an administrative client to establish a connection to WebSphere Application Server and then create the AppManagementProxy class.
AdminClient adminClient = .... // create AppManagement proxy object AppManagement appMgmt = AppManagementProxy.getJMXProxyForClient (adminClient);
- To access application management functionality when WebSphere Application Server is not running (local mode), create the AppManagementProxy class.
AppManagement appMgmt = AppManagementProxy.getLocalProxy ();
- When running in local mode set the com.ibm.ws.management.standalone system property to true. To modify configuration documents in a non-default location, set the location of the configuration directory through the was.repository.root system property.
- Although we can use application management functions with or without WebSphere Application Server running, do not access application management functions concurrently through local mode and the AppManagement MBean. Otherwise, updates that are made using these modes can collide and break the integrity of the WAS configuration.
Results
After you successfully create the AppManagementProxy class, we have access to application management functionality.
What to do next
We can perform various management tasks such as installing, uninstalling, editing, and so on.
Related concepts
Application management Additional APIs
Related tasks
Install an application through programming