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, administrative objects, and connection factories, and to install resource adapters. You can run each script individually or combine many procedures to create custom automation scripts for your environment.

Each J2C management script procedure is located in the app_server_root/scriptLibraries/resources/J2C directory.

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

createJ2CActivationSpec

This script creates a J2C activation specification in your configuration. The script returns the configuration ID of the new J2C activation specification.

To run the script, specify the resource adapter, activation specification name, message listener type, and the Java Naming and Directory Interface (JNDI) name arguments. You can optionally specify attributes. The arguments and attributes are defined in the following tables:
Table 1. createJ2CActivationSpec script. Run the script to create a J2C activation specification.
Argument Description
resourceAdapterID Specifies the configuration ID of the resource adapter of interest.
activationSpecName Specifies the name to assign to the new activation specification.
messageListenerType Specifies the message listener type.
jndiName Specifies the Java Naming and Directory Interface (JNDI) name.
attributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format [Fix Pack 5 or later]
"attr1=value1, attr2=value2"
Table 2. Optional attributes. Other attributes available for the script.
Attributes Description Example
activationSpec Specifies the activation specification bean that a resource adapter provides.
["activationSpec",[["activationSpecClass", "com.my.class"], 
["requiredConfigProperties",[["name", "myName"],["type", "myType"],
["value", "myvalue"]]]]]
authenticationAlias Specifies the authentication alias of the created J2C activation specification.
["authenticationAlias", "myAlias"]
description Specifies the description for the created J2C activation specification.
["description", "My description"]
destinationJndiName Specifies the destination JNDI name of the created J2C activation.
["destinationJndiName", "myDestinationJndi"]
jndiName Specifies the JNDI name of the created J2C activation.
["jndiName", "myJndiName"]
resourceProperties Specifies additional properties that the activation specification supports.
["resourceProperties",[["description", "My Description"],
["name", "myName"],["required", "false"],["type", "String"],
["value", "myValue"]]]

Syntax

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

Example usage

The following example script contains required attributes only:

AdminJ2C.createJ2CActivationSpec("J2CTest(cells/myCell/nodes/myNode|resources.xml#J2CResourceAdapter_1184091767578)
)", "J2CASTest", "javax.jms.MessageListener2", "jndiAS")
[Fix Pack 5 or later] The following example script includes optional attributes in a string format:
AdminJ2C.createJ2CActivationSpec("J2CTest(cells/AMYLIN4Cell01/nodes/AMYLIN4CellManager03|resources.xml#J2CResourceAdapter_1245171531343)", 
"J2CASTest","javax.jms.MessageListener", "jndi/as1", "description=this is my J2C ActivationSpecification, destinationJndiName=jndi/J2CAS, 
authenticationAlias=J2CASTest")

The following example script includes optional attributes in a list format:

AdminJ2C.createJ2CActivationSpec("myj2c(cells/AMYLIN4Cell01/nodes/AMYLIN4CellManager03|resources.xml#J2CResourceAdapter_1238380711218)", 
"J2CAC1", "javax.jms.MessageListener", "jndi/as", [['description','new j2cActivationSpec'], ['destinationJndiName','ds/jndi'], ['authenticationAlias','test']])

createJ2CAdminObject

This script creates a J2C administrative object in your configuration. The script returns the configuration ID of the new J2C administrative object.

To run the script, specify the resource adapter, activation specification name, Java Naming and Directory Interface (JNDI) name, and the administrative object interface name arguments. You can optionally specify attributes. The arguments and attributes are defined in the following tables:
Table 3. createJ2CAdminObject script. Run the script to create a J2C administrative object.
Argument Description
resourceAdapterID Specifies the configuration ID of the resource adapter of interest.
activationSpecName Specifies the name to assign to the new activation specification.
adminObjectInterface Specifies the name of the administrative object interface.
jndiName Specifies the Java Naming and Directory Interface (JNDI) name.
attributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format [Fix Pack 5 or later]
"attr1=value1, attr2=value2"
Table 4. Optional attributes. Other attributes available for the script.
Attributes Description Example
adminObject Specifies the administrative object bean that the resource adapter provides.
["adminObject",[["adminObjectClass", "com.my.class"],
["adminObjectInterface","com.my.interface"],["configProperties",
[["description","My Description"],["descriptions",
[["lang", "myLanguage"],["value", "myValue"]]],
["name", "myName"],["type", "myType"],["value", "myValue"]]]]]
description Specifies the description for the created J2C administrative object.
["description", "My description"]
jndiName Specifies the name of the Java Naming and Directory Interface (JNDI).
["jndiName", "myJndiName"]
properties Specifies additional properties that the administrative object supports.
["properties",[["description", "My Description"],["name", "myName"],
["required", "false"],["type", "String"],["value", "myValue"]]]

Syntax

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

Example usage

The following example script contains required attributes only:

AdminJ2C.createJ2CAdminObject("J2CTest(cells/myCell/nodes/myNode|resources.xml#J2CResourceAdapter_1184091767578)",
 "J2CAOTest", "fvt.adapter.message.FVTMessageProvider2", "jndiAO")
[Fix Pack 5 or later] The following example script includes optional attributes in a string format:
AdminJ2C.createJ2CAdminObject("J2CTest(cells/AMYLIN4Cell01/nodes/AMYLIN4CellManager03|resources.xml#J2CResourceAdapter_1245171531343)", 
"J2CAOTest", "fvt.adapter.message.FVTMessageProvider", "jndi/ao1", "description=this is my J2C AdminObject")

The following example script includes optional attributes in a list format:

AdminJ2C.createJ2CAdminObject("myj2c(cells/AMYLIN4Cell01/nodes/AMYLIN4CellManager03|resources.xml#J2CResourceAdapter_1238380711218)", 
"J2CAO1", "fvt.adapter.message.FVTMessageProvider", "jndi/ao", [['description','new j2cAdminObject']])

createJ2CConnectionFactory

This script creates a new J2C connection factory in your 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 Java Naming and Directory Interface (JNDI) name arguments. You can optionally specify attributes. The arguments and attributes are defined in the following tables:
Table 5. createJ2CConnectionFactory script. Run the script to create a J2C connection factory.
Argument Description
resourceAdapterID Specifies the configuration ID of the resource adapter of interest.
connFactoryName Specifies the name to assign to the new connection factory.
connFactoryInterface Specifies the connection factory interface.
jndiName Specifies the Java Naming and Directory Interface (JNDI) name.
attributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format [Fix Pack 5 or later]
"attr1=value1, attr2=value2"
.
Table 6. Optional attributes. Other attributes available for the script.
Attributes Description Example
authDataAlias Specifies the component-managed authentication data alias of the created connection factory.
["authDataAlias", "myAuthDataAlias"]
authMechanismPreference Specifies the authentication mechanism. Use one of the following values: BASIC_PASSWORD or KERBEROS.
["authMechanismPreference", "KERBEROS"]
category Specifies a category that classifies or groups the resource.
["category", "myCategory"]
connectionPool Specifies the connection pool settings.
["connectionPool",[["agedTimeout","100"],
["connectionTimeout","1000"],
["freePoolDistributionTableSize",10],
["maxConnections","12"],["minConnections","5"],
["numberOfFreePoolPartitions","3"],
["numberOfSharedPoolPartitions","6"],
["numberOfUnsharedPoolPartitions","3"],["properties",
[["description","My description"],["name","myName"],
["required","false"],["type","String"],
["validationExpression",""],
["value","myValue"]]],["purgePolicy","EntirePool"],
["reapTime","10000"],["struckThreshold","3"],
["struckTime","10"],["struckTimerTime","10"],
["surgeCreationInterval","10"],["surgeThreshold","10"],
["testConnection","true"],["testConnectionInterval","10"],
["unusedTimeout","10000"]]]
customProperties Specifies either a TypedProperty or DescriptiveProperty type.
["properties",[["description","My description"],
["name","myName"],["required","false"],["type","String"],
["validationExpression",""],["value","myValue"]]]
description Specifies the description of the created J2C connection factory.
["description", "My description"]
logMissingTransactionContext Specifies whether to enable or disable missing transaction context logging.
["logMissingTransactionContext", "true"]
manageCachedHandles Specifies whether the data source is used for container-managed persistence of enterprise beans. The default value is true.
["manageCachedHandles", "true"]
mapping Maps the configuration login to the indicated authentication alias name.
["mapping",[["authDataAlias","authDataAliasValue"],
["mappingConfigAlias","mappingConfigAliasValue"]]]
preTestConfig Specifies pretest connection configuration settings.
["preTestConfig",[["preTestConnection", "true"],
["retryInterval", "12343"],["retryLimit", "4"]]]
properties Specifies either a TypedProperty or DescriptiveProperty type.
['properties',[['description','My description'],
['name','myName'],['required','false'],['type','String'],
['validationExpression',''],['value','myValue']]]
propertySet Specifies resource properties in the following format: [propertySet [[resourceProperties [[[name1 nameValue1][type1 typeValue1][value1 valueValue1]]... [[namen nameValuen][typen typeValuen][valuen valueValuen]] ]]]]
[propertySet [[resourceProperties [
[[name databaseName][type string][value mys]] 
[[name driverType][type integer][value 4]] 
[[name serverName][type string][value localhost]] 
[[name portNumber][type integer][value 50000]] ]]]]
provider Specifies the JMS driver implementation class for access to a vendor database. To create a pool of connections to that database, associate a data source with the JMS provider.
["provider", "myJMSProvider"]
providerType Specifies the JMS provider type that the JMS provider uses.
["providerType", "myJMSProviderType"]
xaRecoveryAuthAlias Specifies the database authentication alias that is used during XA recovery processing. When this property is specified, the default value is the alias for application authentication.
["xaRecoveryAuthAlias", "myCellManager01/a1"]

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")
[Fix Pack 5 or later] The following example script includes optional attributes in a string format:
AdminJ2C.createJ2CConnectionFactory("J2CTest(cells/AMYLIN4Cell01/nodes/AMYLIN4CellManager03|resources.xml#J2CResourceAdapter_1245171531343)", 
"J2CCFTest", "javax.sql.DataSource", "jndi/j2ccftest", "description=this is my J2CConnectionFactory, authDataAlias=J2CTest")

The following example script includes optional attributes in a list format:

AdminJ2C.createJ2CConnectionFactory("myj2c(cells/AMYLIN4Cell01/nodes/AMYLIN4CellManager03|resources.xml#J2CResourceAdapter_1238380711218)", 
"J2CCFTest", "javax.sql.DataSource2", "jndi/cf", [['description', 'new j2ccf'], ['authDataAlias', 'test']]) 

installJ2CResourceAdapter

This script installs a J2C resource adapter in your 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. You can optionally specify attributes. The arguments and attributes are defined in the following tables:
Table 7. installJ2CResourceAdapter script. Run the script to install a J2C resource adapter.
Argument Description
nodeName Specifies the name of the node of interest.
rarFile Specifies the fully qualified file path for the RAR file to install.
resourceAdapterName Specifies the name to assign to the new resource adapter.
attributes
Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format [Fix Pack 5 or later]
"attr1=value1, attr2=value2"
Table 8. Optional attributes. Other attributes available for the script.
Attributes Description
rar.desc Specifies the description of the J2C resource adapter.
rar.archivePath Specifies the name of the path where the file is extracted. If this path is not specified, then the archive is extracted to the $CONNECTOR_INSTALL_ROOT directory.
rar.classpath Specifies the additional classpath.
rar.nativePath Specifies the native path.
rar.threadPoolAlias Specifies the alias of the thread pool.
rar.propertiesSet Specifies the property set of the J2C resource adapter.
rar.DeleteSourceRar Specifies whether to delete the source RAR file.
rar.isolatedClassLoader Specifies the boolean value of the isolated class loader.
rar.enableHASupport Specifies the boolean value of the enabled high availability.
rar.HACapability Specifies the kind of high availability capability.

Syntax

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

Example usage

The following example script contains required attributes only:

[Windows]
AdminJ2C.installJ2CResourceAdapter("myNode", 
 "C:\temp\jca15cmd.rar", "J2CTest")
[Linux] [Solaris] [AIX] [HP-UX]
AdminJ2C.installJ2CResourceAdapter("myNode", "/temp/jca15cmd.rar", "J2CTest")
[Fix Pack 5 or later] The following example script includes optional attributes in a string format: [Windows]
AdminJ2C.installJ2CResourceAdapter("AMYLIN4CellManager03", "c:\ears\jca15cmd.rar", "J2CTest", "rar.desc=this is J2C, 
rar.archivePath=c:\temp\test.rar, rar.classpath=c:\temp, rar.isolatedClassLoader=false, rar.enableHASupport=true, 
rar.DeleteSourceRar=false")
[Linux] [Solaris] [AIX] [HP-UX]
dminJ2C.installJ2CResourceAdapter("AMYLIN4CellManager03", "/ears/jca15cmd.rar", "J2CTest", "rar.desc=this is J2C, 
rar.archivePath=/temp/test.rar, rar.classpath=/temp, rar.isolatedClassLoader=false, rar.enableHASupport=true, 
rar.DeleteSourceRar=false")

The following example script includes optional attributes in a list format:

[Windows]
AdminJ2C.installJ2CResourceAdapter("AMYLIN4Node09", "c:\ears\jca15cmd.rar", "j2ctest", [['rar.desc', 'this is J2C'], 
['rar.archivePath', 'c:\temp\test.rar'], ['rar.classpath', 'c:\temp'], ['rar.nativePath', ''], ['rar.threadPoolAlias', 'test'], 
['rar.isolatedClassLoader', 'false'], ['rar.enableHASupport', 'true'], ['rar.DeleteSourceRar', 'false']])
[Linux] [Solaris] [AIX] [HP-UX]
AdminJ2C.installJ2CResourceAdapter("AMYLIN4Node09", "/ears/jca15cmd.rar", "j2ctest", [['rar.desc', 'this is J2C'], 
['rar.archivePath', '/temp/test.rar'], ['rar.classpath', '/temp'], ['rar.nativePath', ''], ['rar.threadPoolAlias', 'test'], 
['rar.isolatedClassLoader', 'false'], ['rar.enableHASupport', 'true'], ['rar.DeleteSourceRar', 'false']])



Related tasks
Using the script library to automate the application serving environment using wsadmin scripting
Related reference
J2C query scripts
JMS configuration scripts
JMS query scripts
JDBC configuration scripts
JDBC query scripts
Reference topic    

Terms of Use | Feedback

Last updated: Oct 20, 2010 9:57:58 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-base-dist&topic=rxml_7adminj2c2
File name: rxml_7adminj2c2.html