WebSphere Application Server - Express, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Modifying attributes on running objects with 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.

Why and when to perform this task

Perform the following steps to modify attributes on running objects:

Steps for this task

  1. Obtain the name of the running object, for example:
    • Using Jacl:
      $AdminControl completeObjectName name
    • Using Jython:
      AdminControl.completeObjectName(name)
    where:
    $ is a Jacl operator for substituting a variable name with its value
    AdminControl is an object that enables the manipulation of MBeans that run in a WebSphere Application Server process
    completeObjectName is an AdminControl command
    name is a fragment of the object name that is used to find the matching object name. For example: type=TraceService,node=mynode,*. This value can be any valid combination of domain and key properties, for example, type, name, cell, node, process, and so on.
  2. Set the ts1 variable to the running object, for example:
    • Using Jacl:
      set ts1 [$AdminControl completeObjectName name]
    • Using Jython:
      ts1 = AdminControl.completeObjectName(name)
    where:
    set is a Jacl command
    ts1 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
    name is a fragment of the object name. It is used to find the matching object name. For example: type=TraceService,node=mynode,*. It can be any valid combination of domain and key properties, for example, type, name, cell, node, process, and so on.
  3. Modify the running object, for example:
    • Using Jacl:
      $AdminControl setAttribute $ts1 ringBufferSize 10
    • Using Jython:
      AdminControl.setAttribute(ts1, 'ringBufferSize', 10)
    where:
    $ 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
    setAttribute is an AdminControl command
    ts1 evaluates to the ID of the server specified in step number 3
    ringBufferSize is an attribute of modify objects
    10 is the value of the ringBufferSize attribute
    You can also modify multiple attribute name and value pairs, for example:
    • Using Jacl:
      set ts1 [$AdminControl completeObjectName type=TraceService,process=server1,*]
      $AdminControl setAttributes $ts1 {{ringBufferSize 10} {traceSpecification com.ibm.*=all=disabled}}
    • Using Jython list:
      ts1 = AdminControl.completeObjectName('type=TraceService,process=server1,*')
      AdminControl.setAttributes(ts1, [['ringBufferSize', 10], ['traceSpecification',  'com.ibm.*=all=disabled']])
    • Using Jython string:
      ts1 =AdminControl.completeObjectName('type=TraceService,process=server1,*')
      AdminControl.setAttributes(ts1, '[[ringBufferSize 10] [traceSpecification  com.ibm.*=all=disabled]]')
    The new attribute values are returned to the command line.



Related concepts
AdminControl object for scripted administration

Related tasks
Turning traces on and off in servers processes using scripting
Performing operations on running objects using the wsadmin tool

Related reference
Example: Identifying running objects
Commands for the AdminControl object

Task topic    

Terms of Use | Feedback

Last updated: Jun 8, 2005 12:45:23 PM EDT
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/txml_queryrunobj.html

© Copyright IBM Corporation 2004, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)