With the configuration service interface, ConfigService, you can
create a session that is a temporary staging area, where you can save all
the configuration modifications. Saving the session saves all the updates
from the session into the WebSphere Application Server configuration repository.
The application management logic supports session sharing with the configuration
service. You can perform all the application management functions in the same
session as the one that the configuration service creates. Saving such a session
saves all the updates, including the ones that are application-specific.
About this task
Perform the following tasks for your deployed application to share
and save application-specific updates through the configService configuration
service.
Procedure
- Create a configuration service proxy object.
- Create a session.
- Pass the session information to the AppManagement MBean.
Every method on the AppMangement interface takes session ID (workspace
ID) as the last parameter. If the session information is passed in this parameter,
the application management function uses the session. If you set the parameter
to a null value:
- No session sharing occurs
- The configuration changes are always saved in the configuration repository
if the operation succeeds.
- Save the session after all the necessary changes are made.
The following example outlines the general steps for session sharing
through the configService configuration service. For a detailed example, see Manipulating additional attributes for a deployed application
.
public void installApplication (String localEarPath,
String appName, Hashtable properties, String workspaceID)
throws AdminException;
AdminClient adminClient = ....;
// Create a configuration service proxy object.
ConfigService configService = new ConfigServiceProxy(adminClient);
// Create a session.
Session session = new Session();
// Pass the session information to AppManagement MBean.
appMgmt = ...
appMgmt.installApplication
(earPath, appName, properties, session.toString());
//Save the session after all necessary changes are made.
configService.save(session, false);
Results
After you successfully complete the steps, you have saved application-specific
updates for a deployed application to a session, and then to the configuration
repository.