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