Configure new J2C administrative objects using scripting
Procedure
- Start wsadmin
- Identify the parent ID and assign it to the newra variable.
Jacl:
set newra [$AdminConfig getid /Cell:mycell/Node:mynode/J2CResourceAdapter:RAR1/] newra = AdminConfig.getid('/Cell:mycell/Node:mynode/J2CResourceAdapter:RAR1/') print newra
Example output:
RAR1(cells/mycell/nodes/mynode|resources.xml#J2CResourceAdapter_1)- There are two ways to configure a new J2C administrative object. Perform one of the following:
- Using the AdminTask object:
- List the administrative object interfaces:
$AdminTask listAdminObjectInterfaces $newraAdminTask.listAdminObjectInterfaces(newra)Example output
com.ibm.test.message.FVTMessageProvider- Create a J2C administrative object:
$AdminTask createJ2CAdminObject $newra { -name ao1 -jndiName eis/ao1 -adminObjectInterface com.ibm.test.message.FVTMessageProvider }AdminTask.createJ2CAdminObject(newra, ['-name', 'ao1', '-jndiName', 'eis/ao1', '-adminObjectInterface', 'com.ibm.test.message.FVTMessageProvider'])
- Using the AdminConfig object:
$AdminConfig required J2CAdminObjectprint AdminConfig.required('J2CAdminObject')Example output
Attribute Type adminObject AdminObject@- If your resource adapter is JCA V1.5 and you have multiple administrative objects defined, it is required that you specify the administrative object attribute. If your resource adapter is JCA V1.5 and you have only one administrative object defined, it will be picked up automatically. If your resource adapter is JCA V1.0, you do not need to specify the administrative object attribute. Perform the following command to list the administrative objects defined by the resource adapter:
$AdminConfig list AdminObject $newraprint AdminConfig.list('AdminObject', $newra)- Set the administrative objects that we need to a variable:
set ao AdminObjectId set name [list name J2CAO1] set jname [jndiName eis/j2cao1] set j2caoAttrs [list $name $jname]ao = AdminObjectId name = ['name', 'J2CAO1'] set jname = ['jndiName', eis/j2cao1] j2caoAttrs = [name, jname]- If you are specifying the AdminObject attribute, also set up the following:
set cdattr [list adminObject $ao]cdattr = ['adminObject', ao]- Create a J2C administrative object:
$AdminConfig create J2CAdminObject $newra $j2caoAttrs $AdminConfig saveprint AdminConfig.create('J2CAdminObject', newra, j2caoAttrs)Example output
J2CAO1(cells/mycell/nodes/mynode|resources.xml#J2CAdminObject_1)
- In a network deployment environment only, synchronize the node.
See Also
AdminConfig object for scripted administration
AdminTask object for scripted administration
See Also
Commands for the AdminConfig object
Commands for the AdminTask object