WAS v8.5 > Administer applications and their environment > Manage applications 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 WebSphere Application Server 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.

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. Perform the following tasks for the deployed application to share and save application-specific updates through the configService configuration service.

  1. Create a configuration service proxy object.

  2. Create a session.
  3. 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 we 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.

  4. 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, we have saved application-specific updates for a deployed application to a session, and then to the configuration repository.


Related concepts:

Application management


Related


Install an application through programming


+

Search Tips   |   Advanced Search