JBoss.orgCommunity Documentation

Chapter 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. Apache Maven build environment

The IronJacamar project includes a resource adapter code generator which can generate a complete code skeleton that will help developers get started with their development tasks.

The code generator will generate a resource adapter code skeleton based on the user input. The code generator supports

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.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  
Transaction support (N/NoTransaction/L/LocalTransaction/X/XATransaction) All The transaction support level  
Package name All The package name of the resource adapter  
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
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
Build environment [A/Ant/I/Ant+Ivy/M/Maven] All Type of build environment  

The generated code will consist of the classes making up the resource adapter and a test suite environment based on the embedded distribution.