The first part of the script shown below determines the nodename. If the nodeName is not specified correctly, the correct syntax is printed and the script exits.
# read and validate arguments if {{$argc == 1 } && { [lindex $argv $i] == "-nodeName" } { set nodeName [lindex $argv $i]
# these two variables, mbeanName and mbeanType are used to uniquely identify the mbean. # for this sample, the mbean that access relationship services will be used. set mbeanName"RelService" set mbeanType"WBIRelServices"
# locate the mbean and set a reference to in in "relSvcsMBean" variable set relSvcsMBean [$AdminControl queryNames name=$mbeanName,node=$nodeName,type=$mbeanType,*]
The documentation of this specific MBean defines an attribute named allRelationshipNames. Ask the MBean for that attribute using the getAttribute command. The attribute value will be a list that you step through in the next step that invokes the command.
# request the list of relationships from the mbean set relationships [$AdminControl getAttribute $relSvcsMBean allRelationshipNames]
# loop through the list of role names and print name foreach roleName $roles { puts " Role: $roleName" } } } else { # arguments were not correct, print correct syntax puts "Usage: wsadmin -f RelServicesAdmin.jacl -nodeName nodeName" }
Parent topic: Securing applications and their environment
Last updated: Mon Mar 27 18:15:02 2006
(c) Copyright IBM Corporation 2005.
This information center is powered by Eclipse technology (http://www.eclipse.org)