+

Search Tips   |   Advanced Search

J2C configuration scripts


The scripting library provides many script procedures to manage your Java™ 2 Connector (J2C) configurations. Use the scripts in this topic to create activation specifications, admin objects, and connection factories, and to install resource adapters. We can run each script individually or combine many procedures to create custom automation scripts for the environment.

Each J2C management script procedure is located in...

WAS_HOME/scriptLibraries/resources/J2C

The Jython script library provides script functions for J2C resources, JDBC providers, and JMS resources at the server scope. You can write the own custom scripts to configure resources at the cell, node, or cluster level.

Do not edit the script procedures in the script library. To write custom script library procedures, use the scripts in the WAS_HOME/scriptLibraries directory as Jython syntax samples. Save the custom scripts to a new subdirectory to avoid overwriting the library.

Use the following script procedures to configure J2C in the environment:

 

createJ2CActivationSpec

This script creates a J2C activation spec in the configuration. The script returns the configuration ID of the new J2C activation specification. To run the script, specify the resource adapter, activation spec name, message listener type, and the JNDI name arguments, as defined in the following table:


Table 1. createJ2CActivationSpec script

Argument Description
resourceAdapterID Configuration ID of the resource adapter of interest.
activationSpecName Name to assign to the new activation specification.
messageListenerType Message listener type.
jndiName JNDI name.
attributes Optionally specifies additional parameters in the following format: [["attr1", "value1"], ["attr2", "value2"]].

Syntax

AdminJ2C.createJ2CActivationSpec(resourceAdapterID, 
 activationSpecName, messageListenerType, jndiName, 
 attributes)

Example usage

AdminJ2C.createJ2CActivationSpec("J2CTest(cells/myCell/nodes/myNode|resources.xml#J2CResourceAdapter_1184091767578)
)", "J2CASTest", "javax.jms.MessageListener2", "jndiAS")

AdminJ2C.createJ2CActivationSpec("J2CTest(cells/myCell/nodes/myNode|resources.xml#J2CResourceAdapter_1184091767578)
)", "J2CASTest", "javax.jms.MessageListener2", "jndiAS", [["destinationJndiName", "destjndi"], 
 ["description", "testing"], ["authenticationAlias", "myalias"]])

 

createJ2CAdminObject

This script creates a J2C admin object in the configuration. The script returns the configuration ID of the new J2C admin object. To run the script, specify the resource adapter, activation spec name, JNDI name, and the admin object interface name arguments, as defined in the following table:


Table 2. createJ2CAdminObject script

Argument Description
resourceAdapterID Configuration ID of the resource adapter of interest.
activationSpecName Name to assign to the new activation specification.
adminObjectInterface Name of the admin object interface.
jndiName JNDI name.
attributes Optionally specifies additional parameters in the following format: [["attr1", "value1"], ["attr2", "value2"]].

Syntax

AdminJ2C.createJ2CAdminObject(resourceAdapterID, 
 activationSpecName, adminObjectInterface, jndiName, 
 attributes)

Example usage

AdminJ2C.createJ2CAdminObject("J2CTest(cells/myCell/nodes/myNode|resources.xml#J2CResourceAdapter_1184091767578)",  "J2CAOTest", "fvt.adapter.message.FVTMessageProvider2", "jndiAO", [["description", 
 "testing"]])

 

createJ2CConnectionFactory

This script creates a new J2C connection factory in the configuration. The script returns the configuration ID of the new J2C connection factory. To run the script, To run the script, specify the resource adapter, connection factory name, the connection factory interface, and the JNDI name arguments, as defined in the following table:


Table 3. createJ2CConnectionFactory script

Argument Description
resourceAdapterID Configuration ID of the resource adapter of interest.
connFactoryName Name to assign to the new connection factory.
connFactoryInterface Connection factory interface.
jndiName JNDI name.
attributes Optionally specifies additional parameters in the following format: [["attr1", "value1"], ["attr2", "value2"]].

Syntax

AdminJ2C.createJ2CConnectionFactory(resourceAdapterID, 
 connFactoryName, connFactoryInterface, jndiName, 
 attributes)

Example usage

AdminJ2C.createJ2CConnectionFactory("J2CTest(cells/myCell/nodes/myNode|resources.xml#J2CResourceAdapter_11840917675
578)", "J2CCFTest", "javax.sql.DataSource2", "jndiCF")

AdminJ2C.createJ2CConnectionFactory("J2CTest(cells/myCell/nodes/myNode|resources.xml#J2CResourceAdapter_11840917675
578)", "J2CCFTest", "javax.sql.DataSource2", "jndiCF", [["description", "testing"], ["authDataAlias", 
 "myalias"]]) 

 

installJ2CResourceAdapter

This script installs a J2C resource adapter in the configuration. The script returns the configuration ID of the new J2C resource adapter. To run the script, specify the node name, resource adapter archive (RAR) file, and the resource adapter name arguments, as defined in the following table:


Table 4. installJ2CResourceAdapter script

Argument Description
nodeName Name of the node of interest.
rarFile Fully qualified file path for the RAR file to install.
resourceAdapterName Name to assign to the new resource adapter.
attributes Optionally specifies additional parameters in the following format: [["attr1", "value1"], ["attr2", "value2"]].

Syntax

AdminJ2C.installJ2CResourceAdapter(nodeName, rarFile, 
 resourceAdapterName, attributes)

Example usage

(Windows)

AdminJ2C.installJ2CResourceAdapter("myNode", 
 "C:\temp\jca15cmd.rar", "J2CTest")

(Windows)

AdminJ2C.installJ2CResourceAdapter("myNode", 
 "C:\temp\jca15cmd.rar", "J2CTest", [["rar.desc", "testing"], ["rar.threadPoolAlias", 
 "myalias"]])
[Linux] [Solaris]

[AIX] [HP-UX]

AdminJ2C.installJ2CResourceAdapter("myNode", "/temp/jca15cmd.rar", "J2CTest")
[Linux] [Solaris]

[AIX] [HP-UX]

AdminJ2C.installJ2CResourceAdapter("myNode", "/temp/jca15cmd.rar", "J2CTest", 
 [["rar.desc", "testing"], ["rar.threadPoolAlias", "myalias"]])




 

Related tasks


Use the script library to automate the application serving environment

 

Related


J2C query scripts
JMS configuration scripts
JMS query scripts
JDBC configuration scripts
JDBC query scripts