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.
This script creates a J2C activation specification in your configuration. The script returns the configuration ID of the new 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 |
Attributes | Description | Example |
---|---|---|
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"] |
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")
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']])
This script creates a J2C administrative object in your configuration. The script returns the configuration ID of the new 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:
|
Attributes | Description | Example |
---|---|---|
description | Specifies the description for the created J2C administrative object. | ["description", "My description"] |
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")
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']])
This script creates a new J2C connection factory in your configuration. The script returns the configuration ID of the new 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:
|
Attribute | Description | Example |
---|---|---|
authDataAlias | Specifies the component-managed authentication data alias of the created connection factory. | ["authDataAlias", "myAuthDataAlias"] |
description | Specifies the description of the created J2C connection factory. | ["description", "My description"] |
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/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']])
This script installs a J2C resource adapter in your configuration. The script returns the configuration ID of the new 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:
|
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:
AdminJ2C.installJ2CResourceAdapter("myNode", "/temp/jca15cmd.rar", "J2CTest")
The following example script includes optional attributes in a string format:
AdminJ2C.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:
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']])