Configuring new J2C activation specifications using scripting

You can configure new J2C activation specifications using scripting and the wsadmin tool.

Before you begin

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

About this task

Perform the following steps to configure a J2C activation specifications:

Procedure

  1. Identify the parent ID and assign it to the newra variable.
    • Using Jacl:

      set newra [$AdminConfig getid /Cell:mycell/Node:mynode/J2CResourceAdapter:RAR1/]
    • Using 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 the AdminTask object:
      1. List the administrative object interfaces:
        Using Jacl:
        $AdminTask listMessageListenerTypes $newra
        Using Jython:
        AdminTask.listMessageListenerTypes(newra)
        Example output:
        javax.jms.MessageListener
      2. Create a J2C administrative object:
        Using Jacl:
        $AdminTask createJ2CActivationSpec $newra { -name ac1 
        -jndiName eis/ac1 -messageListenerType 
        javax.jms.MessageListener}
        Using Jython:
        AdminTask.createJ2CActivationSpec(newra, ['-name', 'ao1', 
        '-jndiName', 'eis/ao1', '-messageListenerType', 
        'javax.jms.MessageListener'])
    • Using the AdminConfig object:
      1. Using Jacl:
        $AdminConfig required J2CActivationSpec
        Using Jython:
        print AdminConfig.required('J2CActivationSpec')
        Example output:
        Attribute Type
        activationSpec ActivationSpec@
      2. If your resource adapter is JCA V1.5 and you have multiple activation specifications defined, it is required that you specify the activation specification attribute. If your resource adapter is JCA V1.5 and you have only one activation specification defined, it will be picked up automatically. If your resource adapter is JCA V1.0, you do not need to specify the activationSpec attribute. Perform the following command to list the activation specifications defined by the resource adapter:
        Using Jacl:
        $AdminConfig list ActivationSpec $newra
        Using Jython:
        print AdminConfig.list('ActivationSpec', $newra)
      3. Set the administrative object that you need to a variable:
        Using Jacl:
        set ac [$AdminConfig list ActivationSpec $newra]
        set name [list name J2CAC1]
        set jname [list jndiName eis/J2CAC1]
        set j2cacAttrs [list $name $jname $cdcttr]
        
        Using Jython:
        ac = AdminConfig.list('ActivationSpec', $newra)
        name = ['name', 'J2CAC1']
        jname = ['jndiName', 'eis/j2cac1']
        j2cacAttrs = [name, jname,cdattr]
        
      4. If you are specifying the ActivationSpec attribute, also set up the following:
        Using Jacl:
        set cdcttr [list activationSpec $ac]      
        Using Jython:
        cdattr = ['activationSpec', ac]
      5. Create a J2C activation specification object:
        Using Jacl:
        $AdminConfig create J2CActivationSpec $newra $j2cacAttrs 
        Using 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 Saving configuration changes with the wsadmin tool article for more information.
  4. In a network deployment environment only, synchronize the node. See the Synchronizing nodes with the wsadmin tool article for more information.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Sep 20, 2010 10:03:57 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=vela&product=was-nd-zos&topic=txml_j2cspecs
File name: txml_j2cspecs.html