Accessing 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. This page provides code excerpts that demonstrate how to obtain an AppManagementProxy instance in a variety of cases.
This task assumes a basic familiarity with WAS programming interfaces and MBean programming. Read about WAS 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 WAS code, for example, as a custom service, create the AppManagementProxy class.
AppManagement appMgmt = AppManagementProxy. getJMXProxyForServer();- To access application management functionality from outside WAS through the AppManagement MBean, create an admin client to establish a connection to WAS and then create the AppManagementProxy class.
AdminClient adminClient = .... // create AppManagement proxy object AppManagement appMgmt = AppManagementProxy. getJMXProxyForClient (adminClient);- To access application management functionality when WAS 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 WAS 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.
Next steps
We can perform various management tasks such as installing, uninstalling, editing, and so on.
Application management
Additional Application Programming Interfaces (APIs)
Related tasks
Install an application through programming