Performing operations on running objects using the wsadmin scripting tool

You can use scripting to invoke operations on running objects.

Before you begin

Before starting this task, the wsadmin tool must be running. See the topic on starting the wsadmin scripting client.

About this task

You can run wsadmin commands that obtain the object names of running objects and perform operations:

Procedure

  1. Obtain the object name of the running object. For example:
    • Using Jacl:
      $AdminControl completeObjectName name
    • Using Jython:
      AdminControl.completeObjectName(name)
    Table 1. AdminControl completeObjectName command description. Run the completeObjectName command with an object name.
    $ is a Jacl operator for substituting a variable name with its value
    AdminControl is an object that enables the manipulation of MBeans running in a WebSphere® Application Server process
    completeObjectName is an AdminControl command
    name is a fragment of the object name. It is used to find the matching object name. For example: type=Server,name=serv1,*. It can be any valid combination of domain and key properties. For example, type, name, cell, node, process, etc.
  2. Set the s1 variable to the running object, for example:
    • Using Jacl:
      set s1 [$AdminControl completeObjectName type=Server,name=server1,*]
    • Using Jython:
      s1 = AdminControl.completeObjectName('type=Server,name=server1,*')
    Table 2. AdminControl completeObjectName with type command description. Run the completeObjectName command with an object type and name.
    set is a Jacl command
    s1 is a variable name
    $ is a Jacl operator for substituting a variable name with its value
    AdminControl is an object that enables the manipulation of MBeans running in a WebSphere Application Server process
    completeObjectName is an AdminControl command
    type is the object name property key
    Server is the name of the object
    name is the object name property key
    server1 is the name of the server where the operation is invoked
  3. Invoke the operation. For example:
    • Using Jacl:
      $AdminControl invoke $s1 stop
    • Using Jython:
      AdminControl.invoke(s1, 'stop')
    Table 3. AdminControl invoke command description. Run the invoke command with the server identifier and stop operation.
    $ is a Jacl operator for substituting a variable name with its value
    AdminControl is an object that enables the manipulation of MBeans running in a WebSphere Application Server process
    invoke is an AdminControl command
    s1 is the ID of the server that is specified in step number 3
    stop is an operation to invoke on the server

Example

The following example is for operations that require parameters:




In this information ...


IBM Redbooks, demos, education, and more

(Index)

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

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 20, 2010 7:53:43 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-dist&topic=txml_invokerunobj
File name: txml_invokerunobj.html