アプリケーション・サーバーのオブジェクトを管理する操作コマンドを呼び出す場合は、AdminControl オブジェクトを使用します。
多くの AdminControl コマンドには、複数のシグニチャーがあり、 Java Management Extensions (JMX) によって指定されるパラメーターを使用する、 またはパラメーターのストリングを使用することによって、raw モードで呼び出すことができます。 AdminControl オブジェクトは、操作コマンドに加え、トレース、サーバーとの再接続、 およびデータ型の変換のためのユーティリティー・コマンドをいくつかサポートしています。
completeObjectName コマンドを使用して、フラグメントに基づく完全な ObjectName 値のストリング表記を作成します。 このコマンドは、一致する ObjectName 値を検出するためにサーバーと通信することはありません。このコマンドは、フラグメントと一致する MBean がシステムで複数検出された場合、最初の MBean を戻します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
このコマンドは出力を返しません。
例
set serverON [$AdminControl completeObjectName node=mynode,type=Server,*]
serverON = AdminControl.completeObjectName('node=mynode,type=Server,*')
getAttribute コマンドは、指定する名前の属性値を戻す場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
'DeploymentManager'
例
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] $AdminControl getAttribute $objNameString processType
objNameString = AdminControl.completeObjectName('WebSphere:type=Server,*') print AdminControl.getAttribute(objNameString, 'processType')
getAttribute_jmx コマンドは、指定する名前の属性値を戻す場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
'DeploymentManager'
例
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] set objName [java::new javax.management.ObjectName $objNameString] $AdminControl getAttribute_jmx $objName processType
objNameString = AdminControl.completeObjectName('WebSphere:=type=Server,*') import javax.management as mgmt objName = mgmt.ObjectName(objNameString) print AdminControl.getAttribute_jmx(objName, 'processType')
getAttributes コマンドは、指定する名前の属性値を戻す場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
'[ [cellName myCell01] [nodeName myCellManager01] ]'
例
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] $AdminControl getAttributes $objNameString "cellName nodeName"
objNameString = AdminControl.completeObjectname('WebSphere:type=Server,*) print AdminControl.getAttributes(objNameString, '[cellName nodeName]')
objNameString = AdminControl.completeObjectname('WebSphere:type=Server,*) print AdminControl.getAttributes(objNameString, ['cellName', 'nodeName'])
getAttributes_jmx コマンドは、指定する名前の属性値を戻す場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
このコマンドは属性リストを戻します。
例
set objectNameString [$AdminControl completeObjectName WebSphere:type=Server,*] set objName [$AdminControl makeObjectName $objectNameString] set attrs [java::new {String[]} 2 {cellName nodeName}] $AdminControl getAttributes_jmx $objName $attrs
objectNameString = AdminControl.completeObjectName('type=Server,*') objName = AdminControl.makeObjectName(objectNameString) attrs = ['cellName', 'nodeName'] print AdminControl.getAttributes_jmx(objName, attrs)
getCell コマンドは、接続されたセルの名前を戻す場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
なし。オプション・パラメーター
なし。出力例
Mycell
例
$AdminControl getCell
print AdminControl.getCell()
getConfigId コマンドは、ObjectName または ObjectName フラグメントから構成 ID を作成する場合に使用します。 各 MBean に対応する構成オブジェクトはありません。 ObjectName フラグメントに対応する MBean が複数ある場合、 警告が出され、システムが検出した最初の MBean の構成 ID が形成されます。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
このコマンドは、対象の構成 ID を含むストリングを戻します。
例
set threadpoolCID [$AdminControl getConfigId node=mynode,type=ThreadPool,*]
threadpoolCID = AdminControl.getConfigId('node=mynode,type=ThreadPool,*')
getDefaultDomain コマンドは、サーバーからデフォルトのドメイン・ネームを戻す場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
なし。オプション・パラメーター
なし。出力例
WebSphere
例
$AdminControl getDefaultDomain
print AdminControl.getDefaultDomain()
getDomainName コマンドを使用して、サーバーからドメイン・ネームを戻します。
ターゲット・オブジェクト
なし。必須パラメーター
なし。オプション・パラメーター
なし。出力例
WebSphere
例
$AdminControl getDomainName
print AdminControl.getDomainName()
getHost コマンドを使用して、使用しているホストの名前を戻します。
ターゲット・オブジェクト
なし。必須パラメーター
なし。オプション・パラメーター
なし。出力例
myHost
例
$AdminControl getHost
print AdminControl.getHost()
getMBeanCount コマンドは、サーバーに登録済みの MBean の数を戻す場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
なし。オプション・パラメーター
なし。出力例
151
例
$AdminControl getMBeanCount
print AdminControl.getMBeanCount()
getMBeanInfo_jmx コマンドは、ObjectName 値に対応する Java Management Extension の MBeanInfo 構造を戻す場合に使用します。 このコマンド用のストリング・シグニチャーはありません。 これは、getMBeanInfo コマンドから使用可能な情報のほとんどを、Help オブジェクトが表示するためです。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
javax.management.modelmbean.ModelMBeanInfoSupport@10dd5f35
例
set objectNameString [$AdminControl completeObjectName type=Server,*] set objName [$AdminControl makeObjectName $objectNameString] $AdminControl getMBeanInfo_jmx $objName
objectNameString = AdminControl.completeObjectName('type=Server,*') objName = AdminControl.makeObjectName(objectNameString) print AdminControl.getMBeanInfo_jmx(objName)
getNode コマンドを使用して、接続されたノードの名前を戻します。
ターゲット・オブジェクト
なし。必須パラメーター
なし。オプション・パラメーター
なし。出力例
myNode01
例
$AdminControl getNode
print AdminControl.getNode()
getPort コマンドは、スクリプト接続で使用されるポートの名前を戻す場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
なし。オプション・パラメーター
なし。出力例
8877
例
$AdminControl getPort
print AdminControl.getPort()
getPropertiesForDataSource コマンドは非推奨となっていますが、これに置き換わるコマンドはありません。 このコマンドを使用すると、接続モードで稼働中に、構成サービスの可用性が誤って推定されます。
ターゲット・オブジェクト
なし。必須パラメーター
なし。オプション・パラメーター
なし。出力例
WASX7389E: サポートされていないオペレーション。 getPropertiesForDataSource コマンドはサポートされていません。
例
set ds [lindex [$AdminConfig list DataSource] 0] $AdminControl getPropertiesForDataSource $ds
ds = AdminConfig.list('DataSource') # get line separator import java.lang.System as sys lineSeparator = sys.getProperty('line.separator') dsArray = ds.split(lineSeparator) print AdminControl.getPropertiesForDataSource(dsArray[0])
getType コマンドは、スクリプト接続で使用される接続タイプを戻す場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
なし。オプション・パラメーター
なし。出力例
SOAP
例
$AdminControl getType
print AdminControl.getType()
help コマンドは、AdminControl オブジェクトについての一般ヘルプ・テキストを戻す場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
なし。オプション・パラメーター
出力例
WASX7027I: The AdminControl object enables the manipulation of MBeans that run in a WebSphere Application Server process. The number and type of MBeans that are available to the scripting client depend on the server to which the client is connected. If the client is connected to a deployment manager, then all the MBeans running in the Deployment Manager are visible, as are all the MBeans running in the node agents that are connected to this deployment manager, and all the MBeans that run in the application servers on those nodes. The following commands are supported by the AdminControl object; more detailed information about each of these commands is available by using the "help" command of the AdminControl object and supplying the name of the command as an argument. Many of these commands support two different sets of signatures: one that accepts and returns strings, and one low-level set that works with JMX objects like ObjectName and AttributeList. In most situations, the string signatures are likely to be more useful, but JMX-object signature versions are supplied as well. Each of these JMX-object signature commands has "_jmx" appended to the command name, so an "invoke" command, as well as a "invoke_jmx" command are supported. completeObjectName Return a String version of an object name given atemplate name getAttribute_jmx Given ObjectName and name of attribute, returns value ofattribute getAttribute Given String version of ObjectName and name of attribute, returns value of attribute getAttributes_jmx Given ObjectName and array of attribute names, returns AttributeList getAttributes Given String version of ObjectName and attribute names, returns String of name value pairs getCell returns the cell name of the connected server getConfigId Given String version of ObjectName, return a config id for the corresponding configuration object, if any. getDefaultDomain returns "WebSphere" getDomainName returns "WebSphere" getHost returns String representation of connected host getMBeanCount returns number of registered beans getMBeanInfo_jmx Given ObjectName, returns MBeanInfo structure for MBean getNode returns the node name of the connected server getPort returns String representation of port in use getType returns String representation of connection type in use help help Show help information invoke_jmx Given ObjectName, name of command, array of parameters andsignature, invoke command on MBean specified invoke Invoke a command on the specified MBean isRegistered_jmx true if supplied ObjectName is registered isRegistered true if supplied String version of ObjectName is registered makeObjectName Return an ObjectName built with the given string queryNames_jmx Given ObjectName and QueryExp, retrieves set of ObjectNames that match. queryNames Given String version of ObjectName, retrieves String of ObjectNames that match. reconnect reconnects with serversetAttribute_jmx Given ObjectName and Attribute object, set attribute for MBean specified setAttribute Given String version of ObjectName, attribute name andattribute value, set attribute for MBean specified setAttributes_jmx Given ObjectName and AttributeList object, set attributes for the MBean specified startServer Given the name of a server, start that server. stopServer Given the name of a server, stop that server. testConnection Test the connection to a DataSource object trace Set the wsadmin trace specification
WASX7043I: command: getAttribute Arguments: object name, attribute Description: Returns value of "attribute" for the MBean described by "object name."
例
$AdminControl help
$AdminControl help getAttribute
print AdminControl.help()
print AdminControl.help('getAttribute')
invoke コマンドを使用して、パラメーター付き、またはパラメーターなしでオブジェクト・オペレーションを呼び出します。 このコマンドは、ユーザーの指定するパラメーター・リストを使用して、オブジェクト・オペレーションを呼び出します。 シグニチャーは、自動的に生成されます。 パラメーターの型は、MBean が提供する MBeanInfo を調べて指定されます。 呼び出しの結果のストリングを戻します。戻されるストリングは、呼び出す Mbean メソッドによって制御されます。 Mbean メソッドが synchronous の場合、オペレーションが完了するまでは、wsadmin ツールに制御が戻されません。 Mbean メソッドが asynchronous の場合、呼び出されたタスクが完了していなくても、 wsadmin ツールに制御が戻されます。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
出力例
このコマンドは、呼び出しの結果を表示するストリングを戻します。
例
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] $AdminControl invoke $objNameString stop
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] $AdminControl invoke $objNameString appendTraceString com.ibm.*=all=enabled
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] $AdminControl invoke $objNameString appendTraceString com.ibm.*=all=enabled java.lang.String
objNameString = AdminControl.completeObjectName('WebSphere:type=Server,*') print AdminControl.invoke(objNameString, 'stop')
objNameString = AdminControl.completeObjectName('WebSphere:type=Server,*') print AdminControl.invoke(objNameString, 'appendTraceString', 'com.ibm.*=all=enabled')
objNameString = AdminControl.completeObjectName('WebSphere:type=Server,*') print AdminControl.invoke(objNameString, 'appendTraceString', 'com.ibm.*=all=enabled', 'java.lang.String')
invoke_jmx コマンドは、パラメーター・リストをシグニチャーに適合させて、オブジェクト・オペレーションを呼び出す場合に使用します。 このコマンドは、呼び出しの結果を表示します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
出力例
このコマンドは、呼び出しの結果を表示するストリングを戻します。
例
set objNameString [$AdminControl completeObjectName WebSphere:type=TraceService,*] set objName [java::new javax.management.ObjectName $objNameString] set parms [java::new {java.lang.Object[]} 1 com.ibm.ejs.sm.*=all=disabled] set signature [java::new {java.lang.String[]} 1 java.lang.String] $AdminControl invoke_jmx $objName appendTraceString $parms $signature
objNameString = AdminControl.completeObjectName('WebSphere:type=TraceService,*') import javax.management as mgmt objName = mgmt.ObjectName(objNameString) parms = ['com.ibm.ejs.sm.*=all=disabled'] signature = ['java.lang.String'] print AdminControl.invoke_jmx(objName, 'appendTraceString', parms, signature)
isRegistered コマンドは、特定のオブジェクト名が登録済みであるかどうかを確認する場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
true
例
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] $AdminControl isRegistered $objNameString
objNameString = AdminControl.completeObjectName('WebSphere:type=Server,*') print AdminControl.isRegistered(objNameString)
isRegistered_jmx コマンドは、特定のオブジェクト名が登録済みであるかどうかを確認する場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
true
例
set objectNameString [$AdminControl completeObjectName type=Server,*] set objName [$AdminControl makeObjectName $objNameString] $AdminControl isRegistered_jmx $objName
objectNameString = AdminControl.completeObjectName('type=Server,*') objName = AdminControl.makeObjectName(objectNameString) print AdminControl.isRegistered_jmx(objName)
makeObjectName コマンドは、入力ストリングに基づく ObjectName 値を作成する場合に使用します。 このコマンドはサーバーと通信しないため、結果の ObjectName 値が存在しないことがあります。 指定するストリングに余分な二重引用符のセットがあれば除去されます。 このストリングが Java Management Extensions (JMX) ドメインで開始しない場合、 あるいはストリングの後にコロンが続く場合は、「WebSphere Application Server」というストリングが名前の前に付加されます。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
このコマンドは、オブジェクト名ストリングで構成された Objectname オブジェクトを戻します。
例
set objectNameString [$AdminControl completeObjectName type=Server,node=mynode,*] set objName [$AdminControl makeObjectName $objNameString]
objectNameString = AdminControl.completeObjectName('type=Server,node=mynode,*') objName = AdminControl.makeObjectName(objectNameString)
queryNames コマンドは、名前テンプレートに基づいて、各 ObjectName のリストを照会する場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
WebSphere:cell=BaseApplicationServerCell, name=server1,mbeanIdentifier=server1, type=Server,node=mynode,process=server1
例
$AdminControl queryNames WebSphere:type=Server,*
print AdminControl.queryNames('WebSphere:type=Server,*')
queryNames_jmx コマンドは、ユーザーの指定する名前テンプレートや照会の条件に基づいて、各 ObjectName オブジェクトのリストを照会するために使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
[WebSphere:cell=BaseApplicationServerCell,name=server1,mbeanIdentifier= server1,type=Server,node=mynode,process=server1]
例
set objectNameString [$AdminControl completeObjectName type=Server,*] set objName [$AdminControl makeObjectName $objNameString] set null [java::null] $AdminControl queryNames_jmx $objName $null
objectNameString = AdminControl.completeObjectName('type=Server,*') objName = AdminControl.makeObjectName(objectNameString) print AdminControl.queryNames_jmx(objName, None)
reconnect コマンドは、サーバーに再接続してローカル・キャッシュから情報をクリアする場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
なし。オプション・パラメーター
なし。出力例
WASX7074I: Reconnect of SOAP connector to host myhost completed.
例
$AdminControl reconnect
print AdminControl.reconnect()
setAttribute コマンドは、ユーザーの指定する名前の属性値を設定する場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
このコマンドは出力を返しません。
例
set objNameString [$AdminControl completeObjectName WebSphere:type=TraceService,*] $AdminControl setAttribute $objNameString traceSpecification com.ibm.*=all=disabled
objNameString = AdminControl.completeObjectName('WebSphere:type=TraceService,*') print AdminControl.setAttribute(objNameString, 'traceSpecification', 'com.ibm.*=all=disabled')
setAttribute_jmx コマンドは、ユーザーの指定する名前の属性値を設定する場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
このコマンドは出力を返しません。
例
set objectNameString [$AdminControl completeObjectName WebSphere:type=TraceService,*] set objName [$AdminControl makeObjectName $objectNameString] set attr [java::new javax.management.Attribute traceSpecification com.ibm.*=all=disabled] $AdminControl setAttribute_jmx $objName $attr
objectNameString = AdminControl.completeObjectName('WebSphere:type=TraceService,*') import javax.management as mgmt objName = AdminControl.makeObjectName(objectNameString) attr = mgmt.Attribute('traceSpecification', 'com.ibm.*=all=disabled') print AdminControl.setAttribute_jmx(objName, attr)
setAttributes コマンドは、ユーザーの指定するオブジェクト名の属性値を設定する場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
'[traceSpecification com.ibm.ws.*=all=enabled]'
例
set objNameString [$AdminControl completeObjectName WebSphere:type=TracesService,*] $AdminControl setAttributes $objNameString {{traceSpecification com.ibm.ws.*=all=enabled}}
objNameString = AdminControl.completeObjectName('WebSphere:type=TracesService,*') AdminControl.setAttributes(objNameString, '[[traceSpecification "com.ibm.ws.*=all=enabled"]]')
objNameString = AdminControl.completeObjectName('WebSphere:type=TracesService,*') print AdminControl.setAttributes(objNameString, [['traceSpecification', 'com.ibm.ws.*=all=enabled']])
setAttributes_jmx コマンドは、ユーザーの指定するオブジェクト名の属性値を設定する場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
'[traceSpecification com.ibm.ws.*=all=enabled]'
例
set objectNameString [$AdminControl completeObjectName WebSphere:type=TraceService,*] set objName [$AdminControl makeObjectName $objectNameString] set attr [java::new javax.management.Attribute traceSpecification com.ibm.ws.*=all=enabled] set alist [java::new javax.management.AttributeList] $alist add $attr $AdminControl setAttributes_jmx $objName $alist
objectNameString = AdminControl.completeObjectName('WebSphere:type=TraceService,*') import javax.management as mgmt objName = AdminControl.makeObjectName(objectNameString) attr = mgmt.Attribute('traceSpecification', 'com.ibm.ws.*=all=enabled') alist = mgmt.AttributeList() alist.add(attr) print AdminControl.setAttributes_jmx(objName, alist)
testConnection コマンドは、データ・ソース接続をテストする場合に使用します。 このコマンドは、構成リポジトリー内にあるデータ・ソースを処理します。 検査するデータ・ソースが、リポジトリーへの更新を保持する一時ワークスペース内にある場合、このコマンドを実行する前に、構成リポジトリーへの更新を保管する必要があります。 このコマンドは、データ・ソースおよび WAS40DataSource オブジェクト・タイプに対応する構成 ID と一緒に使用してください。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
WASX7217I: Connection to provided datasource was successful.
例
set ds [lindex [$AdminConfig list DataSource] 0] $AdminControl testConnection $ds
# get line separator import java.lang.System as sys lineSeparator = sys.getProperty('line.separator') ds = AdminConfig.list('DataSource').split(lineSeparator)[0] print AdminControl.testConnection(ds)
trace コマンドは、スクリプト・プロセスのトレース仕様を、ユーザーの指定する値に設定する場合に使用します。
ターゲット・オブジェクト
なし。必須パラメーター
オプション・パラメーター
なし。出力例
このコマンドは出力を返しません。
例
$AdminControl trace com.ibm.ws.scripting.*=all=enabled
print AdminControl.trace('com.ibm.ws.scripting.*=all=enabled')