WebSphere Application Server Version 6.1 Feature Pack for Web Services
             Operating Systems: AIX, HP-UX, i5/OS, Linux, Solaris, Windows

             Personalize the table of contents and search results

Disabling application loading in deployed targets using scripting

You can use the AdminConfig object and scripting to disable application loading in deployed targets.

Before you begin

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

About this task

The following example uses the AdminConfig object to disable application loading in deployed targets:

Procedure

  1. Obtain the Deployment object for the application and assign it to the deployments variable, for example:
    • Using Jacl:
      set deployments [$AdminConfig getid /Deployment:myApp/]
    • Using Jython:
      deployments = AdminConfig.getid("/Deployment:myApp/")
    where:
    set is a Jacl command
    deployments is a variable name
    $ is a Jacl operator for substituting a variable name with its value
    AdminConfig is an object that represents the WebSphere Application Server configuration
    getid is an AdminConfig command
    Deployment is an attribute
    myApp is the value of the attribute
    Example output:
    myApp(cells/mycell/applications/myApp.ear/deployments/myApp|deployment.xml#Deployment_1)
  2. Obtain the target mappings in the application and assign them to the targetMappings variable, for example:
    • Using Jacl:
      set deploymentObj1 [$AdminConfig showAttribute $deployments deployedObject]
      set targetMap1 [lindex [$AdminConfig showAttribute $deploymentObj1 targetMappings] 0]
      Example output:
      (cells/mycell/applications/ivtApp.ear/deployments/ivtApp|deployment.xml#DeploymentTargetMapping_1)
    • Using Jython:
      deploymentObj1 = AdminConfig.showAttribute(deployments, 'deployedObject')
      targetMap1 = AdminConfig.showAttribute(deploymentObj1, 'targetMappings')
      targetMap1 = targetMap1[1:len(targetMap1)-1].split(" ")
      print targetMap1
      
      Example output:
      ['(cells/mycell/applications/ivtApp.ear/deployments/ivtApp|deployment.xml#DeploymentTargetMapping_1)']
    where:
    set is a Jacl command
    deploymentObj1 is a variable name
    $ is a Jacl operator for substituting a variable name with its value
    AdminConfig is an object that represents the WebSphere Application Server configuration
    showAttribute is an AdminConfig command
    deployments evaluates the ID of the Deployment object that is specified in step number 1
    deployedObject is an attribute
    targetMap1 is a variable name
    targetMappings is an attribute
    lindex is a Jacl command
    print is a Jython command
  3. Disable the loading of the application on each deployed target, for example:
    • Using Jacl:
      foreach tm $targetMap1 {
            $AdminConfig modify $tm {{enable false}}
      }
    • Using Jython:
      for targetMapping in targetMap1:
         AdminConfig.modify(targetMapping, [["enable", "false"]])
  4. Save the configuration changes. See the Saving configuration changes with the wsadmin tool article for more information.
  5. In a network deployment environment only, synchronize the node. See the Synchronizing nodes with the wsadmin tool article for more information.



In this information ...


IBM Redbooks, demos, education, and more


Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

IBM Suggests
Task topic    

Terms of Use | Feedback

Last updated: Nov 25, 2008 2:35:59 AM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.wsfep.multiplatform.doc/info/ae/ae/txml_appload.html