Network Deployment (Distributed operating systems), v8.0 > Reference > Jython script library
J2C configuration scripts
The scripting library provides many script procedures to manage your J2C configurations. Use the scripts in this topic to create activation specifications, administrative 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 the WAS_HOME/scriptLibraries/resources/J2C directory.
Use the following script procedures to configure J2C in the environment:
createJ2CActivationSpec
This script creates a J2C activation specification in the 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 JNDI name arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:
createJ2CActivationSpec script. Run the script to create a J2C activation specification.
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 attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
Optional attributes. Other attributes available for the script.
Attributes Description Example activationSpec Activation specification bean that a resource adapter provides. ["activationSpec",[["activationSpecClass", "com.my.class"], ["requiredConfigProperties",[["name", "myName"],["type", "myType"], ["value", "myvalue"]]]]]authenticationAlias Authentication alias of the created J2C activation specification. ["authenticationAlias", "myAlias"]description Description for the created J2C activation specification. ["description", "My description"]destinationJndiName Destination JNDI name of the created J2C activation. ["destinationJndiName", "myDestinationJndi"]jndiName 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")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 the configuration. The script returns the configuration ID of the new J2C administrative object.
To run the script, specify the resource adapter, activation specification name, JNDI name, and the administrative object interface name arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:
createJ2CAdminObject script. Run the script to create a J2C administrative object.
Argument Description resourceAdapterID Configuration ID of the resource adapter of interest. activationSpecName Name to assign to the new activation specification. adminObjectInterface Name of the administrative object interface. jndiName JNDI name. attributes Optionally specifies additional attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
Optional attributes. Other attributes available for the script.
Attributes Description Example adminObject 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 Description for the created J2C administrative object. ["description", "My description"]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")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 the configuration. The script returns the configuration ID of the new J2C connection factory.
To run the script, specify the resource adapter, connection factory name, the connection factory interface, and the JNDI name arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:
createJ2CConnectionFactory script. Run the script to create a J2C connection factory.
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 attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
Optional attributes. Other attributes available for the script.
Attributes Description Example authDataAlias 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 Category that classifies or groups the resource. ["category", "myCategory"]connectionPool 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 Description of the created J2C connection factory. ["description", "My description"]logMissingTransactionContext Whether to enable or disable missing transaction context logging. ["logMissingTransactionContext", "true"]manageCachedHandles 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 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 JMS provider type that the JMS provider uses. ["providerType", "myJMSProviderType"]xaRecoveryAuthAlias Database authentication alias used during XA recovery processing. When this property is specified, the default value is the alias for application authentication. ["xaRecoveryAuthAlias", "cellMgr/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")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 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. We can optionally specify attributes. The arguments and attributes are defined in the following tables:
installJ2CResourceAdapter script. Run the script to install a J2C resource adapter.
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 attributes in a particular format:
List format
[["attr1", "value1"], ["attr2", "value2"]]
String format
"attr1=value1, attr2=value2"
Optional attributes. Other attributes available for the script.
Attributes Description rar.desc Description of the J2C resource adapter. rar.archivePath 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 Additional classpath. rar.nativePath Native path. rar.threadPoolAlias Alias of the thread pool. rar.propertiesSet Property set of the J2C resource adapter. rar.DeleteSourceRar Whether to delete the source RAR file. rar.isolatedClassLoader Boolean value of the isolated class loader. rar.enableHASupport Boolean value of the enabled high availability. rar.HACapability 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")(Solaris) (AIX)AdminJ2C.installJ2CResourceAdapter("myNode", "/temp/jca15cmd.rar", "J2CTest")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")(Solaris) (AIX)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']])(Solaris) (AIX)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']])
Use the script library to automate the application serving environment using wsadmin.sh
Related
J2C query scripts
JMS configuration scripts
JMS query scripts
JDBC configuration scripts
JDBC query scripts