WAS v8.5 > Script the application serving environment (wsadmin) > Scripting for data access resources > Configure data access with wsadmin scripting

Configure new J2C activation specifications using wsadmin.sh

We can configure new Java 2 Connector activation specifications using scripting and the wsadmin scripting tool.

Before starting this task, wsadmin must be running. See the topic Starting the wsadmin scripting client topic for more information. Configure a J2C activation specifications:

  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:

    • Using AdminTask:

      1. List the administrative object interfaces:

        Jacl:

          $AdminTask listMessageListenerTypes $newra

        Jython:

          AdminTask.listMessageListenerTypes(newra)

        Example output:

          javax.jms.MessageListener

      2. Create a J2C administrative object:

        Jacl:

        $AdminTask createJ2CActivationSpec $newra { -name ac1 
        -jndiName eis/ac1 -messageListenerType 
        javax.jms.MessageListener}

        Jython:

        AdminTask.createJ2CActivationSpec(newra, ['-name', 'ao1', 
        '-jndiName', 'eis/ao1', '-messageListenerType', 
        'javax.jms.MessageListener'])

    • Using the AdminConfig object:

      1. Jacl:

          $AdminConfig required J2CActivationSpec

        Jython:

          print AdminConfig.required('J2CActivationSpec')

        Example output:

        Attribute Type
        activationSpec ActivationSpec@

      2. If wer resource adapter is JCA V1.5 and we have multiple activation specifications defined, it is required specified the activation specification attribute. If wer resource adapter is JCA V1.5 and we have only one activation specification defined, it will be picked up automatically. If wer resource adapter is JCA V1.0, we do not need to specify the activationSpec attribute. Perform the following command to list the activation specifications defined by the resource adapter:

        Jacl:

          $AdminConfig list ActivationSpec $newra

        Jython:

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

      3. Set the administrative object needed to a variable:

        Jacl:

        set ac [$AdminConfig list ActivationSpec $newra]
        set name [list name J2CAC1]
        set jname [list jndiName eis/J2CAC1]
        set j2cacAttrs [list $name $jname $cdcttr]

        Jython:

        ac = AdminConfig.list('ActivationSpec', $newra)
        name = ['name', 'J2CAC1']
        jname = ['jndiName', 'eis/j2cac1']
        j2cacAttrs = [name, jname,cdattr]
      4. If we are specifying the ActivationSpec attribute, also set up the following:

        Jacl:

          set cdcttr [list activationSpec $ac]

        Jython:

          cdattr = ['activationSpec', ac]

      5. Create a J2C activation specification object:

        Jacl:

          $AdminConfig create J2CActivationSpec $newra $j2cacAttrs

        Jython:

          print AdminConfig.create('J2CActivationSpec', newra,j2cacAttrs)

        Example output:

          J2CAC1(cells/mycell/nodes/mynode|resources.xml#J2CActivationSpec_1)

  3. Save the configuration changes. See the topic Saving configuration changes with wsadmin for more information.


Related


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


Reference:

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


+

Search Tips   |   Advanced Search