List of Tables
datasource
elementsxa-datasource
elementsThe specification can be found here: http://www.jcp.org/en/jsr/detail?id=322.
The IronJacamar project is licensed under the GNU LESSER GENERAL PUBLIC LICENSE 2.1 (LGPL 2.1) license.
This section contains the highlights of the IronJacamar releases. A full description of each release can be found through our issue tracking system at http://issues.jboss.org/browse/JBJCA.
Highlights as compared to IronJacamar 1.0:
Copyright © 2014 Red Hat, Inc. and others.
An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
The Java Connector Architecture (JCA) defines a standard architecture for connecting the Java EE platform to heterogeneous Enterprise Information Systems (EIS). Examples of EISs include Enterprise Resource Planning (ERP), mainframe transaction processing (TP), databases and messaging systems.
The connector architecture defines a set of scalable, secure, and transactional mechanisms that enable the integration of EISs with application servers and enterprise applications.
The connector architecture also defines a Common Client Interface (CCI) for EIS access. The CCI defines a client API for interacting with heterogeneous EISs.
The connector architecture enables an EIS vendor to provide a standard resource adapter for its EIS. A resource adapter is a system-level software driver that is used by a Java application to connect to an EIS. The resource adapter plugs into an application server and provides connectivity between the EIS, the application server, and the enterprise application. The resource adapter serves as a protocol adapter that allows any arbitrary EIS communication protocol to be used for connectivity. An application server vendor extends its system once to support the connector architecture and is then assured of seamless connectivity to multiple EISs. Likewise, an EIS vendor provides one standard resource adapter which has the capability to plug in to any application server that supports the connector architecture.
The Java Connector Architecture 1.6 specification adds the following major areas:
The Java EE Connector Architecture features three different types of resource adapters
For more information about Java EE Connector Architecture see the specification.
The Java Connector Architecture specification consists of a number of outbound components:
IronJacamar - the application server - contains
The Java Connector Architecture specification consists of a number of inbound components:
IronJacamar - the application server - contains
The official IronJacamar project page is http://www.ironjacamar.org/ where you can download the software.
The download location is: http://www.ironjacamar.org/downloads/
Each release is labelled with a version number and an identifier.
ironjacamar-<major>.<minor>.<patch>.<identifier>
where
An example
ironjacamar-1.2.0.Final.tar.gz
which is a stable release of the project.
The IronJacamar distribution is deployed to the JBoss Nexus repository.
Repository: http://repository.jboss.org/nexus/content/groups/public/
Group id: org.jboss.ironjacamar
Once you have downloaded the distribution you need to install it in a location of your choice.
Extract the distribution using
tar xzf ironjacamar-1.2.0.Final.tar.gz
The distribution will be located in a directory named
ironjacamar-1.2.0.Final
Extract the distribution using
unzip ironjacamar-1.2.0.Final.zip
or any program capable of handling Zip archives such as WinZip and WinRar.
The distribution will be located in a directory named
ironjacamar-1.2.0.Final
The IronJacamar container has the following directory structure:
./as-upgrader.sh 1.2.0.Final /path/to/wildfly/installation
You can get an overview of all IronJacamar releases by searching our Nexus repository.
The configuration for the IronJacamar container is mainly located under the config/
directory.
An example of an ironjacamar.properties
file:
remote.access=true remote.port=1302
The leak detector pool is configured using the ironjacamar.mcp
system
property with a value of
org.jboss.jca.core.connectionmanager.pool.mcp.LeakDumperManagedConnectionPool
This configuration applies to all connection pools used by IronJacamar.
-Dironjacamar.mcp=org.jboss.jca.core.connectionmanager.pool.mcp.LeakDumperManagedConnectionPool -Dironjacamar.leaklog=leaks.txt
The IronJacamar container uses JBoss Logging framework as the implementation.
The configuration is done in the
config/logging.properties
Consult the JBoss Logging documentation on how the service can be configured.
The IronJacamar container uses Narayana its transaction implementation.
The configuration is done in the
config/transaction.xml
Consult the Narayana documentation on how the service can be configured.
The IronJacamar deployer is configured in the
config/bootstrap/jca.xml
<bean name="RAConfiguration"
class="org.jboss.jca.deployers.fungal.RAConfiguration">
<property name="ArchiveValidation">true</property>
<property name="ArchiveValidationFailOnWarn">false</property>
<property name="ArchiveValidationFailOnError">true</property>
<property name="BeanValidation">true</property>
<property name="PrintStream">
<inject bean="JBossStdioContext" property="Out"/>
</property>
<property name="DefaultBootstrapContext">
<inject bean="DefaultBootstrapContext"/>
</property>
<property name="JndiStrategy"><inject bean="JndiStrategy"/></property>
<property name="TransactionManager">
<inject bean="RealTransactionManager"/>
</property>
<property name="MetadataRepository"><inject bean="MDR"/></property>
</bean>
<bean name="RADeployer"
interface="com.github.fungal.spi.deployers.Deployer"
class="org.jboss.jca.deployers.fungal.RADeployer">
<property name="Configuration"><inject bean="RAConfiguration"/></property>
<depends>BeanValidation</depends>
<depends>JBossStdioContextSelector</depends>
</bean>
This deployer will register the resource adapters with the metadata repository in the system.
<bean name="RaXmlDeployer"
interface="com.github.fungal.spi.deployers.Deployer"
class="org.jboss.jca.deployers.fungal.RaXmlDeployer">
<property name="Configuration"><inject bean="DeployerConfiguration"/></property>
<property name="Kernel"><inject bean="Kernel"/></property>
<depends>BeanValidation</depends>
<depends>JBossStdioContextSelector</depends>
</bean>
This deployer will activate resource adapters based on the deployment information.
<bean name="RAActivator"
class="org.jboss.jca.deployers.fungal.RAActivator">
<property name="Configuration"><inject bean="RAConfiguration"/></property>
<property name="Kernel"><inject bean="Kernel"/></property>
<property name="ExcludeArchives">
<set elementClass="java.lang.String">
<value>jdbc-local.rar</value>
<value>jdbc-xa.rar</value>
</set>
</property>
<depends>BeanValidation</depends>
<depends>JBossStdioContextSelector</depends>
</bean>
The distributed work manager has three additional components
to control the distribution process.
org.jboss.jca.core.workmanager.policy.Never
Never the distribute the Work
instance to another node.
org.jboss.jca.core.workmanager.policy.Always
Always the distribute the Work
instance to another node.
org.jboss.jca.core.workmanager.policy.WaterMark
Distribute the Work
instance to another node based on how many
free worker threads the current node has available.
org.jboss.jca.core.workmanager.selector.FirstAvailable
Select the first available node in the list
org.jboss.jca.core.workmanager.selector.PingTime
Select the node with the lowest ping time
org.jboss.jca.core.workmanager.selector.MaxFreeThreads
Select the node with highest number of free worker threads
<deployment>
<!-- DistributedWorkManagerThreadGroupSocket -->
<bean name="DistributedWorkManagerThreadGroupSocket"
class="java.lang.ThreadGroup">
<constructor>
<parameter>dwm</parameter>
</constructor>
<ignoreStop/>
<ignoreDestroy/>
</bean>
<!-- DistributedWorkManagerThreadFactorySocket -->
<bean name="DistributedWorkManagerThreadFactorySocket"
interface="java.util.concurrent.ThreadFactory"
class="org.jboss.threads.JBossThreadFactory">
<constructor>
<parameter><inject bean="DistributedWorkManagerThreadGroupSocket"/></parameter>
<parameter>false</parameter>
<parameter>5</parameter>
<parameter>work</parameter>
<parameter><null/></parameter>
<parameter><null/></parameter>
</constructor>
</bean>
<!-- DistributedWorkManagerShortRunningThreadPoolSocket -->
<bean name="DistributedWorkManagerShortRunningThreadPoolSocket"
class="org.jboss.threads.QueueExecutor">
<constructor>
<!-- Core threads -->
<parameter>20</parameter>
<!-- Max threads -->
<parameter>100</parameter>
<!-- 60 seconds keepalive -->
<parameter>60</parameter>
<parameter><inject bean="KeepAliveTimeUnit"/></parameter>
<!-- Queue size -->
<parameter>1024</parameter>
<!-- Thread factory -->
<parameter><inject bean="DistributedWorkManagerThreadFactorySocket"/></parameter>
<!-- Blocking -->
<parameter>true</parameter>
<!-- Handoff executor -->
<parameter><inject bean="RejectingExecutor"/></parameter>
</constructor>
<destroy method="shutdown"/>
</bean>
<!-- DistributedWorkManagerPolicySocket -->
<bean name="DistributedWorkManagerPolicySocket"
class="org.jboss.jca.core.workmanager.policy.Always">
</bean>
<!-- DistributedWorkManagerSelectorSocket -->
<bean name="DistributedWorkManagerSelectorSocket"
class="org.jboss.jca.core.workmanager.selector.FirstAvailable">
</bean>
<!-- DistributedWorkManagerTransportSocket -->
<bean name="DistributedWorkManagerTransportSocket"
class="org.jboss.jca.core.workmanager.transport.remote.socket.SocketTransport">
<!-- The id -->
<property name="Id">1</property>
<!-- The executor -->
<property name="ExecutorService">
<inject bean="Kernel" property="ExecutorService"/>
</property>
<!-- The host -->
<property name="Host">127.0.0.1</property>
<!-- The port -->
<property name="Port">1299</property>
<!-- The peers -->
<property name="Peers">
<set class="java.util.HashSet"
elementClass="java.lang.String">
<value>localhost:1300</value>
</set>
</property>
<start method="startup"/>
<stop method="shutdown"/>
</bean>
<!-- PicketBox -->
<bean name="PicketBoxSocket"
class="org.jboss.jca.core.security.picketbox.PicketBoxSecurityIntegration">
</bean>
<!-- DistributedWorkManagerSocket -->
<bean name="DistributedWorkManagerSocket"
interface="org.jboss.jca.core.api.workmanager.DistributedWorkManager"
class="org.jboss.jca.core.workmanager.DistributedWorkManagerImpl">
<!-- The name -->
<property name="Name">DWM-Socket</property>
<!-- The short running thread pool -->
<property name="ShortRunningThreadPool">
<inject bean="DistributedWorkManagerShortRunningThreadPoolSocket"/>
</property>
<!-- The XA terminator -->
<property name="XATerminator">
<inject bean="TransactionIntegration" property="XATerminator"/>
</property>
<!-- The callback security module -->
<property name="CallbackSecurity">
<inject bean="Callback"/>
</property>
<!-- The security integration module -->
<property name="SecurityIntegration">
<inject bean="PicketBoxSocket"/>
</property>
<!-- The policy -->
<property name="Policy">
<inject bean="DistributedWorkManagerPolicySocket"/>
</property>
<!-- The selector -->
<property name="Selector">
<inject bean="DistributedWorkManagerSelectorSocket"/>
</property>
<!-- The transport -->
<property name="Transport">
<inject bean="DistributedWorkManagerTransportSocket"/>
</property>
<!-- <destroy method="shutdown"/> -->
</bean>
<!-- DistributedBootstrapContextSocket -->
<bean name="DistributedBootstrapContextSocket"
interface="org.jboss.jca.core.api.bootstrap.CloneableBootstrapContext"
class="org.jboss.jca.core.bootstrapcontext.BaseCloneableBootstrapContext">
<property name="Name">DWMBC-Socket</property>
<property name="TransactionSynchronizationRegistry">
<inject bean="TransactionSynchronizationRegistry"/>
</property>
<property name="WorkManagerName">
<inject bean="DistributedWorkManagerSocket" property="Name"/>
</property>
<property name="XATerminator">
<inject bean="TransactionIntegration" property="XATerminator"/>
</property>
</bean>
</deployment>
The support is activated by letting the work instance implement the
javax.resource.spi.work.WorkContextProvider
interface and returning an instance of javax.resource.spi.work.SecurityContext
.
A security domain can be configured through
<!-- SubjectFactory -->
<bean name="DefaultSecurityDomain"
interface="org.jboss.jca.core.spi.security.SubjectFactory"
class="org.jboss.jca.core.security.DefaultSubjectFactory">
<property name="SecurityDomain">DefaultSecurityDomain</property>
<property name="UserName">user</property>
<property name="Password">password</property>
</bean>
The configuration is done in the
config/bootstrap/ds.xml
The datasource deployer can be removed from the environment by removing the ds.xml
file in
config/bootstrap/
as well as the reference in config/bootstrap/bootstrap.xml
to the file.
Furthermore all jdbc-*.rar
files in the system/
directory should be removed too.
The IronJacamar project features a web server which is used to serve web archive deployments. More information about Jetty can be found at the homepage.
The configuration is done in the
system/web.xml
file.
<bean name="WebServer" class="org.jboss.jca.web.WebServer">
<property name="Host">${iron.jacamar.bindaddress:localhost}</property>
<property name="Port">8080</property>
<property name="ExecutorService"><inject bean="Kernel" property="ExecutorService"/></property>
</bean>
The web server can be removed from the environment by removing the web.xml
file in
system/
Furthermore all .war
files in the same directory should be removed too.
All the Jetty libraries can be removed by deleting the
lib/jetty
directory.
The IronJacamar distribution contains a deploy/ directory where all deployments should be deployed to.
A resource adapter archive name ends in the .rar
extension.
An example of a resource adapter archive could look like
[jpederse@localhost]$ jar tf ra.rar META-INF/ra.xml readme.html ra.jar images/icon.jpg win.dll linux.so
See the Java EE Connector Architecture 1.7 specification chapter 20 for further requirements.
Resource adapters (.rar) are deployed by copying the resource adapter into the
deploy/
directory
cp example.rar ironjacamar-1.2.0.Final/deploy
copy example.rar ironjacamar-1.2.0.Final\deploy
<resource-adapters>
<resource-adapter>
<archive>example.rar</archive>
<connection-definitions>
<connection-definition jndi-name="java:/eis/example" class-name="com.example.ra.MCF"/>
</connection-definitions>
</resource-adapter>
</resource-adapters>
to bind the connection factory from com.example.ra.MCF
under java:/eis/example
.
See the schema appendix for additional details about the format.
java:/eis/<deploymentName>
- f.ex. java:/eis/example
and a single admin object under
java:/eis/ao/<deploymentName>
A resource adapter can be configured using two different ways
Table 5.2. Bean validation groups elements
Element | Desciption |
---|---|
bean-validation-group | Specifies the fully qualified class name for a bean validation group that should be used for validation |
Table 5.3. Connection definition / admin object attributes
Attribute | Desciption |
---|---|
class-name | Specifies the the fully qualified class name of a managed connection factory or admin object |
jndi-name | Specifies the JNDI name |
enabled | Should the object in question be activated |
use-java-context | Specifies if a java:/ JNDI context should be used |
pool-name | Specifies the pool name for the object |
use-ccm | Enable the cache connection manager |
sharable | Defines the connection as sharable (lazy association) (1.1) |
enlistment | Defines if the connection should use lazy enlistment if supported (1.1) |
connectable |
Allow components to obtain a connection through the XAResource instance (1.2)
|
tracking | Track connection handles across transaction boundaries (1.2) |
Table 5.4. Connection definition elements
Element | Desciption |
---|---|
config-property | The config-property specifies managed connection factory configuration properties. |
pool | Specifies pooling settings |
xa-pool | Specifies XA pooling settings |
security | Specifies security settings |
timeout | Specifies time out settings |
validation | Specifies validation settings |
recovery | Specifies the XA recovery settings |
Table 5.5. Pool elements
Element | Desciption |
---|---|
min-pool-size | The min-pool-size element indicates the minimum number of connections a pool should hold. These are not created until a Subject is known from a request for a connection. This default to 0 |
initial-pool-size | The initial-pool-size element indicates the initial number of connections a pool should hold. These are not created until a Subject is known from a request for a connection. This default to 0 (1.1) |
max-pool-size | The max-pool-size element indicates the maximum number of connections for a pool. No more than max-pool-size connections will be created in each sub-pool. This defaults to 20. |
prefill | Whether to attempt to prefill the connection pool. Default is false |
use-strict-min | Specifies if the min-pool-size should be considered strictly. Default false |
flush-strategy |
Specifies how the pool should be flush in case of an error.
Valid values are: FailingConnectionOnly (default), InvalidIdleConnections (1.1),
IdleConnections , Gracefully (1.1), EntirePool ,
AllInvalidIdleConnections (1.1), AllIdleConnections (1.1),
AllGracefully (1.1), AllConnections (1.1)
|
capacity | Specifies the capacity policies (1.1) |
Table 5.6. XA pool elements
Element | Desciption |
---|---|
min-pool-size | The min-pool-size element indicates the minimum number of connections a pool should hold. These are not created until a Subject is known from a request for a connection. This default to 0 |
initial-pool-size | The initial-pool-size element indicates the initial number of connections a pool should hold. These are not created until a Subject is known from a request for a connection. This default to 0 (1.1) |
max-pool-size | The max-pool-size element indicates the maximum number of connections for a pool. No more than max-pool-size connections will be created in each sub-pool. This defaults to 20. |
prefill | Whether to attempt to prefill the connection pool. Default is false |
use-strict-min | Specifies if the min-pool-size should be considered strictly. Default false |
flush-strategy |
Specifies how the pool should be flush in case of an error.
Valid values are: FailingConnectionOnly (default), InvalidIdleConnections (1.1),
IdleConnections , Gracefully (1.1), EntirePool ,
AllInvalidIdleConnections (1.1), AllIdleConnections (1.1),
AllGracefully (1.1), AllConnections (1.1)
|
capacity | Specifies the capacity policies (1.1) |
is-same-rm-override | The is-same-rm-override element allows one to unconditionally set whether the javax.transaction.xa.XAResource.isSameRM(XAResource) returns true or false |
interleaving | An element to enable interleaving for XA connection factories |
no-tx-separate-pools | Oracle does not like XA connections getting used both inside and outside a JTA transaction. To workaround the problem you can create separate sub-pools for the different contexts |
pad-xid | Should the Xid be padded |
wrap-xa-resource | Should the XAResource instances be wrapped in an org.jboss.jca.core.spi.transaction.xa.XAResourceWrapper instance |
Table 5.7. Security elements
Element | Desciption |
---|---|
application | Indicates that application supplied parameters (such as from getConnection(user, pw)) are used to distinguish connections in the pool. |
security-domain | Indicates Subject (from security domain) are used to distinguish connections in the pool. The content of the security-domain is the name of the JAAS security manager that will handle authentication. This name correlates to the JAAS login-config.xml descriptor application-policy/name attribute. |
security-domain-and-application | Indicates that either application supplied parameters (such as from getConnection(user, pw)) or Subject (from security domain) are used to distinguish connections in the pool. The content of the security-domain is the name of the JAAS security manager that will handle authentication. This name correlates to the JAAS login-config.xml descriptor application-policy/name attribute. |
Table 5.8. Time out elements
Element | Desciption |
---|---|
blocking-timeout-millis | The blocking-timeout-millis element indicates the maximum time in milliseconds to block while waiting for a connection before throwing an exception. Note that this blocks only while waiting for a permit for a connection, and will never throw an exception if creating a new connection takes an inordinately long time. The default is 30000 (30 seconds). |
idle-timeout-minutes | The idle-timeout-minutes elements indicates the maximum time in minutes a connection may be idle before being closed. The actual maximum time depends also on the IdleRemover scan time, which is 1/2 the smallest idle-timeout-minutes of any pool. |
allocation-retry | The allocation retry element indicates the number of times that allocating a connection should be tried before throwing an exception. The default is 0. |
allocation-retry-wait-millis | The allocation retry wait millis element indicates the time in milliseconds to wait between retrying to allocate a connection. The default is 5000 (5 seconds). |
xa-resource-timeout | Passed to XAResource.setTransactionTimeout(). Default is zero which does not invoke the setter. Specified in seconds |
Table 5.9. Validation elements
Element | Desciption |
---|---|
validate-on-match | The validate-on-match element indicates whether or not connection level validation should be done when a connection factory attempts to match a managed connection for a given set. This is typically exclusive to the use of background validation (1.2) |
background-validation | An element to specify that connections should be validated on a background thread versus being validated prior to use |
background-validation-millis | The background-validation-millis element specifies the amount of time, in milliseconds, that background validation will run. |
use-fast-fail | Whether fail a connection allocation on the first connection if it is invalid (true) or keep trying until the pool is exhausted of all potential connections (false). Default is false |
Table 5.10. Admin object elements
Element | Desciption |
---|---|
config-property | Specifies an administration object configuration property. |
Table 5.11. Recovery elements
Element | Desciption |
---|---|
recover-credential | Specifies the user name / password pair or security domain that should be used for recovery. |
recover-plugin | Specifies an implementation of the org.jboss.jca.core.spi.recovery.RecoveryPlugin class. |
The deployment schemas are defined in doc/ironjacamar_1_0.xsd
, doc/ironjacamar_1_1.xsd
,
doc/resource-adapters_1_0.xsd
and doc/resource-adapters_1_1.xsd
.
The following sections will describe these extensions points.
The interface contains two methods that should be implemented in a resource adapter specific manner.
public boolean isValid(Object c) throws ResourceException;
will return true
if the connection can be used for recovery.
public void close(Object c) throws ResourceException;
will close a connection that was used for recovery.
The recovery extension is activated by adding a recovery element to the deployment
<recovery> <recovery-plugin>com.mycompany.myproject.RecoveryPluginImpl</recovery-plugin> </recovery>
The following recovery plugins are provided by IronJacamar
org.jboss.jca.core.recovery.DefaultRecoveryPlugin
: Default recovery plugin
that tries to call a close()
method on the underlying object
org.jboss.jca.core.recovery.ConfigurableRecoveryPlugin
: A recovery plugin
where the results of the isValid
and close
can be specified
org.jboss.jca.core.recovery.ValidatingManagedConnectionFactoryRecoveryPlugin
:
A recovery plugin that uses the javax.resource.spi.ValidatingManagedConnectionFactory
interface to verify the connection
Datasources (-ds.xml) are deployed by copying the definition into the
deploy/
directory
cp postgres-xa-ds.xml ironjacamar-1.2.0.Final/deploy
copy postgres-xa-ds.xml ironjacamar-1.2.0.Final\deploy
You will need to install the database JDBC driver into the lib/
directory.
Datasource descriptors are divided into
A datasource descriptor supports the following parameters.
Table 5.14. datasource
elements
Element | Desciption |
---|---|
connection-url | The JDBC driver connection URL |
driver-class | The fully qualifed name of the JDBC driver class |
datasource-class | The fully qualifed name of the JDBC datasource class |
driver |
An unique name for the JDBC driver specified in the drivers section. Or the name of the .jar file if deployed as standalone deployment This element is mandatory when deploying in WildFly |
connection-property | The connection-property element allows you to pass in arbitrary connection properties to the Driver.connect(url, props) method. Each connection-property specifies a string name/value pair with the property name coming from the name attribute and the value coming from the element content |
new-connection-sql | Specify an SQL statement to execute whenever a connection is added to the connection pool |
transaction-isolation | Set java.sql.Connection transaction isolation level to use. The constants defined by transaction-isolation-values are the possible transaction isolation levels and include: TRANSACTION_READ_UNCOMMITTED TRANSACTION_READ_COMMITTED TRANSACTION_REPEATABLE_READ TRANSACTION_SERIALIZABLE TRANSACTION_NONE |
url-delimiter | Specifies the delimeter for URLs in connection-url for HA datasources |
url-selector-strategy-class-name | A class that implements org.jboss.jca.adapters.jdbc.spi.URLSelectorStrategy |
pool | Specifies the pooling settings |
security | Specifies the security settings |
validation | Specifies the validation settings |
timeout | Specifies the time out settings |
statement | Specifies the statement settings |
Table 5.15. xa-datasource
elements
Element | Desciption |
---|---|
xa-datasource-property | Specifies a property to assign to the XADataSource implementation class. Each property is identified by the name attribute and the property value is given by the xa-datasource-property element content. The property is mapped onto the XADataSource implementation by looking for a JavaBeans style getter method for the property name. If found, the value of the property is set using the JavaBeans setter with the element text translated to the true property type using the java.beans.PropertyEditor for the type |
xa-datasource-class | The fully qualifed name of the javax.sql.XADataSource implementation class |
driver |
An unique name for the JDBC driver specified in the drivers section. Or the name of the .jar file if deployed as standalone deployment. This element is mandatory when deploying in WildFly |
url-delimiter | Specifies the delimeter for URLs in the connection url for HA datasources |
url-property | Specifies the property for the URL property in the xa-datasource-property values (1.2) |
url-selector-strategy-class-name | A class that implements org.jboss.jca.adapters.jdbc.spi.URLXASelectorStrategy |
new-connection-sql | Specifies an SQL statement to execute whenever a connection is added to the connection pool |
transaction-isolation | Set java.sql.Connection transaction isolation level to use. The constants defined by transaction-isolation-values are the possible transaction isolation levels and include: TRANSACTION_READ_UNCOMMITTED TRANSACTION_READ_COMMITTED TRANSACTION_REPEATABLE_READ TRANSACTION_SERIALIZABLE TRANSACTION_NONE |
xa-pool | Specifies the pooling settings |
security | Specifies the security settings |
validation | Specifies the validation settings |
timeout | Specifies the time out settings |
statement | Specifies the statement settings |
recovery | Specifies the recovery settings |
Table 5.16. Pool settings
Element | Desciption |
---|---|
min-pool-size | The min-pool-size element indicates the minimum number of connections a pool should hold. These are not created until a Subject is known from a request for a connection. This default to 0 |
initial-pool-size | The initial-pool-size element indicates the initial number of connections a pool should hold. These are not created until a Subject is known from a request for a connection. This default to 0 (1.2) |
max-pool-size | The max-pool-size element indicates the maximum number of connections for a pool. No more connections will be created in each sub-pool. This defaults to 20 |
prefill | Whether to attempt to prefill the connection pool. Empty element denotes a true value. Default is false |
use-strict-min | Define if the min-pool-size should be considered a strictly. Default false |
flush-strategy |
Specifies how the pool should be flush in case of an error.
Valid values are: FailingConnectionOnly (default), InvalidIdleConnections (1.2),
IdleConnections , Gracefully (1.2), EntirePool ,
AllInvalidIdleConnections (1.2), AllIdleConnections (1.2),
AllGracefully (1.2), AllConnections (1.2)
|
allow-multiple-users | Specifies if multiple users will access the datasource through the getConnection(user, password) method and hence if the internal pool type should account for that (1.1) |
capacity | Specifies the capacity policies (1.2) |
connection-listener | An org.jboss.jca.adapters.jdbc.spi.listener.ConnectionListener that provides a possible to listen for connection activation and passivation in order to perform actions before the connection is returned to the application or returned to the pool (1.2) |
Table 5.17. XA pool settings
Element | Desciption |
---|---|
min-pool-size | The min-pool-size element indicates the minimum number of connections a pool should hold. These are not created until a Subject is known from a request for a connection. This default to 0 |
initial-pool-size | The initial-pool-size element indicates the initial number of connections a pool should hold. These are not created until a Subject is known from a request for a connection. This default to 0 (1.2) |
max-pool-size | The max-pool-size element indicates the maximum number of connections for a pool. No more connections will be created in each sub-pool. This defaults to 20 |
prefill | Whether to attempt to prefill the connection pool. Empty element denotes a true value. Default is false |
use-strict-min | Define if the min-pool-size should be considered a strictly. Default false |
flush-strategy |
Specifies how the pool should be flush in case of an error.
Valid values are: FailingConnectionOnly (default), InvalidIdleConnections (1.2),
IdleConnections , Gracefully (1.2), EntirePool ,
AllInvalidIdleConnections (1.2), AllIdleConnections (1.2),
AllGracefully (1.2), AllConnections (1.2)
|
allow-multiple-users | Specifies if multiple users will access the datasource through the getConnection(user, password) method and hence if the internal pool type should account for that (1.1) |
capacity | Specifies the capacity policies (1.2) |
connection-listener | An org.jboss.jca.adapters.jdbc.spi.listener.ConnectionListener that provides a possible to listen for connection activation and passivation in order to perform actions before the connection is returned to the application or returned to the pool (1.2) |
is-same-rm-override | The is-same-rm-override element allows one to unconditionally set whether the javax.transaction.xa.XAResource.isSameRM(XAResource) returns true or false |
interleaving | An element to enable interleaving for XA connection factories |
no-tx-separate-pools | Oracle does not like XA connections getting used both inside and outside a JTA transaction. To workaround the problem you can create separate sub-pools for the different contexts |
pad-xid | Should the Xid be padded |
wrap-xa-resource | Should the XAResource instances be wrapped in an org.jboss.jca.core.spi.transaction.xa.XAResourceWrapper instance |
Table 5.18. Security settings
Element | Desciption |
---|---|
user-name | Specify the username used when creating a new connection. |
password | Specify the password used when creating a new connection. |
security-domain | Indicates Subject (from security domain) are used to distinguish connections in the pool. The content of the security-domain is the name of the JAAS security manager that will handle authentication. This name correlates to the JAAS login-config.xml descriptor application-policy/name attribute. |
reauth-plugin | Defines a reauthentication plugin that can be used for reauthentication of physical connections. |
Table 5.19. Validation settings
Element | Desciption |
---|---|
valid-connection-checker | An org.jboss.jca.adapters.jdbc.spi.ValidConnectionChecker that provides a SQLException isValidConnection(Connection e) method to validate is a connection is valid. An exception means the connection is destroyed. This overrides the check-valid-connection-sql when present |
check-valid-connection-sql | Specify an SQL statement to check validity of a pool connection. This may be called when managed connection is taken from pool for use. |
validate-on-match | The validate-on-match element indicates whether or not connection level validation should be done when a connection factory attempts to match a managed connection for a given set. This is typically exclusive to the use of background validation |
background-validation | An element to specify that connections should be validated on a background thread versus being validated prior to use |
background-validation-millis | The background-validation-millis element specifies the amount of time, in milliseconds, that background validation will run |
use-fast-fail | Whether fail a connection allocation on the first connection if it is invalid (true) or keep trying until the pool is exhausted of all potential connections (false) default false |
stale-connection-checker | An org.jboss.jca.adapters.jdbc.spi.StaleConnectionChecker that provides a boolean isStaleConnection(SQLException e) method which if it it returns true will wrap the exception in an org.jboss.jca.adapters.jdbc.StaleConnectionException which is a subclass of SQLException |
exception-sorter | An org.jboss.jca.adapters.jdbc.spi.ExceptionSorter that provides a boolean isExceptionFatal(SQLException e) method to validate is an exception should be broadcast to all javax.resource.spi.ConnectionEventListener as a connectionErrorOccurred message |
Table 5.20. Time out settings
Element | Desciption |
---|---|
blocking-timeout-millis | The blocking-timeout-millis element indicates the maximum time in milliseconds to block while waiting for a connection before throwing an exception. Note that this blocks only while waiting for a permit for a connection, and will never throw an exception if creating a new connection takes an inordinately long time. The default is 30000 (30 seconds). |
idle-timeout-minutes | The idle-timeout-minutes elements indicates the maximum time in minutes a connection may be idle before being closed. The actual maximum time depends also on the IdleRemover scan time, which is 1/2 the smallest idle-timeout-minutes of any pool. |
set-tx-query-timeout | Whether to set the query timeout based on the time remaining until transaction timeout, any configured query timeout will be used if there is no transaction. The default is false |
query-timeout | Any configured query timeout in seconds The default is no timeout |
use-try-lock | Any configured timeout for internal locks on the resource adapter objects in seconds The default is a 60 second timeout |
allocation-retry | The allocation retry element indicates the number of times that allocating a connection should be tried before throwing an exception. The default is 0. |
allocation-retry-wait-millis | The allocation retry wait millis element indicates the time in milliseconds to wait between retrying to allocate a connection. The default is 5000 (5 seconds). |
xa-resource-timeout | Passed to XAResource.setTransactionTimeout() Default is zero which does not invoke the setter. In seconds |
Table 5.21. Statement settings
Element | Desciption |
---|---|
track-statements |
Whether to check for unclosed statements when a connection is returned
to the pool and result sets are closed when a statement is closed/return
to the prepared statement cache. valid values are: false - do not track statements
and results; true - track statements and result sets and warn when they are
not closed; nowarn - track statements but do no warn about them being unclosed
(the default)
|
prepared-statement-cache-size | The number of prepared statements per connection in an LRU cache |
share-prepared-statements | Whether to share prepare statements, i.e. whether asking for same statement twice without closing uses the same underlying prepared statement. The default is false |
Table 5.22. Recovery elements
Element | Desciption |
---|---|
recover-credential | Specifies the user name / password pair or security domain that should be used for recovery. |
recover-plugin | Specifies an implementation of the org.jboss.jca.core.spi.recovery.RecoveryPlugin class. |
Table 5.23. Driver attributes
Attribute | Desciption |
---|---|
name | An unique name for the JDBC driver |
module |
The module definition for the JDBC driver. The format of a module inside
WildFly 8+ is The format for IronJacamar Standalone/Embedded is the name of the .jar file |
major-version | The major version of the driver |
minor-version | The minor version of the driver |
Table 5.24. Driver elements
Element | Desciption |
---|---|
driver-class | The fully qualified class name of the driver class |
datasource-class | The fully qualified class name of the datasource class |
xa-datasource-class | The fully qualified class name of the XA datasource class |
org.jboss.jca.adapters.jdbc.spi.ExceptionSorter
: Plugin to check if a
SQLException
is fatal for the connection on which it was thrown.
org.jboss.jca.adapters.jdbc.spi.StaleConnection
: Plugin to wrap stale
SQLException
's in a org.jboss.jca.adapters.jdbc.StaleConnectionException
.
org.jboss.jca.adapters.jdbc.spi.ValidConnection
: Plugin to Check if a connection is
valid for use by the application.
Configuration of the extensions are done by using
org.jboss.jca.adapters.jdbc.extensions.novendor.AlwaysExceptionSorter
org.jboss.jca.adapters.jdbc.extensions.novendor.AlwaysStaleConnectionChecker
org.jboss.jca.adapters.jdbc.extensions.novendor.GoodForSecondsValidConnectionChecker
org.jboss.jca.adapters.jdbc.extensions.novendor.JDBC4ValidConnectionChecker
org.jboss.jca.adapters.jdbc.extensions.novendor.NullExceptionSorter
org.jboss.jca.adapters.jdbc.extensions.novendor.NullStaleConnectionChecker
org.jboss.jca.adapters.jdbc.extensions.novendor.NullValidConnectionChecker
org.jboss.jca.adapters.jdbc.extensions.novendor.SQLExceptionValidConnectionChecker
The following increment policies are supported.
The IronJacamar container is started by entering the bin/ directory
cd ironjacamar-1.2.0.Final/bin
./run.sh
run.bat
The command takes an optional -b argument to define the binding address of the naming server
./run.sh -b 192.168.0.199
Once the container has started you should see a log entry like
13:33:10,999 INFO [Main] Server started in 941ms
in the console where the command was executed.
After the container has started you can browse to
http://localhost:8080
to view the project documentation and use the administration console.
The IronJacamar container is stopped by pressing the Ctrl-C
keys.
Once the container has stopped you should see a log entry like
13:35:06,752 INFO [Main] Server stopped in 29ms
in the console where the container was running.
Alternative the container can be stopped through the command line interface.
The IronJacamar container can be controlled by a command line interface.
If you are accessing a remote container you can use the -h
option to
specify the host name.
Severity: ERROR Section: 19.4.2 Description: A ResourceAdapter must implement a "public int hashCode()" method. Code: com.mycompany.myproject.ResourceAdapterImpl Severity: ERROR Section: 19.4.2 Description: A ResourceAdapter must implement a "public boolean equals(Object)" method. Code: com.mycompany.myproject.ResourceAdapterImpl
The validator can be run on the command line by
cd doc/validator ./validator.sh <file>
The reports will be generated into the current directory under the name of
<file>.log
.
First you have to define the taskdef
for the task
<taskdef name="validator" classname="org.jboss.jca.validator.ant.ValidatorTask" classpathref="ironjacamar.lib.path.id"/>
See the Apache Ant documentation for additional instructions on installation.
<build>
<plugins>
<plugin>
<groupId>org.jboss.ironjacamar</groupId>
<artifactId>ironjacamar-validator-maven</artifactId>
<!-- The version of the plugin you want to use -->
<version>1.2.0.Final</version>
<executions>
<execution>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- output directory-->
<outputDir>.</outputDir>
<!-- rar filename -->
<rarFile>/path/to/myresourceadapter.rar</rarFile>
<!-- optional classpath
<classpath>
<param>classpath1</param>
<param>classpath2</param>
</classpath>
-->
</configuration>
</plugin>
</plugins>
</build>
See the Apache Maven documentation for additional instructions on installation.
The code generator can be run on the command line by
./codegenerator.sh
from the doc/codegenerator
directory.
The code generator supports the following arguments
The developer must then answer various questions regarding the properties of the resource adapter.
The IronJacamar Eclipse plugin features development tools used for developing resource adapter applications for the IronJacamar standalone distribution, WildFly or JBoss Enterprise Application Platform 6+.
The plugin allows you to
cp ironjacamar-eclipse.jar $ECLIPSE_HOME/plugins
copy ironjacamar-eclipse.jar %ECLIPSE_HOME%\plugins
Open "Window->Preferences" and select the IronJacamar category.
The IronJacamar home setting must point to the root directory of the IronJacamar installation, like
/opt/ironjacamar-1.2.0.Final
Choose "IronJacamar 1.1 project" and follow the instructions to generate your resource adapter.
The IronJacamar Eclipse plugin provides a way to deploy files to an IronJacamar server.
Before any deploy operation, the IronJacamar server needs to be started, otherwise it will lead to an error dialog. Please refer to this for detail on how to start the IronJacamar server
From IronJacamar 1.1, a workmanager tab is added to configure workmanager security mappings.
The ManagedConnectionFactory can be activated by selecting the 'Activate' checkbox.
Configure connection pool in the 'pool configuration' tab.
Configure XA connection pool in the 'XA pool' sub tab.
There is a wizard page for each AdminObject if the resource adapter includes one or more instances.
The AdminObject can be activated by selecting the 'Activate' checkbox.
The information about the resource adapter is generated using the following command:
./rar-info.sh myeis.rar
The report will contain information about
MANIFEST.MF
file
The tool (rar-info.sh
) is located in the doc/as/
directory of the
distribution.
The tool (converter.sh
) is located in the doc/as/
directory of the
distribution.
A resource adapter deployment is converted using the following command:
./converter.sh -ra old-ds.xml new-ra.xml
The IronJacamar embedded configuration provides a way of running a JCA container in-VM.
The configuration is useful when you want a
In order to enhance the experience with working with the embedded configuration the container integrates with the ShrinkWrap and Arquillian frameworks.
You will need all the JAR files located in the
$IRON_JACAMAR_HOME/bin $IRON_JACAMAR_HOME/lib $IRON_JACAMAR_HOME/lib/embedded
directories on your application class loader - f.ex.
java -classpath allthejarfiles.jar yourapp
in order to use the embedded configuration.
If you want integration with the Arquillian framework you need to add the JAR files located in the
$IRON_JACAMAR_HOME/lib/embedded/arquillian
The Arquillian/Byteman integration is located in the
$IRON_JACAMAR_HOME/lib/embedded/arquillian/byteman
java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Sample logging.properties
file:
# Additional logger names to configure (root logger is always configured) loggers=org.jboss.jca,org.jboss,org.jnp,com.arjuna # Root logger level logger.level=${iron.jacamar.log.level:INFO} logger.handlers=CONSOLE, FILE # org.jboss.jca logger.org.jboss.jca.level=DEBUG # org.jboss logger.org.jboss.level=INFO # org.jnp logger.org.jnp.level=INFO # com.arjuna logger.com.arjuna.level=INFO # Console handler configuration handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler handler.CONSOLE.properties=autoFlush handler.CONSOLE.level=${iron.jacamar.log.console.level:INFO} handler.CONSOLE.autoFlush=true handler.CONSOLE.formatter=PATTERN # File handler configuration handler.FILE=org.jboss.logmanager.handlers.FileHandler handler.FILE.level=${iron.jacamar.log.file.level:DEBUG} handler.FILE.properties=autoFlush,fileName handler.FILE.autoFlush=true handler.FILE.fileName=${test.dir}/embedded/test.log handler.FILE.formatter=PATTERN # Formatter pattern configuration formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter formatter.PATTERN.properties=pattern formatter.PATTERN.pattern=%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n
These files needs to be available to the application classloader.
The IronJacamar Embedded container environment supports the following open source testing projects:
These extensions allow the developer to use the embedded platform with greater ease as there doesn't have to be a physical representation of the resource adapter archive located to the disk.
The Arquillian integration furthermore allows the developer to leave all the embedded container setup to the integration layer instead.
See the Arquillian and ShrinkWrap web sites for a detailed description of the projects and additional documentation.
/*
* IronJacamar, a Java EE Connector Architecture implementation
* Copyright 2012, Red Hat Inc, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.jca.arquillian.unit;
import org.jboss.jca.arquillian.embedded.Configuration;
import org.jboss.jca.arquillian.rars.simple.TestConnection;
import org.jboss.jca.arquillian.rars.simple.TestConnectionFactory;
import org.jboss.jca.embedded.dsl.InputStreamDescriptor;
import java.util.UUID;
import javax.annotation.Resource;
import javax.resource.ResourceException;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.extension.byteman.api.BMRule;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.logging.Logger;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
import org.jboss.shrinkwrap.descriptor.api.Descriptor;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
/**
* Unit test for Byteman integration
*
* @author <a href="mailto:jesper.pedersen@ironjacamar.org">Jesper Pedersen</a>
*/
@RunWith(Arquillian.class)
@Configuration(autoActivate = false)
public class BytemanBMTestCase
{
// --------------------------------------------------------------------------------||
// Class Members ------------------------------------------------------------------||
// --------------------------------------------------------------------------------||
private static Logger log = Logger.getLogger(BytemanBMTestCase.class);
/**
* Define the deployment
* @return The deployment archive
*/
@Deployment(order = 1)
public static ResourceAdapterArchive createDeployment()
{
ResourceAdapterArchive raa =
ShrinkWrap.create(ResourceAdapterArchive.class, "byteman.rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID().toString() + ".jar");
ja.addPackage(TestConnection.class.getPackage());
raa.addAsLibrary(ja);
raa.addAsManifestResource("simple.rar/META-INF/ra.xml", "ra.xml");
return raa;
}
/**
* Define the activation
* @return The deployment archive
*/
@Deployment(order = 2)
public static Descriptor createDescriptor()
{
ClassLoader cl = BytemanBMTestCase.class.getClassLoader();
InputStreamDescriptor isd = new InputStreamDescriptor("byteman-ra.xml",
cl.getResourceAsStream("byteman-ra.xml"));
return isd;
}
//-------------------------------------------------------------------------------------||
// Tests ------------------------------------------------------------------------------||
//-------------------------------------------------------------------------------------||
@Resource(mappedName = "java:/eis/BytemanTest")
private TestConnectionFactory connectionFactory;
/**
* Byteman
* @exception Throwable Thrown if case of an error
*/
@Test
@BMRule(name = "Throw exception on allocateConnection",
targetClass = "org.jboss.jca.core.connectionmanager.AbstractConnectionManager",
targetMethod = "allocateConnection",
action = "throw new javax.resource.ResourceException()")
public void testByteman() throws Throwable
{
assertNotNull(connectionFactory);
TestConnection c = null;
try
{
c = connectionFactory.getConnection();
fail("Got a connection");
}
catch (ResourceException re)
{
// Ok
}
catch (Throwable t)
{
fail(t.getMessage());
throw t;
}
finally
{
if (c != null)
c.close();
}
}
}
See the Byteman web site for a detailed description of the project and additional documentation.
import org.jboss.jca.embedded.Embedded;
import javax.naming.Context;
import org.jboss.arquillian.test.api.ArquillianResource;
@RunWith(Arquillian.class)
public class ResourceProviderTestCase
{
@ArquillianResource
private Embedded embedded;
@ArquillianResource
private Context context;
This will allow direct access to the APIs inside the test case.
import org.jboss.jca.embedded.Embedded;
import org.jboss.jca.embedded.EmbeddedFactory;
import java.net.URL;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
public class MyTestCase
{
/** Embedded */
private static Embedded embedded;
/** JNDI prefix */
private static final String JNDI_PREFIX = "java:/eis/";
/**
* Simple test to verify deployment of myresourceadapter.rar
* @throws Throwable throwable exception
*/
@Test
public void testDeployment() throws Throwable
{
URL archive = MyTestCase.class.getResource("myresourceadapter.rar");
Context context = null;
try
{
embedded.deploy(archive);
context = new InitialContext();
Object o = context.lookup(JNDI_PREFIX + "myresourceadapter");
assertNotNull(o);
}
catch (Throwable t)
{
fail(t.getMessage());
}
finally
{
embedded.undeploy(archive);
if (context != null)
{
try
{
context.close();
}
catch (NamingException ne)
{
// Ignore
}
}
}
}
@BeforeClass
public static void beforeClass() throws Throwable
{
// Create an embedded JCA instance
embedded = EmbeddedFactory.create();
// Startup
embedded.startup();
}
@AfterClass
public static void afterClass() throws Throwable
{
// Shutdown
embedded.shutdown();
}
}
.rar
extension
- either representing a file or a directory.See the IronJacamar Embedded API documentation for additional functionality.
This done by using the following code snippet
import org.jboss.jca.deployers.fungal.RAActivator;
// Disable RAActivator
RAActivator raa = embedded.lookup("RAActivator", RAActivator.class);
if (raa == null)
throw new IllegalStateException("RAActivator not defined");
raa.setEnabled(false);
embedded.deploy("myrar.rar");
embedded.deploy("myrar-ra.xml");
raa.setEnabled(true);
which disables the bean, does the deployments and then reenables the bean again.
Testing an Enterprise Information System can be a complex task, as their installation can quite complex and specific to a certain platform architecture.
As Java developers, and resource adapter developers in particularly, we are interested in a setup that will allow us to test the resource adapter against the EIS with as little difficulty as possible.
Having access to a component that easy integrates into our testing environment, and acts as the EIS in question is of benefit.
The EIS test server contains the following interface
/*
* IronJacamar, a Java EE Connector Architecture implementation
* Copyright 2012, Red Hat Inc, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.jca.test.eis;
import java.io.InputStream;
import java.io.OutputStream;
/**
* This interface represents a session between a resource adapter
* and an Enterprise Information System
*
* Once the <code>handle</code> method returns the socket where
* the communication takes place is closed
*
* @author <a href="mailto:jesper.pedersen@ironjacamar.org">Jesper Pedersen</a>
*/
public interface Handler
{
/**
* Handle an interaction with a client
* @param is The input stream
* @param os The output stream
*/
public void handle(InputStream is, OutputStream os);
}
which represents a session between the resource adapter and the EIS.
Once the method returns the socket between the resource adapter and the EIS is closed.
The Apache Ant tasks for starting and stopping the EIS test server are defined as the following
<taskdef name="start" classname="org.jboss.jca.test.eis.ant.Start" classpathref="main.lib.path.id"/> <taskdef name="stop" classname="org.jboss.jca.test.eis.ant.Stop" classpathref="main.lib.path.id"/>
where main.lib.path.id
contains the ironjacamar-test-eis.jar
file.
<start host="localhost" port="1400" handler="org.jboss.jca.test.eis.EchoHandler"> <classpath> <pathelement location="${build.eis.dir}/test"/> </classpath> </start>
<stop host="localhost" port="1400"/>
which stops the EIS test server on localhost
using port 1400
.
Between the start
and stop
tasks the resource adapters unit tests
can be executed.
The Apache Maven mojos for starting and stopping the EIS test server are defined as the following
<build> <plugins> <plugin> <groupId>org.jboss.ironjacamar</groupId> <artifactId>ironjacamar-test-eis</artifactId> <!-- The version of the plugin you want to use --> <version>1.2.0.Final</version> <executions> <execution> <goals> <goal>start</goal> </goals> </execution> </executions> <configuration> <host>localhost</host> <port>1400</port> <handler>org.jboss.jca.test.eis.EchoHandler</handler> <classpath> <param>target/test-classes</param> </classpath> </configuration> </plugin> <plugin> <groupId>org.jboss.ironjacamar</groupId> <artifactId>ironjacamar-test-eis</artifactId> <!-- The version of the plugin you want to use --> <version>1.2.0.Final</version> <executions> <execution> <goals> <goal>stop</goal> </goals> </execution> </executions> <configuration> <host>localhost</host> <port>1400</port> </configuration> </plugin> </plugins> </build>
The user forum is where we discuss matters about the usage of the IronJacamar project.
Our forum is located at http://community.jboss.org/en/ironjacamar
User questions doesn't belong here - they should go in the user forum instead.
The forum is located at http://community.jboss.org/en/ironjacamar/dev
If you think you have found a bug you should verify this by posting to our forum first.
Our forum is located at http://community.jboss.org/en/ironjacamar
You can also search our issue tracking system located at http://issues.jboss.org/browse/JBJCA
All the IronJacamar schemas are deployed under http://www.ironjacamar.org/schema/.
The datasource schema can found at http://www.ironjacamar.org/schema/datasources_1_0.xsd.
All licenses can be found in the doc/licenses
directory.
GNU LESSER GENERAL PUBLIC LICENSE
You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
The modified work must itself be a software library.
You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
However, linking a “work that uses the Library” with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a “work that uses the library”. The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
When a “work that uses the Library” uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable “work that uses the Library”, as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
For an executable, the required form of the “work that uses the Library” must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.