Operating Systems: i5/OS
             Personalize the table of contents and search results

 

Configure a shared library for an application using scripting

 

This task uses the AdminConfig object to configure a shared library for an application. Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

 

Overview

You can use the AdminApp object to set certain configurations in the application.

 

Procedure

  1. Identify the shared library and assign it to the library variable. You can either use an existing shared library or create a new one...

  2. Identify the deployment configuration object for the application and assign it to the deployment variable. For example:

    where:

    set is a Jacl command
    deployment is a variable name
    $ is a Jacl operator for substituting a variable name with its value
    AdminConfig is an object representing the WebSphere Application Server configuration
    getid is an AdminConfig command
    Deployment is an attribute
    myApp is the value of the Deployment attribute
    print is a Jython command

    Example output:

    myApp(cells/mycell/applications/myApp.ear/deployments/myApp|deployment.xml#Deployment_1)

  3. Retrieve the application deployment and assign it to the appDeploy variable. For example:

    where:

    set is a Jacl command
    appDeploy is a variable name
    $ is a Jacl operator for substituting a variable name with its value
    AdminConfig is an object representing the WebSphere Application Server configuration
    showAttribute is an AdminConfig command
    deployment evaluates the ID of the deployment configuration object specified in step number 2
    deployedObject is an attribute of modify objects
    print is a Jython command

    Example output:

    (cells/mycell/applications/myApp.ear/deployments/
    myApp|deployment.xml#ApplicationDeployment_1)

  4. Identify the class loader in the application deployment and assign it to the classLoader variable. For example:

    where:

    set is a Jacl command
    classLoad1 is a variable name
    $ is a Jacl operator for substituting a variable name with its value
    AdminConfig is an object representing the WebSphere Application Server configuration
    showAttribute is an AdminConfig command
    appDeploy evaluates the ID of the application deployment specified in step number 3
    classLoader is an attribute of modify objects
    print is a Jython command

    Example output:

    (cells/mycell/applications/myApp.ear/deployments/myApp|deployment.xml#Classloader_1)

  5. Associate the shared library in the application through the class loader. For example:

    where:

    $ is a Jacl operator for substituting a variable name with its value
    AdminConfig is an object representing the WebSphere Application Server configuration
    create is an AdminConfig command
    LibraryRef is an AdminConfig object
    classLoad1 evaluates to the ID of class loader specified in step number 4
    libraryName is an attribute
    MyshareLibrary is the value of the libraryName attribute
    sharedClassloader is an attribute
    true is the value of the sharedClassloader attribute

    Example output:

    (cells/mycell/applications/myApp.ear/deployments/myApp|deployment.xml#LibraryRef_1)

  6. Save the configuration changes. See the Saving configuration changes with the wsadmin tool article for more information.

  7. In a network deployment environment only, synchronize the node. See the Synchronizing nodes with the wsadmin tool article for more information.




}
Using the AdminConfig object for scripted administration
Configuring a shared library using scripting

 

Related Reference


Commands for the AdminConfig object