Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Scripting for data access resources > Configure data access with wsadmin scripting


Configure new J2C administrative objects using wsadmin.sh

We can use scripting and wsadmin.sh to configure new J2C administrative objects.

sh.

Configure a J2C administrative object:


Procedure

  1. 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)
    

  2. There are two ways to configure a new J2C administrative object. Perform one of the following:

    • Use the AdminTask object:

      1. List the administrative object interfaces:

        ### Jacl

        $AdminTask listAdminObjectInterfaces $newra
        

        ### Jython

        AdminTask.listAdminObjectInterfaces(newra)
        

        Example output:

        com.ibm.test.message.FVTMessageProvider
        

      2. Create a J2C administrative 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 J2CAdminObject
        

        ### Jython

        print AdminConfig.required('J2CAdminObject')
        

        Example output:

        Attribute Type
        adminObject AdminObject@
        

      1. If your resource adapter is JCA V1.5 and we have multiple administrative objects defined, it is required that you specify the administrative object attribute. If your resource adapter is JCA V1.5 and we 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:

        ### Jacl

        $AdminConfig list AdminObject $newra
        

        ### Jython

        print AdminConfig.list('AdminObject', $newra)
        

      2. Set the administrative objects that 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]
        
        

      3. If you are specifying the AdminObject attribute, also set up the following:

        ### Jacl

        set cdattr [list adminObject $ao]
        
        

        ### Jython

        cdattr = ['adminObject', ao]
        

      4. Create a J2C administrative object:

        ### Jacl

        $AdminConfig create J2CAdminObject $newra $j2caoAttrs
        

        ### Jython

        print AdminConfig.create('J2CAdminObject', newra, j2caoAttrs)
        

    Example output:

    J2CAO1(cells/mycell/nodes/mynode|resources.xml#J2CAdminObject_1)
    

  3. Save the configuration changes.

  4. Synchronize the node.


Start the wsadmin scripting client using wsadmin.sh
Use the wsadmin scripting AdminConfig object for scripted administration
Use the wsadmin scripting AdminTask object for scripted administration
Saving configuration changes with wsadmin.sh
Synchronize nodes using wsadmin.sh


Related


Commands for the AdminConfig object using wsadmin.sh
Commands using wsadmin.sh

+

Search Tips   |   Advanced Search