WAS v8.5 > Administer applications and their environmentManage applications through programming
Through Java MBean programming, we can install, update, and delete a Java Platform, Enterprise Edition (Java EE) application on a WebSphere Application Server deployment target.
This task assumes a basic familiarity with MBean programming. For information on MBean programming, see MBean Java API documentation. In this information center, click Reference > Mbean interfaces.
For information on the restarting of updated applications, refer to Fine-grained recycle behavior in IBM WebSphere Developer Technical Journal: System management for WAS V6 -- Part 5 Flexible options for updating deployed applications.
Before we can install or change an application on a deployment target, first create or update the application and assemble it using an assembly tool. Besides installing, uninstalling, and updating applications through programming, we can additionally install, uninstall, and update Java EE applications through the dmgr console or wsadmin. All three ways provide identical updating capabilities.
- Perform any or all of the following tasks to manage your Java EE applications through programming.
- Access the application management function.
This topic provides examples to access the application management functionality:
- From WAS code
- From outside WAS
- When WAS is not running.
- Install an application.
This topic provides an example for initially installing an application on a deployment target such as a server .
- Uninstall an application.
This topic provides an example for uninstalling an application that resides on a deployment target.
- Manipulate additional attributes for a deployed application.
This topic provides an example for manipulating attributes that are not exposed through the AppDeploymentTask object.
- Share sessions for application management.
This topic provides an example for saving application-specific updates for a deployed application to a session, and then to the configuration repository.
- Update an application.
This topic provides an example for updating the installed application on a server with a new application. When you completely update an application, the deployed application is uninstalled and the new EAR file is installed.
- Add to, update, or delete part of an application.
This topic provides an example used to add, update, or delete part of an application on a server .
- Edit an application.
This topic provides an example used to edit an application on a server .
- Add a module.
This topic provides an example for adding a module to an application that resides on a server .
- Update a module.
This topic provides an example for updating a module that resides on a server . When you update a module, the deployed module is uninstalled and the updated module is installed.
- Delete a module.
This topic provides an example for deleting a module that resides on a server . When you delete a module, the deployed module is uninstalled.
- Add a file.
This topic provides an example for adding a file to an application that resides on a server .
- Update a file.
This topic provides an example for updating a file on a server . When you update a file, the deployed file is uninstalled and the updated file is installed.
- Delete a file.
This topic provides an example for deleting a file on a server . When you delete a file, the deployed file is uninstalled.
- Save your changes to the master configuration repository.
If we have further application updates, we can do the updates through programming, the dmgr console, or wsadmin.
We can use the common deployment framework to add additional logic to application management operations. See Extend application management operations through programming. The tasks the extensions provide are available through all the administrative clients, such as wsadmin, the dmgr console, or through programmatic APIs the AppManagement MBean provides.
Subtopics
- Application management
- 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. This topic provides code excerpts that demonstrate how to obtain an AppManagementProxy instance in a variety of cases.- Install an application through programming
We can install an application through the dmgr console, wsadmin, or programming. Use this example to install an application through programming.- Uninstall an application through programming
We can uninstall an application through the dmgr console, wsadmin, or programming. Use this example to uninstall an application through programming.- Manipulating additional attributes for a deployed application
We can manipulate attributes for a deployed application through the dmgr console, wsadmin, or by programming. Use this example to manipulate attributes that are not exposed during or after application installation through the AppDeploymentTask object.- Share sessions for application management
With the configuration service interface, ConfigService, we can create a session that is a temporary staging area, where we can save all the configuration modifications. Saving the session saves all the updates from the session into the WAS configuration repository. The application management logic supports session sharing with the configuration service. We can perform all the application management functions in the same session as the one the configuration service creates. Saving such a session saves all the updates, including the ones that are application-specific.- Update an application through programming
We can update an existing application through the dmgr console, wsadmin, or programming. Use this example to completely update an application through programming.- Add to, updating, or deleting part of an application through programming
We can add to, update, or delete part of an existing application through the dmgr console, wsadmin, or programming. This example changes part of an application through programming. We can use this example whether you add to, update, or delete part of an existing application. Multiple changes to an application can be packaged in a single compressed .zip file.- Edit applications
We can edit deployed applications through the dmgr console, wsadmin, or by programming. Use this example to edit a deployed application through programming.- Prepare a module and adding it to an existing application through programming
We can add a module to an existing application through the dmgr console, wsadmin, or programming. Use this example to add a module through programming.- Prepare and updating a module through programming
We can update a module for an existing application through the dmgr console, wsadmin, or programming. When you update a module, you replace the existing module with a new version. Use this example to update a module through programming.- Delete a module through programming
We can delete a module from an existing application through the dmgr console, wsadmin, or programming. Use this example to delete a module through programming.- Add a file through programming
We can add a file to an existing application through the dmgr console, wsadmin, or programming. This example describes how to add a file through programming.- Update a file through programming
We can update a file for an existing application through the dmgr console, wsadmin, or programming. This example describes how to update a file through programming.- Delete a file through programming
We can delete a file from an existing application through the dmgr console, wsadmin, or programming. Use this example to delete a file through programming.- Extend application management operations through programming
We can use the common deployment framework to add additional logic to application management operations. The additional logic can do such tasks as code generation, configuration operations, additional validation, and so on. This topic demonstrates, through programming, how to plug into the common deployment framework to extend application management operations.- 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. This topic provides code excerpts that demonstrate how to obtain an AppManagementProxy instance in a variety of cases.- Prepare an application for installation using programming
WAS v8.5 application management architecture provides a set of classes that allows application developers to collect WAS-specific deployment information, hereafter called binding information, and store it in the application EAR file. Such an EAR file can then be installed into a WAS configuration, using application management interfaces that are described in the topic Installing an application through programming. This topic uses a programming example to explain how an EAR file can be populated with binding information.- Install an application through programming
We can install an application through the dmgr console, wsadmin, or programming. Use this example to install an application through programming.- Application management
- Start an application through programming
We can start an application through the dmgr console, wsadmin, or programming. Use this example to start an application through programming.- Share sessions for application management
With the configuration service interface, ConfigService, we can create a session that is a temporary staging area, where we can save all the configuration modifications. Saving the session saves all the updates from the session into the WAS configuration repository. The application management logic supports session sharing with the configuration service. We can perform all the application management functions in the same session as the one the configuration service creates. Saving such a session saves all the updates, including the ones that are application-specific.- Manipulating additional attributes for a deployed application
We can manipulate attributes for a deployed application through the dmgr console, wsadmin, or by programming. Use this example to manipulate attributes that are not exposed during or after application installation through the AppDeploymentTask object.- Edit applications
We can edit deployed applications through the dmgr console, wsadmin, or by programming. Use this example to edit a deployed application through programming.- Update an application through programming
We can update an existing application through the dmgr console, wsadmin, or programming. Use this example to completely update an application through programming.- Add to, updating, or deleting part of an application through programming
We can add to, update, or delete part of an existing application through the dmgr console, wsadmin, or programming. This example changes part of an application through programming. We can use this example whether you add to, update, or delete part of an existing application. Multiple changes to an application can be packaged in a single compressed .zip file.- Prepare a module and adding it to an existing application through programming
We can add a module to an existing application through the dmgr console, wsadmin, or programming. Use this example to add a module through programming.- Prepare and updating a module through programming
We can update a module for an existing application through the dmgr console, wsadmin, or programming. When you update a module, you replace the existing module with a new version. Use this example to update a module through programming.- Add a file through programming
We can add a file to an existing application through the dmgr console, wsadmin, or programming. This example describes how to add a file through programming.- Update a file through programming
We can update a file for an existing application through the dmgr console, wsadmin, or programming. This example describes how to update a file through programming.- Uninstall an application through programming
We can uninstall an application through the administrative console, wsadmin, or programming. Use this example to uninstall an application through programming.- Delete a module through programming
We can delete a module from an existing application through the dmgr console, wsadmin, or programming. Use this example to delete a module through programming.- Delete a file through programming
We can delete a file from an existing application through the dmgr console, wsadmin, or programming. Use this example to delete a file through programming.
Related concepts:
Ways to install enterprise applications or modules
Ways to update enterprise application files
Related
Deploy enterprise applications
Get started with wsadmin scripting
Assemble applications