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 | Optionally specifies additional attributes
in a particular format:
|
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")
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 |
---|---|---|
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")
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:
.
|
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")
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", "C:\temp\jca15cmd.rar", "J2CTest")
AdminJ2C.installJ2CResourceAdapter("myNode", "/temp/jca15cmd.rar", "J2CTest")
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")
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:
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']])
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']])