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

             Personalize the table of contents and search results

Disabling components using scripting

You can disable components with scripting and the wsadmin tool.

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

Perform the following steps to disable the name server component of a configured server. You can modify this example to disable a different component.

Procedure

  1. Identify the server component and assign it to the nameServer variable.
    • Using Jacl:

      set nameServer [$AdminConfig list NameServer $server]
    • Using Jython:
      nameServer = AdminConfig.list('NameServer', server)
      print nameServer
    Example output:
    (cells/mycell/nodes/mynode/servers/server1|server.xml#NameServer_1)
  2. List the components belonging to the server and assign them to the components variable.
    • Using Jacl:

      set components [$AdminConfig list Component $server]
    • Using Jython:
      components = AdminConfig.list('Component', server)
      print components

    The components variable contains a list of components.

    Example output:
    (cells/mycell/nodes/mynode/servers/server1|server.xml#ApplicationServer_1)
    (cells/mycell/nodes/mynode/servers/server1|server.xml#EJBContainer_1)
    (cells/mycell/nodes/mynode/servers/server1|server.xml#NameServer_1)
    (cells/mycell/nodes/mynode/servers/server1|server.xml#WebContainer_1)
  3. Identify the name server component and assign it to the nameServer variable.

    Since the name server component is the third element in the list, retrieve this element by using index 2.

    • Using Jacl:

      set nameServer [lindex $components 2]
    • Using Jython:
      # get line separator 
      import  java
      lineSeparator = java.lang.System.getProperty('line.separator')
      arrayComponents = components.split(lineSeparator)
      nameServer = arrayComponents[2]
      print nameServer
    Example output:
    (cells/mycell/nodes/mynode/servers/server1|server.xml#NameServer_1)
  4. Disable the name server component by changing the nested initialState attribute belonging to the stateManagement attribute. For example:
    • Using Jacl:

      $AdminConfig modify $nameServer {{stateManagement {{initialState STOP}}}}
    • Using Jython:
      AdminConfig.modify(nameServer, [['stateManagement', [['initialState', 'STOP']]]])
  5. Save the configuration changes. See the Saving configuration changes with the wsadmin tool article for more information.
  6. 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_disablecomponent.html