The jonas-ra.xml contains JOnAS-specific information describing deployment information, logging, pooling, JDBC connections, and RAR configuration property values.
Deployment Tags:
jndiname: (Required) Name the RAR will be registered as. This value will be used in the resource-ref section of an EJB.
rarlink: The JNDI Name of a base RAR file. Useful for deploying multiple connection factories without having to deploy the complete RAR file again. When this is used, the only entry in the RAR is META-INF/jonas-ra.xml.
native-lib: Directory where additional files in the RAR should be deployed.
Logging Tags:
log-enabled: Determines if logging should be enabled for the RAR.
log-topic: Log topic to use for the PrintWriter logger, which allows a separate handler for each deployed RAR.
Pooling Tags:
pool-init: Initial size of the managed connection pool.
pool-min: Minimum size of the managed connection pool.
pool-max: Maximum size of the managed connection pool. Value of -1 is unlimited.
pool-max-age: Maximum number of milliseconds to keep the managed connection in the pool. Value of 0 is an unlimited amount of time.
pstmt-max: Maximum number of PreparedStatements per managed connection in the pool. Only required with JDBC resource adapters. Value of 0 is unlimited; -1 disables the cache.
JDBC Connection Tags: Only valid with a Connection implementation of java.sql.Connection.
jdbc-check-level: Level of checking that will be done for the JDBC connection. Values are 0 for no checking, 1 to validate that the connection is not closed before returning it, and greater than 1 to send the jdbc-test-statement.
jdbc-test-statement: Test SQL statement sent on the connection if the jdbc-check-level is set accordingly.
Config Property Value Tags:
Each entry must correspond to the config-property specified in the ra.xml of the RAR file.
The following portion of a jonas-ra.xml file illustrates linking to a base RAR file named BaseRar. All properties from the base RAR will be inherited and any values given in this jonas-ra.xml will override the other values.
<jonas-resource>
<jndiname>rar1</jndiname>
<rarlink>BaseRar</rarlink>
<native-lib>nativelib</native-lib>
<log-enabled>false</log-enabled>
<log-topic>com.xxx.rar1</log-topic>
<jonas-config-property>
<jonas-config-property-name>ip</jonas-config-property-name>
<jonas-config-property-value>www.xxx.com</jonas-config-property-value>
</jonas-config-property>
.
.
</jonas-resource> |
The following portion of a jonas-ra.xml file shows the configuration of a JDBC RAR file.
<jonas-resource>
<jndiname>jdbc1</jndiname>
<rarlink></rarlink>
<native-lib>nativelib</native-lib>
<log-enabled>false</log-enabled>
<log-topic>com.xxx.jdbc1</log-topic>
<pool-params>
<pool-init>0</pool-init>
<pool-min>0</pool-min>
<pool-max>100</pool-max>
<pool-max-age>0</pool-max-age>
<pstmt-max>20</pstmt-max>
</pool-params>
<jdbc-conn-params>
<jdbc_check-level>2</jdbc_check-level>
<jdbc-test-statement>select 1</jdbc-test-statement>
</jdbc-conn-params>
<jonas-config-property>
<jonas-config-property-name>url</jonas-config-property-name>
<jonas-config-property-value>jdbc:oracle:thin:@test:1521:DB1
</jonas-config-property-value>
</jonas-config-property>
.
.
</jonas-resource> |