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 WebSphere
Application Server. This topic provides code excerpts that demonstrate how
to obtain an AppManagementProxy instance in a variety of cases.
Before you begin
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 application programming
interfaces documentation.
About this task
Perform any of the following tasks to access application management
functionality through programming.
Procedure
- 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. If you want to modify configuration documents
in a non-default location, set the location of the configuration directory
through the was.repository.root system property.
- Although you 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 WebSphere Application Server configuration.
Results
After you successfully create the AppManagementProxy class, you have
access to application management functionality.
What to do next
You can perform various management tasks such as installing, uninstalling,
editing, and so on.