Chapter 9. Code generator

9.1. Introduction

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

9.2. Functionality

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

  • Resource adapter using JCA 1.6 annotations
  • Resource adapter using JCA 1.6 metadata
  • Resource adapter using JCA 1.5
  • Resource adapter using JCA 1.0
  • Apache Ant build environment

9.3. Running the tool

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

Table 9.1. Code generator arguments

ArgumentDesciption
-o Specifies the output directory for the code skeleton.

The developer must then answer various questions regarding the properties of the resource adapter.

9.4. Generated code

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

The following targets are supported in the Apache Ant build environment

Table 9.2. Apache Ant build environment

TargetDesciption
compile Compiles all the files
rar Builds the resource adapter archive
prepare-test Prepares the test environment
test Executes the tests
docs Generates the documentation