www.ironjacamar.orgCommunity Documentation

IronJacamar 1.2 User's Guide

Connecting your Enterprise Information Systems


To all Java EE Connector Architecture users, and especially the IronJacamar community

Table of Contents

Preface
1. About IronJacamar
2. Why IronJacamar ?
3. Versions
3.1. IronJacamar 1.2
3.2. IronJacamar 1.1
3.3. IronJacamar 1.0
4. The team
5. Thanks to
6. License
1. Introduction
1.1. What's New
1.1.1. Java Connector Architecture 1.7
1.1.2. Java Connector Architecture 1.6
1.2. Overview
1.2.1. Outbound resource adapter
1.2.2. Inbound resource adapter
2. Download
2.1. Download
2.2. Maven repository
2.3. Git Access
3. Installation
3.1. Compressed Tape Archive (.tar.gz)
3.2. Zip Archive (.zip)
3.3. Directory structure
3.4. WildFly
4. Configuration
4.1. IronJacamar server
4.1.1. Using the leak detector pool
4.1.2. Allow obtaining connections during MARKED_FOR_ROLLBACK
4.1.3. Disable enlistment trace
4.1.4. Disable delistResource calls
4.1.5. Disable setRollbackOnly calls
4.2. Logging service
4.3. Transaction service
4.4. JCA
4.4.1. Deployer
4.4.2. Work manager
4.4.3. Security
4.5. Datasources
4.6. Web server
5. Deployment
5.1. Packaging requirements
5.2. Deploying resource adapters
5.2.1. Resource adapter descriptor
5.2.2. Resource adapter extensions
5.2.3. Resource adapter statistics
5.3. Deploying datasources
5.3.1. Datasource descriptor
5.3.2. Datasource extensions
5.3.3. Datasource statistics
5.4. General deployment settings
5.4.1. Flush strategies
5.4.2. Capacity policies
6. Running
6.1. Starting the container
6.2. Stopping the container
6.3. Command line interface
6.3.1. Deploy
6.3.2. Undeploy
6.3.3. Shutdown
6.4. Apache Ant
6.4.1. Start
6.4.2. Stop
6.4.3. Deploy
6.4.4. Undeploy
6.4.5. Ping
6.5. Apache Maven
6.5.1. Start
6.5.2. Stop
6.5.3. Deploy
6.5.4. Undeploy
6.5.5. Ping
7. Validator
7.1. Introduction
7.2. Reports
7.3. Running the standalone validator
7.4. Apache Ant integration
7.4.1. Usage
7.5. Apache Maven integration
7.5.1. Usage
8. Code generator
8.1. Introduction
8.2. Functionality
8.3. Running the tool
8.3.1. Developer Input
8.4. Generated code
8.4.1. Apache Ant build environment
8.4.2. Apache Ant + Ivy build environment
8.4.3. Gradle build environment
8.4.4. Apache Maven build environment
9. Eclipse plugin
9.1. Installation of the plugin
9.2. Configuration of the plugin
9.3. The toolbar
9.4. The menu
9.5. Creating a new IronJacamar project
9.5.1. Project and package name
9.5.2. Creating a ResourceAdapter
9.5.3. Creating a ManagedConnectionFactory
9.5.4. Creating a MessageListener
9.5.5. Creating an AdminObject
9.5.6. Selecting the build environment
9.6. Validate IronJacamar project
9.7. Deploying an IronJacamar project
9.7.1. Deploying a RAR file to an IronJacamar server
9.7.2. Generate the -ra.xml and deploy it to IronJacamar server
10. Other tools
10.1. Resource adapter information tool
10.2. Migration tool
10.2.1. Resource adapters
10.2.2. Data sources
10.3. Tracer tool
11. Embedded
11.1. Overview
11.2. Configuration
11.3. Usage
11.3.1. Simple usage
11.3.2. Advanced usage
12. EIS test server
12.1. Overview
12.2. Apache Ant
12.3. Apache Maven
13. Community
13.1. Website
13.2. User forum
13.3. Developer forum
13.4. Issue tracking
14. Troubleshooting
14.1. I think I have found a bug
14.2. I would like to implement a feature
14.3. How do I ?
A. Schemas
A.1. Java EE Connector Architecture 1.7
A.2. Java EE Connector Architecture 1.6
A.3. Java EE Connector Architecture 1.5
A.4. Java EE Connector Architecture 1.0
A.5. IronJacamar 1.0
A.6. IronJacamar 1.1
A.7. IronJacamar 1.2
A.8. Resource adapters 1.0
A.9. Resource adapters 1.1
A.10. Resource adapters 1.2
A.11. Datasources 1.0
A.12. Datasources 1.1
A.13. Datasources 1.2
A.14. Datasources 1.3
B. Samples
B.1. HelloWorld example
B.1.1. Introduction
B.1.2. HelloWorld Resource Adapter
B.1.3. HelloWorld Managed Connection Factory
B.1.4. HelloWorld Managed Connection
B.1.5. HelloWorld Connection Factory
B.1.6. HelloWorld Connection Factory Implementation
B.1.7. HelloWorld Connection
B.1.8. HelloWorld Connection Implementation
B.1.9. HelloWorld Managed Connection MetaData
B.1.10. HelloWorld ironjacamar.xml
B.1.11. HelloWorld Connection Test Case
B.1.12. HelloWorld Ant build.xml
B.2. HelloWorld/Native example
B.2.1. Introduction
B.2.2. HelloWorld/Native Resource Adapter
B.2.3. HelloWorld/Native Managed Connection Factory
B.2.4. HelloWorld/Native Managed Connection
B.2.5. HelloWorld/Native Connection Factory
B.2.6. HelloWorld/Native Connection Factory Implementation
B.2.7. HelloWorld/Native Connection
B.2.8. HelloWorld/Native Connection Implementation
B.2.9. HelloWorld/Native Managed Connection MetaData
B.2.10. HelloWorld/Native ironjacamar.xml
B.2.11. HelloWorld/Native C
B.2.12. HelloWorld/Native Connection Test Case
B.2.13. HelloWorld/Native Ant build.xml
B.2.14. HelloWorld/Native cmake
B.3. HelloWorld/Lazy example
B.3.1. Introduction
B.3.2. HelloWorld/Lazy Resource Adapter
B.3.3. HelloWorld/Lazy Managed Connection Factory
B.3.4. HelloWorld/Lazy Managed Connection
B.3.5. HelloWorld/Lazy Connection Factory
B.3.6. HelloWorld/Lazy Connection Factory Implementation
B.3.7. HelloWorld/Lazy Connection
B.3.8. HelloWorld/Lazy Connection Implementation
B.3.9. HelloWorld/Lazy Managed Connection MetaData
B.3.10. HelloWorld/Lazy ironjacamar.xml
B.3.11. HelloWorld/Lazy Connection Test Case
B.3.12. HelloWorld/Lazy Ant build.xml
C. Datasources
C.1. PosgreSQL
C.2. PosgreSQL XA
C.3. MySQL
C.4. MySQL XA
C.5. H2
C.6. H2 XA
C.7. Derby
C.8. Derby XA
C.9. Oracle
C.10. Oracle XA
C.11. Microsoft SQLServer
C.12. Microsoft SQLServer XA
C.13. IBM DB2
C.14. IBM DB2 XA
D. Logging codes
D.1. Core: 000000 - 009999
D.2. Common: 010000 - 019999
D.3. Deployers: 020000 - 029999
D.4. Adapters: 030000 - 039999
E. Licenses
E.1. GNU Lesser General Public License 2.1
E.1.1. Preamble
E.1.2. Terms and Conditions for Copying, Distribution and Modification
E.1.3. How to Apply These Terms to Your New Libraries
E.2. Creative Commons Attribution–Share Alike 3.0 Unported License
E.2.1. Definitions
E.2.2. Fair Dealing Rights
E.2.3. License Grant
E.2.4. Restrictions
E.2.5. Representations, Warranties and Disclaimer
E.2.6. Termination
E.2.7. Miscellaneous
E.3. Apache License, Version 2.0
E.3.1. Definitions
E.3.2. Grant of Copyright License
E.3.3. Grant of Patent License
E.3.4. Redistribution
E.3.5. Submission of Contributions
E.3.6. Trademarks
E.3.7. Disclaimer of Warranty
E.3.8. Limitation of Liability
E.3.9. Accepting Warranty or Additional Liability

List of Tables

2.1. Maven artifacts
4.1. IronJacamar options
4.2. Resource adapter deployer configuration
4.3. Resource adapter deployer
4.4. Resource adapter metadata deployer
4.5. Resource adapter activator
4.6. DsXmlDeployer
4.7. Web server
5.1. Main elements
5.2. Bean validation groups elements
5.3. Connection definition / admin object attributes
5.4. Connection definition elements
5.5. Pool elements
5.6. XA pool elements
5.7. Security elements
5.8. Time out elements
5.9. Validation elements
5.10. Admin object elements
5.11. Recovery elements
5.12. Core statistics
5.13. Common datasource attributes
5.14. datasource elements
5.15. xa-datasource elements
5.16. Pool settings
5.17. XA pool settings
5.18. Security settings
5.19. Validation settings
5.20. Time out settings
5.21. Statement settings
5.22. Recovery elements
5.23. Driver attributes
5.24. Driver elements
5.25. Core statistics
5.26. JDBC statistics
5.27. Flush strategies
5.28. Size policy properties
5.29. Watermark policy properties
5.30. Size policy properties
5.31. Watermark policy properties
7.1. Validator report
7.2. Apache Ant: validator
7.3. Apache Maven: validator
8.1. Code generator arguments
8.2. Developer input
8.3. Apache Ant build environment
8.4. Apache Ant + Ivy build environment
8.5. Gradle build environment
8.6. Apache Maven build environment
D.1. Logging codes for core
D.2. Logging codes for common
D.3. Logging codes for deployers
D.4. Logging codes for adapters

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.

Copyright © 2014 Red Hat, Inc. and others.

The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA").

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 EE Connector Architecture features three different types of resource adapters

For more information about Java EE Connector Architecture see the specification.

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

  • Major: The major version number. Signifies major changes in the implementation.
  • Minor: The minor version number. Signifies functional changes to a major version.
  • Patch: The patch version number. Signifies a binary compatible change to a minor version.
  • Identifier: The identifier. Identifies the level of the quality of the release.
    • Final: Stable release
    • CR: Candidate for Release quality. The implementation is functional complete.
    • Beta: Beta quality. The implementation is almost functional complete.
    • Alpha: Alpha quality. The implementation is a snapshot of the development.

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.

The configuration for the IronJacamar container is mainly located under the config/ directory.

The IronJacamar server can be configured by including an ironjacamar.properties file next to the ironjacamar-sjc.jar in the bin/ directory.

This file will allow to override the core options given to the kernel environment, if multiple instances of the IronJacamar container are going to run on the same machine, and network interface.

The options available


An example of an ironjacamar.properties file:

remote.access=true
remote.port=1302
        

The IronJacamar deployer is configured in the

config/bootstrap/jca.xml
        

file.

The configuration of the resource adapter deployer chain is handled by a org.jboss.jca.deployers.fungal.RAConfiguration bean.




<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>
 
          

Table 4.2. Resource adapter deployer configuration

PropertyTypeDescription
ArchiveValidationboolean Toggle archive validation for the deployment units.

Default: true

ArchiveValidation​FailOnWarnboolean Should an archive validation warning report fail the deployment.

Default: false

ArchiveValidation​FailOnErrorboolean Should an archive validation error report fail the deployment.

Default: true

BeanValidationboolean Toggle bean validation (JSR-303) for the deployment units.

Default: true

DefaultBootstrap​Contextorg.jboss.jca.​core.api.bootstrap.​CloneableBootstrap​Context Specifies the default bootstrap context for resource adapters
BootstrapContextsMap<String, ​org.jboss.jca.​core.api.bootstrap.​CloneableBootstrap​Context> Bootstrap context map (unique name to a cloneable bootstrap context) which allows developers to bind (through ironjacamar.xml) their resource adapter to a specific bootstrap context instance.
PrintStreamjava.io.PrintStream Specifies which print stream that should be used to handle the LogWriters
MetadataRepositoryorg.jboss.jca.​core.spi.mdr.​MetadataRepository The metadata repository
ResourceAdapterRepositoryorg.jboss.jca.​core.spi.rar.​ResourceAdapterRepository The resource adapter repository
ScopeDeploymentboolean Should each deployment be scoped (isolated) from the container. This feature allows deployment of libraries of a different version than used in the container environment.

Default: false

JndiStrategyorg.jboss.jca.​core.spi.naming.​JndiStrategy Specifies the JNDI strategy policy for binding the connection factories into the naming environment

The JNDI strategies are located in the org.jboss.jca.core.naming package

  • NoopJndiStrategy: A no operation JNDI strategy which doesn't bind/unbind any objects
  • SimpleJndiStrategy: A simple JNDI strategy which can bind/unbind a single connection factory
  • ExplicitJndiStrategy: A JNDI strategy which can requires explicit JNDI names to bind/unbind a connection factory

IronJacamar features a standard work manager on its default setup using one thread pool for short running jobs, and one thread pool for long running jobs identified by the HintsContext.LONGRUNNING_HINT with a value of true.

The configuration of the work manager and the necessary components can be viewed in the jca.xml file.

A distributed work manager is a work manager instance, which is able to reschedule work execution on another work manager instance on the network.

The distributed work manager has three additional components

to control the distribution process.

Supported policies

Supported selectors

Supported transports

Below is an example of a socket based configuration where two instances localhost:1299 and localhost:1300 communicates, taken from the IronJacamar test suite.



<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 IronJacamar distribution contains a deploy/ directory where all deployments should be deployed to.

Resource adapters (.rar) are deployed by copying the resource adapter into the deploy/ directory

cp example.rar ironjacamar-1.2.0.Final/deploy
     

on a Un*x based system or

copy example.rar ironjacamar-1.2.0.Final\deploy
     

on Windows.

The resource adapter can be configured and activated through a META-INF/ironjacamar.xml file in the archive. The format of the XML document is defined by the ironjacamar_1_0.xsd, ironjacamar_1_1.xsd or ironjacamar_1_2.xsd schemas.

A resource adapter can also be configured and activated through deployment of a -ra.xml file in the deploy/ directory - f.ex. deploy/example-ra.xml. The format of the XML document is defined by the resource-adapters_1_0.xsd, resource-adapters_1_1.xsd or resource-adapters_1_2.xsd schemas - f.ex




<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.

Alternative the resource adapter deployments will be picked up by the RAActivator bean which bind a single connection factory under

java:/eis/<deploymentName>
     

- f.ex. java:/eis/example and a single admin object under

java:/eis/ao/<deploymentName>
     

- f.ex. java:/eis/ao/example.

A resource adapter can be configured using two different ways

to the resource adapter archive. Both formats share the same layout to ease configuration - only the top-level elements differ.






Table 5.6. XA pool elements

ElementDesciption
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






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.

A resource adapter can make use of a couple of Java EE Connector Architecture extensions in the IronJacamar container in order to improve the integration.

The extensions include

The following sections will describe these extensions points.

The IronJacamar recovery extension allows the resource adapter deployment to give feedback to the container if a ManagedConnection can be used for recovery. This extension is used as part of XA recovery in the environment, and should therefore be implemented by all resource adapters capable of working in an XATransaction semantics.

The interface org.jboss.core.spi.recovery.RecoveryPlugin located in the ironjacamar-core-api artifact makes up the SPI for the extension.

The interface contains two methods that should be implemented in a resource adapter specific manner.

The method

public boolean isValid(Object c) throws ResourceException;
            

will return true if the connection can be used for recovery.

The method

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

Resource adapter deployments has the following core statistics values

Table 5.12. Core statistics

NameDesciption
ActiveCount The number of active connections. Each of the connections is either in use by an application or available in the pool
AvailableCount The number of available connections in the pool
AverageBlockingTime The average time spent blocking on obtaining an exclusive lock on the pool. The value is in milliseconds
AverageCreationTime The average time spent creating a connection. The value is in milliseconds
AverageGetTime The average time spent obtaining a connection. The value is in milliseconds
BlockingFailureCount The number of times where there was a time out getting an exclusive lock on the pool
CreatedCount The number of connections created
DestroyedCount The number of connections destroyed
IdleCount The number of connections currently idle
InUseCount The number of connections currently in use
MaxCreationTime The maximum time it took to create a connection. The value is in milliseconds
MaxGetTime The maximum time it took to obtain a connection. The value is in milliseconds
MaxUsedCount The maximum number of connections used
MaxWaitCount The maximum number of requests waiting for a connection at the same time
MaxWaitTime The maximum time spent waiting for an exclusive lock on the pool
TimedOut The number of timed out connections
TotalBlockingTime The total time spent waiting for an exclusive lock on the pool. The value is in milliseconds
TotalCreationTime The total time spent creating connections. The value is in milliseconds
TotalGetTime The total time spent obtaining connections. The value is in milliseconds
WaitCount The number of requests that had to wait for a 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
      

on a Un*x based system or

copy postgres-xa-ds.xml ironjacamar-1.2.0.Final\deploy
      

on Windows.

You will need to install the database JDBC driver into the lib/ directory.

You can find examples of datasource definitions in the doc/datasources directory and the schemas: doc/datasources_1_0.xsd, doc/datasources_1_1.xsd, doc/datasources_1_2.xsd and doc/datasources_1_3.xsd.

Datasource descriptors are divided into

definitions.

A datasource descriptor supports the following parameters.


Table 5.14. datasource elements

ElementDesciption
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

ElementDesciption
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

ElementDesciption
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

ElementDesciption
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.19. Validation settings

ElementDesciption
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

ElementDesciption
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





The datasource deployments can make use of a couple of extensions in the JDBC resource adapter to improve the connection validation and checking if an exception should reestablish the connection in question.

The extensions include

Configuration of the extensions are done by using

IronJacamar features implementations of these extensions for a couple of popular databases. Contributions in this area are most welcome either generic solutions or for a specific database.

Informix:

Microsoft SQLServer:

PostgreSQL:

MySQL:

IBM DB2:

Generic:

Sybase:

Oracle:

Datasources has the following core statistics values

Table 5.25. Core statistics

NameDesciption
ActiveCount The number of active connections. Each of the connections is either in use by an application or available in the pool
AvailableCount The number of available connections in the pool
AverageBlockingTime The average time spent blocking on obtaining an exclusive lock on the pool. The value is in milliseconds
AverageCreationTime The average time spent creating a connection. The value is in milliseconds
AverageGetTime The average time spent obtaining a connection. The value is in milliseconds
BlockingFailureCount The number of times where there was a time out getting an exclusive lock on the pool
CreatedCount The number of connections created
DestroyedCount The number of connections destroyed
IdleCount The number of connections currently idle
InUseCount The number of connections currently in use
MaxCreationTime The maximum time it took to create a connection. The value is in milliseconds
MaxGetTime The maximum time it took to obtain a connection. The value is in milliseconds
MaxUsedCount The maximum number of connections used
MaxWaitCount The maximum number of requests waiting for a connection at the same time
MaxWaitTime The maximum time spent waiting for an exclusive lock on the pool
TimedOut The number of timed out connections
TotalBlockingTime The total time spent waiting for an exclusive lock on the pool. The value is in milliseconds
TotalCreationTime The total time spent creating connections. The value is in milliseconds
TotalGetTime The total time spent obtaining connections. The value is in milliseconds
WaitCount The number of requests that had to wait for a connection


Datasources has the following JDBC statistics values


This section will provide an overview of general deployment settings that are shared between resource adapter activations, and datasource deployments.

The policy for creating and destroying physical connections for a pool can be controlled by specifying which policy that should be used.

The default policies are only to create one connection per request, and to destroy all connections timed out when the idle timeout is scheduled.

The following decrement policies are supported.

The validator integrates with Apache Maven such that you can generate the reports directly from your build environment before deploying the resoruce adapter into the IronJacamar container.

To be able to use the validator plugin in your Maven project, you will have to add the following plugin declaration in the pom.xml of your project:




<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.

This section describes the questions that are asked in order to generate the code.

Table 8.2. Developer input

QuestionSpecDesciptionType
Profile version (1.7/1.6/1.5/1.0) All Defines which Java EE Connector Architecture specification that the resource adapter should target  
Type (O/Outbound/I/Inbound/B/Bidirectional) JCA 1.5+ Defines if the resource adapter should contain outbound communication., inbound communication or both  
Package name All The package name of the resource adapter  
Transaction support (N/NoTransaction/L/LocalTransaction/X/XATransaction) All The transaction support level  
Reauthentication (Y/Yes/N/No) All If the resource adapter supports reauthentication  
Use annotations (Y/Yes/N/No) JCA 1.6+ Should annotations be used for specifying the structure. If 'No' is selected a META-INF/ra.xml is generated  
Include a ResourceAdapter (Y/Yes/N/No) JCA 1.5+ Should an instance of a resource adapter class be included in the archive Outbound
Resource adapter class name JCA 1.5+ The class name of the resource adapter Outbound or Bidirectional
Should the resource adapter class be Serializable (Y/Yes/N/No) JCA 1.5+ Should the resource adapter class be serializable Outbound
Managed connection factory class name All The class name of the managed connection factory Outbound or Bidirectional
Managed connection class name All The class name of the managed connection Outbound or Bidirectional
Connection interface class name All The class name of the connection interface Outbound or Bidirectional
Connection implementation class name All The class name of the connection implementation Outbound or Bidirectional
Connection factory interface class name All The class name of the connection factory interface Outbound or Bidirectional
Connection factory implementation class name All The class name of the connection factory implementation Outbound or Bidirectional
Resource adapter config properties All Include a configuration properties in the resource adapter instance Outbound or Bidirectional
Managed connection factory config properties All Include a configuration properties in the managed connection factory instance Outbound or Bidirectional
Use ResourceAdapterAssociation (Y/Yes/N/No) All Associate the managed connection factory instance with the resource adapter instance Outbound or Bidirectional
Use CCI (Y/Yes/N/No) All Use the Common Client Interface for the connection / connection factory in the 'Outbound' part of the resource adapter Outbound or Bidirectional
MessageListener interface name JCA 1.5+ The name of the message listener interface for the activation Inbound or Bidirectional
ActivationSpec class name JCA 1.5+ The class name of the activation specification instance Inbound or Bidirectional
ActivationSpec config properties JCA 1.5+ Include configuration properties in the activation specification instance Inbound or Bidirectional
Activation class name JCA 1.5+ The class name of the activation instance Inbound or Bidirectional
Add methods to connection interface (Y/Yes/N/No) [N]: All Use for add methods to connection interface Outbound or Bidirectional
Include an admin object (Y/Yes/N/No) JCA 1.5+ Should an admin object be added to the project  
Use ResourceAdapterAssociation on admin object(Y/Yes/N/No) JCA 1.5 Associate the admin object instance with the resource adapter instance  
Admin object interface name JCA 1.5+ The interface name of the admin object  
Admin object class name JCA 1.5+ The class name of the admin object  
Admin object config properties JCA 1.5 Include a configuration properties in the admin object instance  
Generate a MBean class (Y/Yes/N/No) All Generate a MBean for the resource adapter  
Integrate EIS test server (Y/Yes/N/No) All Should the IronJacamar test EIS server be integrated  
Use JBoss Logging (Y/Yes/N/No) [N]: All Use JBoss Logging instead of Java Util Logging  
Build environment [A/Ant/I/Ant+Ivy/M/Maven/G/Gradle] All Type of build environment  

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

  • Generate a resource adapter skeleton
  • Generate a deployment descriptor for a resource adapter
  • Validate a resource adapter
  • Deploy a resource adapter to an IronJacamar server instance
  • Deploy a deployment descriptor to an IronJacamar server instance

A new IronJacamar project can be created by selecting File->New->Project... and go to the IronJacamar category.

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.

Select the IronJacamar project you just created. The Deploy drop down command in the toolbar will be enabled. Click on the command and select 'Deploy -ra.xml'.

Another way to generate the -ra.xml file is to right click on the project, and select IronJacamar->Deploy->Deploy -ra.xml from context menu.

The command will build the RAR file first if it does not exist, then pop up a wizard to generate the -ra.xml according to the RAR file.

In the first wizard page, selects version of the resource adapter. Some configurations may not be available when version is changed.

In the general information page, set up the transaction support, bootstrap context, bean validation groups and id if the version is 1.1+.

From IronJacamar 1.1, a workmanager tab is added to configure workmanager security mappings.

There is a wizard page for each ManagedConnectionFactory if the resource adapter is outbound or bidirectional.

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.

From IronJacamar 1.1 on, a capacity sub tab is added in 'pool configuration' tab to configure policy of connection pool

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.

There is a miscellaneous page also.

If the Deploy RAR first option is selected, the plugin will try to deploy the RAR file to the IronJacamar server first, then deploy the generated -ra.xml file.

The IronJacamar distribution features a migration tool, that can convert the deployment format used in JBoss Application Server prior to version 7, and JBoss Enterprise Application Platform versions prior to version 6.

Since there are different formats (XSDs) to deploy datasources and a resource adapters the tool can convert to both these formats.

The tool (converter.sh) is located in the doc/as/ directory of the distribution.

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
      

directory as well.

The Arquillian/Byteman integration is located in the

$IRON_JACAMAR_HOME/lib/embedded/arquillian/byteman
      

directory.

Furthermore you will need to configure Java Naming and Directory Interface (JNDI) and logging using for example property files.

Sample jndi.properties file:

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.

IronJacamar Embedded supports both a simple and an advanced usage model, using pre-assembled resource adapter archives (.rar) or dynamic resource adapter archives based on ShrinkWrap.

The embedded environment supports registering resource adapters and datasources in the platform MBeanServer by setting the system property ironjacamar.embedded.management to true before starting the environment.

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.

The code sample below shows an usage of deploying a ShrinkWrap resource adapter archive into the IronJacamar Embedded environment using Arquillian.



/*
 * 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 java.util.UUID;
import javax.annotation.Resource;
import org.jboss.arquillian.container.test.api.Deployment;
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.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertNotNull;
/**
 * Unit test for Arquillian integration
 * 
 * @author <a href="mailto:jesper.pedersen@ironjacamar.org">Jesper Pedersen</a>
 */
@RunWith(Arquillian.class)
@Configuration(autoActivate = true)
public class ArquillianTestCase
{
   // --------------------------------------------------------------------------------||
   // Class Members ------------------------------------------------------------------||
   // --------------------------------------------------------------------------------||
   private static Logger log = Logger.getLogger(ArquillianTestCase.class);
   private static String deploymentName = "ArquillianTest";
   /**
    * Define the deployment
    * @return The deployment archive
    */
   @Deployment
   public static ResourceAdapterArchive createDeployment()
   {
      ResourceAdapterArchive raa =
         ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName + ".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;
   }
   //-------------------------------------------------------------------------------------||
   // Tests ------------------------------------------------------------------------------||
   //-------------------------------------------------------------------------------------||
   @Resource(mappedName = "java:/eis/ArquillianTest")
   private TestConnectionFactory connectionFactory;
   
   /**
    * Basic
    * @exception Throwable Thrown if case of an error
    */
   @Test
   public void testBasic() throws Throwable
   {
      assertNotNull(connectionFactory);
      TestConnection c = connectionFactory.getConnection();
      assertNotNull(c);
      c.callMe();
      c.close();
   }
}
          

The class makes use of the org.jboss.jca.embedded.arquillian.Configuration annotation in order to specify that the deployed archive should be auto activated through the RAActivator bean.

The code sample below shows how to use Arquillian to deploy a ShrinkWrap resource adapter archive and activate the resource adapter using the ShrinkWrap/Descriptors API.

This example uses the org.jboss.jca.embedded.arquillian.Configuration annotation to explicit say not to auto activate the resource adapter archive.



/*
 * 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.embedded.unit;
import org.jboss.jca.arquillian.embedded.Configuration;
import org.jboss.jca.embedded.dsl.resourceadapters11.api.ConnectionDefinitionsType;
import org.jboss.jca.embedded.dsl.resourceadapters11.api.ResourceAdapterType;
import org.jboss.jca.embedded.dsl.resourceadapters11.api.ResourceAdaptersDescriptor;
import org.jboss.jca.embedded.rars.simple.TestConnection;
import org.jboss.jca.embedded.rars.simple.TestConnectionFactory;
import org.jboss.jca.embedded.rars.simple.TestConnectionFactoryImpl;
import org.jboss.jca.embedded.rars.simple.TestConnectionImpl;
import org.jboss.jca.embedded.rars.simple.TestManagedConnectionFactory;
import org.jboss.jca.embedded.rars.simple.TestResourceAdapter;
import java.util.UUID;
import javax.annotation.Resource;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.logging.Logger;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
import org.jboss.shrinkwrap.descriptor.api.Descriptors;
import org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor;
import org.jboss.shrinkwrap.descriptor.api.connector15.OutboundResourceadapterType;
import org.jboss.shrinkwrap.descriptor.api.connector15.ResourceadapterType;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertNotNull;
/**
 * Unit test for ShrinkWrap/Descriptors integration
 * 
 * @author <a href="mailto:jesper.pedersen@ironjacamar.org">Jesper Pedersen</a>
 */
@RunWith(Arquillian.class)
@Configuration(autoActivate = false)
public class ShrinkWrapDescriptorsTestCase
{
   // --------------------------------------------------------------------------------||
   // Class Members ------------------------------------------------------------------||
   // --------------------------------------------------------------------------------||
   private static Logger log = Logger.getLogger(ShrinkWrapDescriptorsTestCase.class);
   private static String deploymentName = "sd.rar";
   /**
    * Define the resource adapter archive
    * @return The archive
    */
   @Deployment(order = 1)
   public static ResourceAdapterArchive createArchive()
   {
      ConnectorDescriptor raXml = Descriptors.create(ConnectorDescriptor.class, "ra.xml")
         .version("1.5");
      ResourceadapterType rt = raXml.getOrCreateResourceadapter()
         .resourceadapterClass(TestResourceAdapter.class.getName());
      OutboundResourceadapterType ort = rt.getOrCreateOutboundResourceadapter()
         .transactionSupport("NoTransaction").reauthenticationSupport(false);
      org.jboss.shrinkwrap.descriptor.api.connector15.ConnectionDefinitionType cdt =
         ort.createConnectionDefinition()
            .managedconnectionfactoryClass(TestManagedConnectionFactory.class.getName())
            .connectionfactoryInterface(TestConnectionFactory.class.getName())
            .connectionfactoryImplClass(TestConnectionFactoryImpl.class.getName())
            .connectionInterface(TestConnection.class.getName())
            .connectionImplClass(TestConnectionImpl.class.getName());
      ResourceAdapterArchive raa =
         ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName);
      JavaArchive ja = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID().toString() + ".jar");
      ja.addPackage(TestConnection.class.getPackage());
      raa.addAsLibrary(ja);
      raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml");
      return raa;
   }
   /**
    * Define the deployment descriptor
    * @return The descriptor
    */
   @Deployment(order = 2)
   public static ResourceAdaptersDescriptor createDeployment()
   {
      ResourceAdaptersDescriptor dashRaXml = Descriptors.create(ResourceAdaptersDescriptor.class, "sd-ra.xml");
      ResourceAdapterType rt = dashRaXml.createResourceAdapter().archive(deploymentName);
      ConnectionDefinitionsType cdst = rt.getOrCreateConnectionDefinitions();
      org.jboss.jca.embedded.dsl.resourceadapters11.api.ConnectionDefinitionType cdt =
         cdst.createConnectionDefinition()
            .className(TestManagedConnectionFactory.class.getName())
            .jndiName("java:/eis/TestConnectionFactory").poolName("TestConnectionFactory");
      return dashRaXml;
   }
   //-------------------------------------------------------------------------------------||
   // Tests ------------------------------------------------------------------------------||
   //-------------------------------------------------------------------------------------||
   @Resource(mappedName = "java:/eis/TestConnectionFactory")
   private TestConnectionFactory connectionFactory;
   
   /**
    * Basic
    * @exception Throwable Thrown if case of an error
    */
   @Test
   public void testBasic() throws Throwable
   {
      assertNotNull(connectionFactory);
      TestConnection c = connectionFactory.getConnection();
      assertNotNull(c);
      c.callMe();
      c.close();
   }
}
          

The code sample below shows how to use Arquillian to deploy a ShrinkWrap resource adapter archive and change the allocateConnection of org.jboss.jca.core.connectionmanager.AbstractConnectionManager to throw a ResourceException when the method is called.

The framework used to provide this functionality is called Byteman, which allows developers to change behavior of a method to for example throw an exception. This is called fault injection and can be used to increase code coverage of your project.



/*
 * 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 (!= null)
            c.close();
      }
   }
}
          

See the Byteman web site for a detailed description of the project and additional documentation.

The code sample below shows how to use Arquillian to deploy a ShrinkWrap resource adapter archive and inject the IronJacamar metadata repository into the test case such that assertions can be made.

The IronJacamar container features various components that makes up the entire Java EE Connector Architecture container. The available list of components can be viewed in the configuration of the container or through the management console under the Kernel category.



/*/*
 * IronJacamar, a Java EE Connector Architecture implementation
 * Copyright 2011, 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.embedded.Inject;
import org.jboss.jca.arquillian.rars.simple.TestConnection;
import org.jboss.jca.arquillian.rars.simple.TestConnectionFactory;
import org.jboss.jca.core.spi.mdr.MetadataRepository;
import java.util.UUID;
import javax.annotation.Resource;
import org.jboss.arquillian.container.test.api.Deployment;
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.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
/**
 * Unit test for Arquillian integration and injecting
 * 
 * @author <a href="mailto:jesper.pedersen@ironjacamar.org">Jesper Pedersen</a>
 */
@RunWith(Arquillian.class)
@Configuration(autoActivate = true)
public class InjectTestCase
{
   // --------------------------------------------------------------------------------||
   // Class Members ------------------------------------------------------------------||
   // --------------------------------------------------------------------------------||
   private static Logger log = Logger.getLogger(InjectTestCase.class);
   /**
    * Define the deployment
    * @return The deployment archive
    */
   @Deployment
   public static ResourceAdapterArchive createDeployment()
   {
      ResourceAdapterArchive raa =
         ShrinkWrap.create(ResourceAdapterArchive.class, "ArquillianTest.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;
   }
   //-------------------------------------------------------------------------------------||
   // Tests ------------------------------------------------------------------------------||
   //-------------------------------------------------------------------------------------||
   @Resource(mappedName = "java:/eis/ArquillianTest")
   private TestConnectionFactory connectionFactory;
 
   @Inject(name = "MDR")
   private MetadataRepository mdr;
  
   /**
    * Basic
    * @exception Throwable Thrown if case of an error
    */
   @Test
   public void testBasic() throws Throwable
   {
      assertNotNull(connectionFactory);
      assertNotNull(mdr);
      assertNotNull(mdr.getResourceAdapters());
      assertTrue(mdr.getResourceAdapters().size() == 1);
   }
}
          

The code sample below shows an advanced usage of deploying a ShrinkWrap resource adapter archive into the IronJacamar Embedded environment.



/*
 * 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.embedded.unit;
import org.jboss.jca.embedded.Embedded;
import org.jboss.jca.embedded.EmbeddedFactory;
import org.jboss.jca.embedded.rars.simple.TestConnection;
import org.jboss.jca.embedded.rars.simple.TestConnectionFactory;
import java.util.UUID;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
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.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
 * Test cases for deploying resource adapter archives (.RAR)
 * using ShrinkWrap
 * 
 * @author <a href="mailto:jesper.pedersen@ironjacamar.org">Jesper Pedersen</a>
 */
public class ShrinkWrapTestCase
{
   // --------------------------------------------------------------------------------||
   // Class Members ------------------------------------------------------------------||
   // --------------------------------------------------------------------------------||
   private static Logger log = Logger.getLogger(ShrinkWrapTestCase.class);
   private static final String JNDI_PREFIX = "java:/eis/";
   /*
    * Embedded
    */
   private static Embedded embedded;
   // --------------------------------------------------------------------------------||
   // Tests --------------------------------------------------------------------------||
   // --------------------------------------------------------------------------------||
   /**
    * Basic ShrinkWrap ResourceAdapterArchive test case
    * @exception Throwable Thrown if case of an error
    */
   @Test
   public void testBasic() throws Throwable
   {
      Context context = null;
      String name = UUID.randomUUID().toString();
      ResourceAdapterArchive raa =
         ShrinkWrap.create(ResourceAdapterArchive.class, name + ".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");
      try
      {
         embedded.deploy(raa);
         context = new InitialContext();
         TestConnectionFactory tcf = (TestConnectionFactory)context.lookup(JNDI_PREFIX + name);
         assertNotNull(tcf);
         TestConnection tc = tcf.getConnection();
         tc.callMe();
         tc.close();
      }
      catch (Exception t)
      {
         log.error(t.getMessage(), t);
         fail(t.getMessage());
      }
      finally
      {
         if (context != null)
         {
            try
            {
               context.close();
            }
            catch (NamingException ne)
            {
               // Ignore
            }
         }
         embedded.undeploy(raa);
      }
   }
   // --------------------------------------------------------------------------------||
   // Lifecycle Methods --------------------------------------------------------------||
   // --------------------------------------------------------------------------------||
   /**
    * Lifecycle start, before the suite is executed
    * @throws Throwable throwable exception 
    */
   @BeforeClass
   public static void beforeClass() throws Throwable
   {
      // Create and set an embedded JCA instance
      embedded = EmbeddedFactory.create();
      // Startup
      embedded.startup();
   }
   /**
    * Lifecycle stop, after the suite is executed
    * @throws Throwable throwable exception 
    */
   @AfterClass
   public static void afterClass() throws Throwable
   {
      // Shutdown embedded
      embedded.shutdown();
      // Set embedded to null
      embedded = null;
   }
}
          

The code sample below shows a simple usage of deploying a pre-assembled resource adapter archive into the IronJacamar Embedded environment.



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();
   }
}
            

See the IronJacamar Embedded API documentation for additional functionality.

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 IronJacamar EIS test server provides a framework for emulating an Enterprise Information System such that no installation is needed.

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.

The java.io.InputStream is the incoming communication coming from the resource adapter, and the java.io.OutputStream is the EIS' response to the request.

Once the method returns the socket between the resource adapter and the EIS is closed.

This means that the implementation of the Handler interface will represent the binary protocol between the resource adapter and the EIS. To the resource adapter it will look as it is communicating with the real Enterprise Information System installation.

All the IronJacamar schemas are deployed under http://www.ironjacamar.org/schema/.



      <?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://xmlns.jcp.org/xml/ns/javaee"
            xmlns:javaee="http://xmlns.jcp.org/xml/ns/javaee"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"
            version="1.7">
  <xsd:annotation>
    <xsd:documentation>

      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
      
      Copyright (c) 2009-2013 Oracle and/or its affiliates. All rights reserved.
      
      The contents of this file are subject to the terms of either the GNU
      General Public License Version 2 only ("GPL") or the Common Development
      and Distribution License("CDDL") (collectively, the "License").  You
      may not use this file except in compliance with the License.  You can
      obtain a copy of the License at
      https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
      or packager/legal/LICENSE.txt.  See the License for the specific
      language governing permissions and limitations under the License.
      
      When distributing the software, include this License Header Notice in each
      file and include the License file at packager/legal/LICENSE.txt.
      
      GPL Classpath Exception:
      Oracle designates this particular file as subject to the "Classpath"
      exception as provided by Oracle in the GPL Version 2 section of the License
      file that accompanied this code.
      
      Modifications:
      If applicable, add the following below the License Header, with the fields
      enclosed by brackets [] replaced by your own identifying information:
      "Portions Copyright [year] [name of copyright owner]"
      
      Contributor(s):
      If you wish your version of this file to be governed by only the CDDL or
      only the GPL Version 2, indicate your decision by adding "[Contributor]
      elects to include this software in this distribution under the [CDDL or GPL
      Version 2] license."  If you don't indicate a single choice of license, a
      recipient has the option to distribute your version of this file under
      either the CDDL, the GPL Version 2 or to extend the choice of license to
      its licensees as provided above.  However, if you add GPL Version 2 code
      and therefore, elected the GPL Version 2 license, then the option applies
      only if the new code is made subject to such option by the copyright
      holder.
      
    </xsd:documentation>
  </xsd:annotation>

  <xsd:annotation>
    <xsd:documentation>

      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
      
      Copyright 2003-2013 Sun Microsystems, Inc. All rights reserved.
      
      The contents of this file are subject to the terms of either the
      GNU General Public License Version 2 only ("GPL") or the Common
      Development and Distribution License("CDDL") (collectively, the
      "License").  You may not use this file except in compliance with
      the License. You can obtain a copy of the License at
      https://glassfish.dev.java.net/public/CDDL+GPL.html or
      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
      specific language governing permissions and limitations under the
      License.
      
      When distributing the software, include this License Header
      Notice in each file and include the License file at
      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
      particular file as subject to the "Classpath" exception as
      provided by Sun in the GPL Version 2 section of the License file
      that accompanied this code.  If applicable, add the following
      below the License Header, with the fields enclosed by brackets []
      replaced by your own identifying information:
      "Portions Copyrighted [year] [name of copyright owner]"
      
      Contributor(s):
      
      If you wish your version of this file to be governed by only the
      CDDL or only the GPL Version 2, indicate your decision by adding
      "[Contributor] elects to include this software in this
      distribution under the [CDDL or GPL Version 2] license."  If you
      don't indicate a single choice of license, a recipient has the
      option to distribute your version of this file under either the
      CDDL, the GPL Version 2 or to extend the choice of license to its
      licensees as provided above.  However, if you add GPL Version 2
      code and therefore, elected the GPL Version 2 license, then the
      option applies only if the new code is made subject to such
      option by the copyright holder.
      
    </xsd:documentation>
  </xsd:annotation>

  <xsd:annotation>
    <xsd:documentation>
      <![CDATA[[
      This is the XML Schema for the Connector 1.7 deployment
      descriptor.  The deployment descriptor must be named
      "META-INF/ra.xml" in the connector's rar file.  All Connector
      deployment descriptors must indicate the connector resource
      adapter schema by using the Java EE namespace:
      
      http://xmlns.jcp.org/xml/ns/javaee
      
      and by indicating the version of the schema by
      using the version element as shown below:
      
      <connector xmlns="http://xmlns.jcp.org/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
         http://xmlns.jcp.org/xml/ns/javaee/connector_1_7.xsd"
      version="1.7">
      ...
      </connector>
      
      The instance documents may indicate the published version of
      the schema using the xsi:schemaLocation attribute for Java EE
      namespace with the following location:
      
      http://xmlns.jcp.org/xml/ns/javaee/connector_1_7.xsd
      
      ]]>
    </xsd:documentation>
  </xsd:annotation>

  <xsd:annotation>
    <xsd:documentation>

      The following conventions apply to all Java EE
      deployment descriptor elements unless indicated otherwise.
      
      - In elements that specify a pathname to a file within the
      same JAR file, relative filenames (i.e., those not
      starting with "/") are considered relative to the root of
      the JAR file's namespace.  Absolute filenames (i.e., those
      starting with "/") also specify names in the root of the
      JAR file's namespace.  In general, relative names are
      preferred.  The exception is .war files where absolute
      names are preferred for consistency with the Servlet API.
      
    </xsd:documentation>
  </xsd:annotation>

  <xsd:include schemaLocation="javaee_7.xsd"/>


<!-- **************************************************** -->

  <xsd:element name="connector"
               type="javaee:connectorType">
    <xsd:annotation>
      <xsd:documentation>

        The connector element is the root element of the deployment
        descriptor for the resource adapter. This element includes
        general information - vendor name, resource adapter version,
        icon - about the resource adapter module. It also includes
        information specific to the implementation of the resource
        adapter library as specified through the element
        resourceadapter.
        
      </xsd:documentation>
    </xsd:annotation>
  </xsd:element>


<!-- **************************************************** -->

  <xsd:complexType name="activationspecType">
    <xsd:annotation>
      <xsd:documentation>

        The activationspecType specifies an activation
        specification.  The information includes fully qualified
        Java class name of an activation specification and a set of
        required configuration property names.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="activationspec-class"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element activationspec-class specifies the fully
            qualified Java class name of the activation
            specification class. This class must implement the
            javax.resource.spi.ActivationSpec interface. The
            implementation of this class is required to be a
            JavaBean.
            
            Example:
                  <activationspec-class>com.wombat.ActivationSpecImpl
                  </activationspec-class>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="required-config-property"
                   type="javaee:required-config-propertyType"
                   minOccurs="0"
                   maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>

            The required-config-property element is deprecated since
            Connectors 1.6 specification. The resource adapter 
            implementation is recommended to use the @NotNull
            Bean Validation annotation or its XML validation
            descriptor equivalent to indicate that a configuration
            property is required to be specified by the deployer.
            See the Connectors specification for more information. 
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property"
                   type="javaee:config-propertyType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="adminobjectType">
    <xsd:annotation>
      <xsd:documentation>

        The adminobjectType specifies information about an
        administered object.  Administered objects are specific to a
        messaging style or message provider.  This contains
        information on the Java type of the interface implemented by
        an administered object, its Java class name and its
        configuration properties.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="adminobject-interface"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element adminobject-interface specifies the
            fully qualified name of the Java type of the
            interface implemented by an administered object.
            
            Example:
                <adminobject-interface>javax.jms.Destination
                </adminobject-interface>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="adminobject-class"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element adminobject-class specifies the fully
            qualified Java class name of an administered object.
            
            Example:
                  <adminobject-class>com.wombat.DestinationImpl
                  </adminobject-class>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property"
                   type="javaee:config-propertyType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="authentication-mechanismType">
    <xsd:annotation>
      <xsd:documentation>

        The authentication-mechanismType specifies an authentication
        mechanism supported by the resource adapter. Note that this
        support is for the resource adapter and not for the
        underlying EIS instance. The optional description specifies
        any resource adapter specific requirement for the support of
        security contract and authentication mechanism.
        
        Note that BasicPassword mechanism type should support the
        javax.resource.spi.security.PasswordCredential interface.
        The Kerbv5 mechanism type should support the
        org.ietf.jgss.GSSCredential interface or the deprecated
        javax.resource.spi.security.GenericCredential interface.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="description"
                   type="javaee:descriptionType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="authentication-mechanism-type"
                   type="javaee:xsdStringType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element authentication-mechanism-type specifies
            type of an authentication mechanism.
            
            The example values are:
            
            <authentication-mechanism-type>BasicPassword
            </authentication-mechanism-type>
            
            <authentication-mechanism-type>Kerbv5
            </authentication-mechanism-type>
            
            Any additional security mechanisms are outside the
            scope of the Connector architecture specification.
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="credential-interface"
                   type="javaee:credential-interfaceType"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="config-property-nameType">
    <xsd:annotation>
      <xsd:documentation>
        <![CDATA[[
        The config-property-nameType contains the name of a
        configuration property.
        
        The connector architecture defines a set of well-defined
        properties all of type java.lang.String. These are as
        follows.
        
        ServerName
        PortNumber
        UserName
        Password
        ConnectionURL
        
        A resource adapter provider can extend this property set to
        include properties specific to the resource adapter and its
        underlying EIS.
        
        Possible values include
              ServerName
              PortNumber
              UserName
              Password
              ConnectionURL
        
        Example: <config-property-name>ServerName</config-property-name>
        
        ]]>
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleContent>
      <xsd:restriction base="javaee:xsdStringType"/>
    </xsd:simpleContent>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="config-property-typeType">
    <xsd:annotation>
      <xsd:documentation>
        <![CDATA[[
        The config-property-typeType contains the fully
        qualified Java type of a configuration property.
        
        The following are the legal values:
        java.lang.Boolean, java.lang.String, java.lang.Integer,
        java.lang.Double, java.lang.Byte, java.lang.Short,
        java.lang.Long, java.lang.Float, java.lang.Character
        
        Used in: config-property
        
        Example:
        <config-property-type>java.lang.String</config-property-type>
        
        ]]>
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleContent>
      <xsd:restriction base="javaee:string">
        <xsd:enumeration value="java.lang.Boolean"/>
        <xsd:enumeration value="java.lang.String"/>
        <xsd:enumeration value="java.lang.Integer"/>
        <xsd:enumeration value="java.lang.Double"/>
        <xsd:enumeration value="java.lang.Byte"/>
        <xsd:enumeration value="java.lang.Short"/>
        <xsd:enumeration value="java.lang.Long"/>
        <xsd:enumeration value="java.lang.Float"/>
        <xsd:enumeration value="java.lang.Character"/>
      </xsd:restriction>
    </xsd:simpleContent>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="config-propertyType">
    <xsd:annotation>
      <xsd:documentation>

        The config-propertyType contains a declaration of a single
        configuration property that may be used for providing
        configuration information.
        
        The declaration consists of an optional description, name,
        type and an optional value of the configuration property. If
        the resource adapter provider does not specify a value than
        the deployer is responsible for providing a valid value for
        a configuration property.
        
        Any bounds or well-defined values of properties should be
        described in the description element.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="description"
                   type="javaee:descriptionType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="config-property-name"
                   type="javaee:config-property-nameType"/>
      <xsd:element name="config-property-type"
                   type="javaee:config-property-typeType"/>
      <xsd:element name="config-property-value"
                   type="javaee:xsdStringType"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element config-property-value contains the value
            of a configuration entry. Note, it is possible for a
            resource adapter deployer to override this
            configuration information during deployment.
            
            Example:
            <config-property-value>WombatServer</config-property-value>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property-ignore"
                   type="javaee:true-falseType"
                   minOccurs="0"
                   maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>

            The element config-property-ignore is used to specify 
            whether the configuration tools must ignore considering the 
            configuration property during auto-discovery of
            Configuration properties. See the Connector specification for
            more details. If unspecified, the container must not ignore
            the configuration property during auto-discovery.
            This element must be one of the following, "true" or "false".
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property-supports-dynamic-updates"
                   type="javaee:true-falseType"
                   minOccurs="0"
                   maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>

            The element config-property-supports-dynamic-updates is used to specify 
            whether the configuration property allows its value to be updated, by
            application server's configuration tools, during the lifetime of
            the JavaBean instance. See the Connector specification for
            more details. If unspecified, the container must not dynamically
            reconfigure the property.
            This element must be one of the following, "true" or "false".
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property-confidential"
                   type="javaee:true-falseType"
                   minOccurs="0"
                   maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>

            The element config-property-confidential is used to specify 
            whether the configuration property is confidential and
            recommends application server's configuration tools to use special 
            visual aids for editing them. See the Connector specification for
            more details. If unspecified, the container must not treat the
            property as confidential.
            This element must be one of the following, "true" or "false".
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="connection-definitionType">
    <xsd:annotation>
      <xsd:documentation>

        The connection-definitionType defines a set of connection
        interfaces and classes pertaining to a particular connection
        type. This also includes configurable properties for
        ManagedConnectionFactory instances that may be produced out
        of this set.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="managedconnectionfactory-class"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element managedconnectionfactory-class specifies
            the fully qualified name of the Java class that
            implements the
            javax.resource.spi.ManagedConnectionFactory interface.
            This Java class is provided as part of resource
            adapter's implementation of connector architecture
            specified contracts. The implementation of this
            class is required to be a JavaBean.
            
            Example:
            <managedconnectionfactory-class>
                  com.wombat.ManagedConnectionFactoryImpl
            </managedconnectionfactory-class>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property"
                   type="javaee:config-propertyType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="connectionfactory-interface"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element connectionfactory-interface specifies
            the fully qualified name of the ConnectionFactory
            interface supported by the resource adapter.
            
            Example:
            <connectionfactory-interface>com.wombat.ConnectionFactory
            </connectionfactory-interface>
            
            OR
            
            <connectionfactory-interface>javax.resource.cci.ConnectionFactory
            </connectionfactory-interface>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="connectionfactory-impl-class"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element connectionfactory-impl-class specifies
            the fully qualified name of the ConnectionFactory
            class that implements resource adapter
            specific ConnectionFactory interface.
            
            Example:
            
            <connectionfactory-impl-class>com.wombat.ConnectionFactoryImpl
            </connectionfactory-impl-class>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="connection-interface"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The connection-interface element specifies the fully
            qualified name of the Connection interface supported
            by the resource adapter.
            
            Example:
            
                  <connection-interface>javax.resource.cci.Connection
                  </connection-interface>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="connection-impl-class"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The connection-impl-classType specifies the fully
            qualified name of the Connection class that
            implements resource adapter specific Connection
            interface.  It is used by the connection-impl-class
            elements.
            
            Example:
            
                  <connection-impl-class>com.wombat.ConnectionImpl
                  </connection-impl-class>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="connectorType">
    <xsd:annotation>
      <xsd:documentation>

        The connectorType defines a resource adapter.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="module-name"
                   type="javaee:string"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>

            The element module-name specifies the name of the
            resource adapter.
            
            If there is no module-name specified, the module-name
            is determined as defined in Section EE.8.1.1 and EE.8.1.2 
            of the Java Platform, Enterprise Edition (Java EE) 
            Specification, version 6.
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:group ref="javaee:descriptionGroup"/>
      <xsd:element name="vendor-name"
                   type="javaee:xsdStringType"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>

            The element vendor-name specifies the name of
            resource adapter provider vendor.
            
            If there is no vendor-name specified, the application 
            server must consider the default "" (empty string) as
            the name of the resource adapter provider vendor.
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="eis-type"
                   type="javaee:xsdStringType"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>

            The element eis-type contains information about the
            type of the EIS. For example, the type of an EIS can
            be product name of EIS independent of any version
            info.
            
            This helps in identifying EIS instances that can be
            used with this resource adapter.
            
            If there is no eis-type specified, the application 
            server must consider the default "" (empty string) as
            the type of the EIS.
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="resourceadapter-version"
                   type="javaee:xsdStringType"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>

            The element resourceadapter-version specifies a string-based version
            of the resource adapter from the resource adapter
            provider.
            
            If there is no resourceadapter-version specified, the application 
            server must consider the default "" (empty string) as
            the version of the resource adapter.
                
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="license"
                   type="javaee:licenseType"
                   minOccurs="0"/>
      <xsd:element name="resourceadapter"
                   type="javaee:resourceadapterType"/>
      <xsd:element name="required-work-context"
                   type="javaee:fully-qualified-classType"
                   minOccurs="0"
                   maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>

            The element required-work-context specifies a fully qualified class 
            name that implements WorkContext interface, that the resource adapter 
            requires the application server to support.
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="version"
                   type="javaee:dewey-versionType"
                   fixed="1.7"
                   use="required">
      <xsd:annotation>
        <xsd:documentation>

          The version indicates the version of the schema to be used by the
          deployment tool. This element doesn't have a default, and the resource adapter 
          developer/deployer is required to specify it. The element allows the deployment 
          tool to choose which schema to validate the descriptor against.
              
          
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="metadata-complete"
                   type="xsd:boolean">
      <xsd:annotation>
        <xsd:documentation>

          The metadata-complete attribute defines whether the deployment 
          descriptor for the resource adapter module is complete, or whether
          the class files available to the module and packaged with the resource 
          adapter should be examined for annotations that specify deployment 
          information.
          
          If metadata-complete is set to "true", the deployment tool of the 
          application server must ignore any annotations that specify deployment 
          information, which might be present in the class files of the 
          application.If metadata-complete is not specified or is set to "false", 
          the deployment tool must examine the class files of the application for 
          annotations, as specified by this specification. If the 
          deployment descriptor is not included or is included but not marked 
          metadata-complete, the deployment tool will process annotations.
          
          Application servers must assume that metadata-complete is true for 
          resource adapter modules with deployment descriptor version 
          lower than 1.6.
                
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="credential-interfaceType">
    <xsd:annotation>
      <xsd:documentation>

        The credential-interfaceType specifies the
        interface that the resource adapter implementation
        supports for the representation of the
        credentials. This element(s) that use this type,
        i.e. credential-interface,  should be used by
        application server to find out the Credential
        interface it should use as part of the security
        contract.
        
        The possible values are:
        
        javax.resource.spi.security.PasswordCredential
        org.ietf.jgss.GSSCredential
        javax.resource.spi.security.GenericCredential
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleContent>
      <xsd:restriction base="javaee:fully-qualified-classType">
        <xsd:enumeration value="javax.resource.spi.security.PasswordCredential"/>
        <xsd:enumeration value="org.ietf.jgss.GSSCredential"/>
        <xsd:enumeration value="javax.resource.spi.security.GenericCredential"/>
      </xsd:restriction>
    </xsd:simpleContent>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="inbound-resourceadapterType">
    <xsd:annotation>
      <xsd:documentation>

        The inbound-resourceadapterType specifies information
        about an inbound resource adapter. This contains information
        specific to the implementation of the resource adapter
        library as specified through the messageadapter element.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="messageadapter"
                   type="javaee:messageadapterType"
                   minOccurs="0">
        <xsd:unique name="messagelistener-type-uniqueness">
          <xsd:annotation>
            <xsd:documentation>

              The messagelistener-type element content must be
              unique in the messageadapter. Several messagelisteners
              can not use the same messagelistener-type.
              
            </xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:messagelistener"/>
          <xsd:field xpath="javaee:messagelistener-type"/>
        </xsd:unique>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="licenseType">
    <xsd:annotation>
      <xsd:documentation>

        The licenseType specifies licensing requirements for the
        resource adapter module. This type specifies whether a
        license is required to deploy and use this resource adapter,
        and an optional description of the licensing terms
        (examples: duration of license, number of connection
        restrictions). It is used by the license element.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="description"
                   type="javaee:descriptionType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="license-required"
                   type="javaee:true-falseType">
        <xsd:annotation>
          <xsd:documentation>

            The element license-required specifies whether a
            license is required to deploy and use the
            resource adapter. This element must be one of
            the following, "true" or "false".
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="messageadapterType">
    <xsd:annotation>
      <xsd:documentation>

        The messageadapterType specifies information about the
        messaging capabilities of the resource adapter. This
        contains information specific to the implementation of the
        resource adapter library as specified through the
        messagelistener element.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="messagelistener"
                   type="javaee:messagelistenerType"
                   maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="messagelistenerType">
    <xsd:annotation>
      <xsd:documentation>

        The messagelistenerType specifies information about a
        specific message listener supported by the messaging
        resource adapter. It contains information on the Java type
        of the message listener interface and an activation
        specification.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="messagelistener-type"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element messagelistener-type specifies the fully
            qualified name of the Java type of a message
            listener interface.
            
            Example:
            
                <messagelistener-type>javax.jms.MessageListener
                </messagelistener-type>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="activationspec"
                   type="javaee:activationspecType"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="outbound-resourceadapterType">
    <xsd:annotation>
      <xsd:documentation>

        The outbound-resourceadapterType specifies information about
        an outbound resource adapter. The information includes fully
        qualified names of classes/interfaces required as part of
        the connector architecture specified contracts for
        connection management, level of transaction support
        provided, one or more authentication mechanisms supported
        and additional required security permissions.
        
        If any of the outbound resource adapter elements (transaction-support,
        authentication-mechanism, reauthentication-support) is specified through
        this element or metadata annotations, and no  connection-definition is 
        specified as part of this element or through annotations, the 
        application server must consider this an error and fail deployment. 
        
        If there is no authentication-mechanism specified as part of
        this element or metadata annotations, then the resource adapter does 
        not support any standard security authentication mechanisms as 
        part of security contract. The application server ignores the security 
        part of the system contracts in this case.
        
        If there is no transaction-support specified as part of this element 
        or metadata annotation, then the application server must consider that 
        the resource adapter does not support either the resource manager local 
        or JTA transactions and must consider the transaction support as 
        NoTransaction. Note that resource adapters may specify the level of 
        transaction support to be used at runtime for a ManagedConnectionFactory 
        through the TransactionSupport interface.
        
        If there is no reauthentication-support specified as part of
        this element or metadata annotation, then the application server must consider 
        that the resource adapter does not support re-authentication of 
        ManagedConnections.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="connection-definition"
                   type="javaee:connection-definitionType"
                   maxOccurs="unbounded"
                   minOccurs="0"/>
      <xsd:element name="transaction-support"
                   type="javaee:transaction-supportType"
                   minOccurs="0"/>
      <xsd:element name="authentication-mechanism"
                   type="javaee:authentication-mechanismType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="reauthentication-support"
                   type="javaee:true-falseType"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>

                    The element reauthentication-support specifies
                    whether the resource adapter implementation supports
                    re-authentication of existing Managed- Connection
                    instance. Note that this information is for the
                    resource adapter implementation and not for the
                    underlying EIS instance. This element must have
                    either a "true" or "false" value.
            
                  
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="required-config-propertyType">
    <xsd:annotation>
      <xsd:documentation>
        <![CDATA[[
        The required-config-propertyType contains a declaration
        of a single configuration property used for specifying a
        required configuration property name. It is used
        by required-config-property elements.
        
        Usage of this type is deprecated from Connectors 1.6 specification. 
        Refer to required-config-property element for more information.
        
        Example:
        
        <required-config-property>
        <config-property-name>Destination</config-property-name>
        </required-config-property>
        
        ]]>
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="description"
                   type="javaee:descriptionType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="config-property-name"
                   type="javaee:config-property-nameType"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="resourceadapterType">
    <xsd:annotation>
      <xsd:documentation>

        The resourceadapterType specifies information about the
        resource adapter. The information includes fully qualified
        resource adapter Java class name, configuration properties,
        information specific to the implementation of the resource
        adapter library as specified through the
        outbound-resourceadapter and inbound-resourceadapter
        elements, and an optional set of administered objects.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="resourceadapter-class"
                   type="javaee:fully-qualified-classType"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>

            The element resourceadapter-class specifies the
            fully qualified name of a Java class that implements
            the javax.resource.spi.ResourceAdapter
            interface. This Java class is provided as part of
            resource adapter's implementation of connector
            architecture specified contracts. The implementation
            of this class is required to be a JavaBean.
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property"
                   type="javaee:config-propertyType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="outbound-resourceadapter"
                   type="javaee:outbound-resourceadapterType"
                   minOccurs="0">
        <xsd:unique name="connectionfactory-interface-uniqueness">
          <xsd:annotation>
            <xsd:documentation>

              The connectionfactory-interface element content
              must be unique in the outbound-resourceadapter.
              Multiple connection-definitions can not use the
              same connectionfactory-type.
              
            </xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:connection-definition"/>
          <xsd:field xpath="javaee:connectionfactory-interface"/>
        </xsd:unique>
      </xsd:element>
      <xsd:element name="inbound-resourceadapter"
                   type="javaee:inbound-resourceadapterType"
                   minOccurs="0"/>
      <xsd:element name="adminobject"
                   type="javaee:adminobjectType"
                   minOccurs="0"
                   maxOccurs="unbounded">
        <xsd:unique name="adminobject-type-uniqueness">
          <xsd:annotation>
            <xsd:documentation>

              The adminobject-interface and adminobject-class element content must be
              unique in the resourceadapterType. Several admin objects
              can not use the same adminobject-interface and adminobject-class.
              
            </xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:adminobject"/>
          <xsd:field xpath="javaee:adminobject-interface"/>
          <xsd:field xpath="javaee:adminobject-class"/>
        </xsd:unique>
      </xsd:element>
      <xsd:element name="security-permission"
                   type="javaee:security-permissionType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="security-permissionType">
    <xsd:annotation>
      <xsd:documentation>

        The security-permissionType specifies a security
        permission that is required by the resource adapter code.
        
        The security permission listed in the deployment descriptor
        are ones that are different from those required by the
        default permission set as specified in the connector
        specification. The optional description can mention specific
        reason that resource adapter requires a given security
        permission.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="description"
                   type="javaee:descriptionType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="security-permission-spec"
                   type="javaee:xsdStringType">
        <xsd:annotation>
          <xsd:documentation>

            The element security-permission-spec specifies a security
            permission based on the Security policy file
            syntax. Refer to the following URL for Sun's
            implementation of the security permission
            specification:
            
            http://docs.oracle.com/javase/6/docs/technotes/guides/security/PolicyFiles.html
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>

</xsd:schema>

    


      <?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://java.sun.com/xml/ns/javaee"
            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"
            version="1.6">
  <xsd:annotation>
    <xsd:documentation>

      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
      
      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
      
      The contents of this file are subject to the terms of either the
      GNU General Public License Version 2 only ("GPL") or the Common
      Development and Distribution License("CDDL") (collectively, the
      "License").  You may not use this file except in compliance with
      the License. You can obtain a copy of the License at
      https://glassfish.dev.java.net/public/CDDL+GPL.html or
      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
      specific language governing permissions and limitations under the
      License.
      
      When distributing the software, include this License Header
      Notice in each file and include the License file at
      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
      particular file as subject to the "Classpath" exception as
      provided by Sun in the GPL Version 2 section of the License file
      that accompanied this code.  If applicable, add the following
      below the License Header, with the fields enclosed by brackets []
      replaced by your own identifying information:
      "Portions Copyrighted [year] [name of copyright owner]"
      
      Contributor(s):
      
      If you wish your version of this file to be governed by only the
      CDDL or only the GPL Version 2, indicate your decision by adding
      "[Contributor] elects to include this software in this
      distribution under the [CDDL or GPL Version 2] license."  If you
      don't indicate a single choice of license, a recipient has the
      option to distribute your version of this file under either the
      CDDL, the GPL Version 2 or to extend the choice of license to its
      licensees as provided above.  However, if you add GPL Version 2
      code and therefore, elected the GPL Version 2 license, then the
      option applies only if the new code is made subject to such
      option by the copyright holder.
      
    </xsd:documentation>
  </xsd:annotation>

  <xsd:annotation>
    <xsd:documentation>

      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
      
      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
      
      The contents of this file are subject to the terms of either the
      GNU General Public License Version 2 only ("GPL") or the Common
      Development and Distribution License("CDDL") (collectively, the
      "License").  You may not use this file except in compliance with
      the License. You can obtain a copy of the License at
      https://glassfish.dev.java.net/public/CDDL+GPL.html or
      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
      specific language governing permissions and limitations under the
      License.
      
      When distributing the software, include this License Header
      Notice in each file and include the License file at
      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
      particular file as subject to the "Classpath" exception as
      provided by Sun in the GPL Version 2 section of the License file
      that accompanied this code.  If applicable, add the following
      below the License Header, with the fields enclosed by brackets []
      replaced by your own identifying information:
      "Portions Copyrighted [year] [name of copyright owner]"
      
      Contributor(s):
      
      If you wish your version of this file to be governed by only the
      CDDL or only the GPL Version 2, indicate your decision by adding
      "[Contributor] elects to include this software in this
      distribution under the [CDDL or GPL Version 2] license."  If you
      don't indicate a single choice of license, a recipient has the
      option to distribute your version of this file under either the
      CDDL, the GPL Version 2 or to extend the choice of license to its
      licensees as provided above.  However, if you add GPL Version 2
      code and therefore, elected the GPL Version 2 license, then the
      option applies only if the new code is made subject to such
      option by the copyright holder.
      
    </xsd:documentation>
  </xsd:annotation>

  <xsd:annotation>
    <xsd:documentation>
      <![CDATA[[
      This is the XML Schema for the Connector 1.6 deployment
      descriptor.  The deployment descriptor must be named
      "META-INF/ra.xml" in the connector's rar file.  All Connector
      deployment descriptors must indicate the connector resource
      adapter schema by using the Java EE namespace:
      
      http://java.sun.com/xml/ns/javaee
      
      and by indicating the version of the schema by
      using the version element as shown below:
      
      <connector xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
         http://java.sun.com/xml/ns/javaee/connector_1_6.xsd"
      version="1.6">
      ...
      </connector>
      
      The instance documents may indicate the published version of
      the schema using the xsi:schemaLocation attribute for Java EE
      namespace with the following location:
      
      http://java.sun.com/xml/ns/javaee/connector_1_6.xsd
      
      ]]>
    </xsd:documentation>
  </xsd:annotation>

  <xsd:annotation>
    <xsd:documentation>

      The following conventions apply to all Java EE
      deployment descriptor elements unless indicated otherwise.
      
      - In elements that specify a pathname to a file within the
      same JAR file, relative filenames (i.e., those not
      starting with "/") are considered relative to the root of
      the JAR file's namespace.  Absolute filenames (i.e., those
      starting with "/") also specify names in the root of the
      JAR file's namespace.  In general, relative names are
      preferred.  The exception is .war files where absolute
      names are preferred for consistency with the Servlet API.
      
    </xsd:documentation>
  </xsd:annotation>

  <xsd:include schemaLocation="javaee_6.xsd"/>


<!-- **************************************************** -->

  <xsd:element name="connector"
               type="javaee:connectorType">
    <xsd:annotation>
      <xsd:documentation>

        The connector element is the root element of the deployment
        descriptor for the resource adapter. This element includes
        general information - vendor name, resource adapter version,
        icon - about the resource adapter module. It also includes
        information specific to the implementation of the resource
        adapter library as specified through the element
        resourceadapter.
        
      </xsd:documentation>
    </xsd:annotation>
  </xsd:element>


<!-- **************************************************** -->

  <xsd:complexType name="activationspecType">
    <xsd:annotation>
      <xsd:documentation>

        The activationspecType specifies an activation
        specification.  The information includes fully qualified
        Java class name of an activation specification and a set of
        required configuration property names.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="activationspec-class"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element activationspec-class specifies the fully
            qualified Java class name of the activation
            specification class. This class must implement the
            javax.resource.spi.ActivationSpec interface. The
            implementation of this class is required to be a
            JavaBean.
            
            Example:
                  <activationspec-class>com.wombat.ActivationSpecImpl
                  </activationspec-class>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="required-config-property"
                   type="javaee:required-config-propertyType"
                   minOccurs="0"
                   maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>

            The required-config-property element is deprecated since
            Connectors 1.6 specification. The resource adapter 
            implementation is recommended to use the @NotNull
            Bean Validation annotation or its XML validation
            descriptor equivalent to indicate that a configuration
            property is required to be specified by the deployer.
            See the Connectors specification for more information. 
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property"
                   type="javaee:config-propertyType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="adminobjectType">
    <xsd:annotation>
      <xsd:documentation>

        The adminobjectType specifies information about an
        administered object.  Administered objects are specific to a
        messaging style or message provider.  This contains
        information on the Java type of the interface implemented by
        an administered object, its Java class name and its
        configuration properties.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="adminobject-interface"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element adminobject-interface specifies the
            fully qualified name of the Java type of the
            interface implemented by an administered object.
            
            Example:
                <adminobject-interface>javax.jms.Destination
                </adminobject-interface>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="adminobject-class"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element adminobject-class specifies the fully
            qualified Java class name of an administered object.
            
            Example:
                  <adminobject-class>com.wombat.DestinationImpl
                  </adminobject-class>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property"
                   type="javaee:config-propertyType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="authentication-mechanismType">
    <xsd:annotation>
      <xsd:documentation>

        The authentication-mechanismType specifies an authentication
        mechanism supported by the resource adapter. Note that this
        support is for the resource adapter and not for the
        underlying EIS instance. The optional description specifies
        any resource adapter specific requirement for the support of
        security contract and authentication mechanism.
        
        Note that BasicPassword mechanism type should support the
        javax.resource.spi.security.PasswordCredential interface.
        The Kerbv5 mechanism type should support the
        org.ietf.jgss.GSSCredential interface or the deprecated
        javax.resource.spi.security.GenericCredential interface.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="description"
                   type="javaee:descriptionType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="authentication-mechanism-type"
                   type="javaee:xsdStringType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element authentication-mechanism-type specifies
            type of an authentication mechanism.
            
            The example values are:
            
            <authentication-mechanism-type>BasicPassword
            </authentication-mechanism-type>
            
            <authentication-mechanism-type>Kerbv5
            </authentication-mechanism-type>
            
            Any additional security mechanisms are outside the
            scope of the Connector architecture specification.
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="credential-interface"
                   type="javaee:credential-interfaceType"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="config-property-nameType">
    <xsd:annotation>
      <xsd:documentation>
        <![CDATA[[
        The config-property-nameType contains the name of a
        configuration property.
        
        The connector architecture defines a set of well-defined
        properties all of type java.lang.String. These are as
        follows.
        
        ServerName
        PortNumber
        UserName
        Password
        ConnectionURL
        
        A resource adapter provider can extend this property set to
        include properties specific to the resource adapter and its
        underlying EIS.
        
        Possible values include
              ServerName
              PortNumber
              UserName
              Password
              ConnectionURL
        
        Example: <config-property-name>ServerName</config-property-name>
        
        ]]>
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleContent>
      <xsd:restriction base="javaee:xsdStringType"/>
    </xsd:simpleContent>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="config-property-typeType">
    <xsd:annotation>
      <xsd:documentation>
        <![CDATA[[
        The config-property-typeType contains the fully
        qualified Java type of a configuration property.
        
        The following are the legal values:
        java.lang.Boolean, java.lang.String, java.lang.Integer,
        java.lang.Double, java.lang.Byte, java.lang.Short,
        java.lang.Long, java.lang.Float, java.lang.Character
        
        Used in: config-property
        
        Example:
        <config-property-type>java.lang.String</config-property-type>
        
        ]]>
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleContent>
      <xsd:restriction base="javaee:string">
        <xsd:enumeration value="java.lang.Boolean"/>
        <xsd:enumeration value="java.lang.String"/>
        <xsd:enumeration value="java.lang.Integer"/>
        <xsd:enumeration value="java.lang.Double"/>
        <xsd:enumeration value="java.lang.Byte"/>
        <xsd:enumeration value="java.lang.Short"/>
        <xsd:enumeration value="java.lang.Long"/>
        <xsd:enumeration value="java.lang.Float"/>
        <xsd:enumeration value="java.lang.Character"/>
      </xsd:restriction>
    </xsd:simpleContent>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="config-propertyType">
    <xsd:annotation>
      <xsd:documentation>

        The config-propertyType contains a declaration of a single
        configuration property that may be used for providing
        configuration information.
        
        The declaration consists of an optional description, name,
        type and an optional value of the configuration property. If
        the resource adapter provider does not specify a value than
        the deployer is responsible for providing a valid value for
        a configuration property.
        
        Any bounds or well-defined values of properties should be
        described in the description element.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="description"
                   type="javaee:descriptionType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="config-property-name"
                   type="javaee:config-property-nameType"/>
      <xsd:element name="config-property-type"
                   type="javaee:config-property-typeType"/>
      <xsd:element name="config-property-value"
                   type="javaee:xsdStringType"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element config-property-value contains the value
            of a configuration entry. Note, it is possible for a
            resource adapter deployer to override this
            configuration information during deployment.
            
            Example:
            <config-property-value>WombatServer</config-property-value>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property-ignore"
                   type="javaee:true-falseType"
                   minOccurs="0"
                   maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>

            The element config-property-ignore is used to specify 
            whether the configuration tools must ignore considering the 
            configuration property during auto-discovery of
            Configuration properties. See the Connector specification for
            more details. If unspecified, the container must not ignore
            the configuration property during auto-discovery.
            This element must be one of the following, "true" or "false".
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property-supports-dynamic-updates"
                   type="javaee:true-falseType"
                   minOccurs="0"
                   maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>

            The element config-property-supports-dynamic-updates is used to specify 
            whether the configuration property allows its value to be updated, by
            application server's configuration tools, during the lifetime of
            the JavaBean instance. See the Connector specification for
            more details. If unspecified, the container must not dynamically
            reconfigure the property.
            This element must be one of the following, "true" or "false".
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property-confidential"
                   type="javaee:true-falseType"
                   minOccurs="0"
                   maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>

            The element config-property-confidential is used to specify 
            whether the configuration property is confidential and
            recommends application server's configuration tools to use special 
            visual aids for editing them. See the Connector specification for
            more details. If unspecified, the container must not treat the
            property as confidential.
            This element must be one of the following, "true" or "false".
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="connection-definitionType">
    <xsd:annotation>
      <xsd:documentation>

        The connection-definitionType defines a set of connection
        interfaces and classes pertaining to a particular connection
        type. This also includes configurable properties for
        ManagedConnectionFactory instances that may be produced out
        of this set.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="managedconnectionfactory-class"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element managedconnectionfactory-class specifies
            the fully qualified name of the Java class that
            implements the
            javax.resource.spi.ManagedConnectionFactory interface.
            This Java class is provided as part of resource
            adapter's implementation of connector architecture
            specified contracts. The implementation of this
            class is required to be a JavaBean.
            
            Example:
            <managedconnectionfactory-class>
                  com.wombat.ManagedConnectionFactoryImpl
            </managedconnectionfactory-class>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="config-property"
                   type="javaee:config-propertyType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="connectionfactory-interface"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element connectionfactory-interface specifies
            the fully qualified name of the ConnectionFactory
            interface supported by the resource adapter.
            
            Example:
            <connectionfactory-interface>com.wombat.ConnectionFactory
            </connectionfactory-interface>
            
            OR
            
            <connectionfactory-interface>javax.resource.cci.ConnectionFactory
            </connectionfactory-interface>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="connectionfactory-impl-class"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element connectionfactory-impl-class specifies
            the fully qualified name of the ConnectionFactory
            class that implements resource adapter
            specific ConnectionFactory interface.
            
            Example:
            
            <connectionfactory-impl-class>com.wombat.ConnectionFactoryImpl
            </connectionfactory-impl-class>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="connection-interface"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The connection-interface element specifies the fully
            qualified name of the Connection interface supported
            by the resource adapter.
            
            Example:
            
                  <connection-interface>javax.resource.cci.Connection
                  </connection-interface>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="connection-impl-class"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The connection-impl-classType specifies the fully
            qualified name of the Connection class that
            implements resource adapter specific Connection
            interface.  It is used by the connection-impl-class
            elements.
            
            Example:
            
                  <connection-impl-class>com.wombat.ConnectionImpl
                  </connection-impl-class>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="connectorType">
    <xsd:annotation>
      <xsd:documentation>

        The connectorType defines a resource adapter.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="module-name"
                   type="javaee:string"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>

            The element module-name specifies the name of the
            resource adapter.
            
            If there is no module-name specified, the module-name
            is determined as defined in Section EE.8.1.1 and EE.8.1.2 
            of the Java Platform, Enterprise Edition (Java EE) 
            Specification, version 6.
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:group ref="javaee:descriptionGroup"/>
      <xsd:element name="vendor-name"
                   type="javaee:xsdStringType"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>

            The element vendor-name specifies the name of
            resource adapter provider vendor.
            
            If there is no vendor-name specified, the application 
            server must consider the default "" (empty string) as
            the name of the resource adapter provider vendor.
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="eis-type"
                   type="javaee:xsdStringType"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>

            The element eis-type contains information about the
            type of the EIS. For example, the type of an EIS can
            be product name of EIS independent of any version
            info.
            
            This helps in identifying EIS instances that can be
            used with this resource adapter.
            
            If there is no eis-type specified, the application 
            server must consider the default "" (empty string) as
            the type of the EIS.
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="resourceadapter-version"
                   type="javaee:xsdStringType"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>

            The element resourceadapter-version specifies a string-based version
            of the resource adapter from the resource adapter
            provider.
            
            If there is no resourceadapter-version specified, the application 
            server must consider the default "" (empty string) as
            the version of the resource adapter.
                
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="license"
                   type="javaee:licenseType"
                   minOccurs="0"/>
      <xsd:element name="resourceadapter"
                   type="javaee:resourceadapterType"/>
      <xsd:element name="required-work-context"
                   type="javaee:fully-qualified-classType"
                   minOccurs="0"
                   maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>

            The element required-work-context specifies a fully qualified class 
            name that implements WorkContext interface, that the resource adapter 
            requires the application server to support.
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="version"
                   type="javaee:dewey-versionType"
                   fixed="1.6"
                   use="required">
      <xsd:annotation>
        <xsd:documentation>

          The version indicates the version of the schema to be used by the
          deployment tool. This element doesn't have a default, and the resource adapter 
          developer/deployer is required to specify it. The element allows the deployment 
          tool to choose which schema to validate the descriptor against.
              
          
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="metadata-complete"
                   type="xsd:boolean">
      <xsd:annotation>
        <xsd:documentation>

          The metadata-complete attribute defines whether the deployment 
          descriptor for the resource adapter module is complete, or whether
          the class files available to the module and packaged with the resource 
          adapter should be examined for annotations that specify deployment 
          information.
          
          If metadata-complete is set to "true", the deployment tool of the 
          application server must ignore any annotations that specify deployment 
          information, which might be present in the class files of the 
          application.If metadata-complete is not specified or is set to "false", 
          the deployment tool must examine the class files of the application for 
          annotations, as specified by this specification. If the 
          deployment descriptor is not included or is included but not marked 
          metadata-complete, the deployment tool will process annotations.
          
          Application servers must assume that metadata-complete is true for 
          resource adapter modules with deployment descriptor version 
          lower than 1.6.
                
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="credential-interfaceType">
    <xsd:annotation>
      <xsd:documentation>

        The credential-interfaceType specifies the
        interface that the resource adapter implementation
        supports for the representation of the
        credentials. This element(s) that use this type,
        i.e. credential-interface,  should be used by
        application server to find out the Credential
        interface it should use as part of the security
        contract.
        
        The possible values are:
        
        javax.resource.spi.security.PasswordCredential
        org.ietf.jgss.GSSCredential
        javax.resource.spi.security.GenericCredential
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleContent>
      <xsd:restriction base="javaee:fully-qualified-classType">
        <xsd:enumeration value="javax.resource.spi.security.PasswordCredential"/>
        <xsd:enumeration value="org.ietf.jgss.GSSCredential"/>
        <xsd:enumeration value="javax.resource.spi.security.GenericCredential"/>
      </xsd:restriction>
    </xsd:simpleContent>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="inbound-resourceadapterType">
    <xsd:annotation>
      <xsd:documentation>

        The inbound-resourceadapterType specifies information
        about an inbound resource adapter. This contains information
        specific to the implementation of the resource adapter
        library as specified through the messageadapter element.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="messageadapter"
                   type="javaee:messageadapterType"
                   minOccurs="0">
        <xsd:unique name="messagelistener-type-uniqueness">
          <xsd:annotation>
            <xsd:documentation>

              The messagelistener-type element content must be
              unique in the messageadapter. Several messagelisteners
              can not use the same messagelistener-type.
              
            </xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:messagelistener"/>
          <xsd:field xpath="javaee:messagelistener-type"/>
        </xsd:unique>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="licenseType">
    <xsd:annotation>
      <xsd:documentation>

        The licenseType specifies licensing requirements for the
        resource adapter module. This type specifies whether a
        license is required to deploy and use this resource adapter,
        and an optional description of the licensing terms
        (examples: duration of license, number of connection
        restrictions). It is used by the license element.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="description"
                   type="javaee:descriptionType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="license-required"
                   type="javaee:true-falseType">
        <xsd:annotation>
          <xsd:documentation>

            The element license-required specifies whether a
            license is required to deploy and use the
            resource adapter. This element must be one of
            the following, "true" or "false".
            
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="messageadapterType">
    <xsd:annotation>
      <xsd:documentation>

        The messageadapterType specifies information about the
        messaging capabilities of the resource adapter. This
        contains information specific to the implementation of the
        resource adapter library as specified through the
        messagelistener element.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="messagelistener"
                   type="javaee:messagelistenerType"
                   maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="messagelistenerType">
    <xsd:annotation>
      <xsd:documentation>

        The messagelistenerType specifies information about a
        specific message listener supported by the messaging
        resource adapter. It contains information on the Java type
        of the message listener interface and an activation
        specification.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="messagelistener-type"
                   type="javaee:fully-qualified-classType">
        <xsd:annotation>
          <xsd:documentation>
            <![CDATA[[
            The element messagelistener-type specifies the fully
            qualified name of the Java type of a message
            listener interface.
            
            Example:
            
                <messagelistener-type>javax.jms.MessageListener
                </messagelistener-type>
            
            ]]>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="activationspec"
                   type="javaee:activationspecType"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="outbound-resourceadapterType">
    <xsd:annotation>
      <xsd:documentation>

        The outbound-resourceadapterType specifies information about
        an outbound resource adapter. The information includes fully
        qualified names of classes/interfaces required as part of
        the connector architecture specified contracts for
        connection management, level of transaction support
        provided, one or more authentication mechanisms supported
        and additional required security permissions.
        
        If any of the outbound resource adapter elements (transaction-support,
        authentication-mechanism, reauthentication-support) is specified through
        this element or metadata annotations, and no  connection-definition is 
        specified as part of this element or through annotations, the 
        application server must consider this an error and fail deployment. 
        
        If there is no authentication-mechanism specified as part of
        this element or metadata annotations, then the resource adapter does 
        not support any standard security authentication mechanisms as 
        part of security contract. The application server ignores the security 
        part of the system contracts in this case.
        
        If there is no transaction-support specified as part of this element 
        or metadata annotation, then the application server must consider that 
        the resource adapter does not support either the resource manager local 
        or JTA transactions and must consider the transaction support as 
        NoTransaction. Note that resource adapters may specify the level of 
        transaction support to be used at runtime for a ManagedConnectionFactory 
        through the TransactionSupport interface.
        
        If there is no reauthentication-support specified as part of
        this element or metadata annotation, then the application server must consider 
        that the resource adapter does not support re-authentication of 
        ManagedConnections.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="connection-definition"
                   type="javaee:connection-definitionType"
                   maxOccurs="unbounded"
                   minOccurs="0"/>
      <xsd:element name="transaction-support"
                   type="javaee:transaction-supportType"
                   minOccurs="0"/>
      <xsd:element name="authentication-mechanism"
                   type="javaee:authentication-mechanismType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="reauthentication-support"
                   type="javaee:true-falseType"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>

                    The element reauthentication-support specifies
                    whether the resource adapter implementation supports
                    re-authentication of existing Managed- Connection
                    instance. Note that this information is for the
                    resource adapter implementation and not for the
                    underlying EIS instance. This element must have
                    either a "true" or "false" value.
            
                  
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="required-config-propertyType">
    <xsd:annotation>
      <xsd:documentation>
        <![CDATA[[
        The required-config-propertyType contains a declaration
        of a single configuration property used for specifying a
        required configuration property name. It is used
        by required-config-property elements.
        
        Usage of this type is deprecated from Connectors 1.6 specification. 
        Refer to required-config-property element for more information.
        
        Example:
        
        <required-config-property>
        <config-property-name>Destination</config-property-name>
        </required-config-property>
        
        ]]>
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="description"
                   type="javaee:descriptionType"
                   minOccurs="0"
                   maxOccurs="unbounded"/>
      <xsd:element name="config-property-name"
                   type="javaee:config-property-nameType"/>
    </xsd:sequence>
    <xsd:attribute name="id"
                   type="xsd:ID"/>
  </xsd:complexType>


<!-- **************************************************** -->

  <xsd:complexType name="resourceadapterType">
    <xsd:annotation>
      <xsd:documentation>

        The resourceadapterType specifies information about the
        resource adapter. The information includes fully qualified
        resource adapter Java class name, configuration properties,
        information specific to the implementation of the resource
        adapter library as specified through the
        outbound-resourceadapter and inbound-resourceadapter
        elements, and an optional set of administered objects.
        
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="resourceadapter-class"
                   type="javaee:fully-qualified-classType"
                   minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>

            The element resourceadapter-class specifies the
            fully qualified name of a Java class that implements
            the javax.resource.spi.ResourceAdapter
            interface. This Java class is provid