Configure new J2C administrative objects using wsadmin.sh
Use scripting and the wsadmin tool to configure new J2C administrative objects.
See the topic on starting the wsadmin tool.
Perform the following steps to configure a J2C administrative object:
Tasks
- 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
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:
- Use the AdminTask object:
- List the administrative object interfaces:
Use Jacl:
$AdminTask listAdminObjectInterfaces $newraUse Jython:
AdminTask.listAdminObjectInterfaces(newra)Example output:
com.ibm.test.message.FVTMessageProvider- Create a J2C administrative object:
Use Jacl:
$AdminTask createJ2CAdminObject $newra { -name ao1 -jndiName eis/ao1 -adminObjectInterface com.ibm.test.message.FVTMessageProvider }Use Jython:
AdminTask.createJ2CAdminObject(newra, ['-name', 'ao1', '-jndiName', 'eis/ao1', '-adminObjectInterface', 'com.ibm.test.message.FVTMessageProvider'])
- Use the AdminConfig object:
- Jacl:
$AdminConfig required J2CAdminObjectUse Jython:
print AdminConfig.required('J2CAdminObject')Example output:
Attribute Type adminObject AdminObject@- If our resource adapter is JCA V1.5 and we have multiple administrative objects defined, it is required specified the administrative object attribute. If our resource adapter is JCA V1.5 and we have only one administrative object defined, it will be picked up automatically. If our resource adapter is JCA V1.0, we do not need to specify the administrative object attribute. Perform the following command to list the administrative objects defined by the resource adapter:
Use Jacl:
$AdminConfig list AdminObject $newraUse Jython:
print AdminConfig.list('AdminObject', $newra)- Set the administrative objects needed to a variable:
Use Jacl:
set ao AdminObjectId set name [list name J2CAO1] set jname [jndiName eis/j2cao1] set j2caoAttrs [list $name $jname]Use Jython:
ao = AdminObjectId name = ['name', 'J2CAO1'] set jname = ['jndiName', eis/j2cao1] j2caoAttrs = [name, jname]- If we are specifying the AdminObject attribute, also set up the following:
Use Jacl:
set cdattr [list adminObject $ao]Use Jython:
cdattr = ['adminObject', ao]- Create a J2C administrative object:
Use Jacl:
$AdminConfig create J2CAdminObject $newra $j2caoAttrsUse Jython:
print AdminConfig.create('J2CAdminObject', newra, j2caoAttrs)
Example output:
J2CAO1(cells/mycell/nodes/mynode|resources.xml#J2CAdminObject_1)- Save the configuration changes.
- Synchronize the node.
Start the wsadmin scripting client wsadmin AdminConfig wsadmin AdminTask Save wsadmin configuration changes Synchronize nodes Commands for the AdminConfig object Commands for the AdminTask object