Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
blade
gradle/wrapper
lib
src/main/java/com/caplin/template/jtm7
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

Caplin JTM Template

This project template provides a starting point for writing a Transformer 7 module using the Java Transformer Module (JTM) API com.caplin.jtm.

To create a Transformer 6 module, use the Caplin Legacy JTM Template.

This template is a Gradle project. To avoid compatibility issues between the version of Gradle required by the project and the version of Gradle installed on your system, always run the project's Gradle tasks using the Gradle Wrapper from the root of the project: ./gradlew task

Note: the Gradle Wrapper requires an Internet connection. For more information, see Executing a build with the Wrapper in the Gradle documentation.

Getting started

Follow the instructions below to create a new Transformer module project based on the Legacy JTM Template.

Copy and customise the template

  1. Clone, or download and extract the latest version of the Caplin Project Templates repository:

    • wget http://github.com/caplin/project-templates/archive/master.zip

      unzip -qoa master.zip

    • git clone https://github.com/caplin/project-templates.git

  2. Copy the template directory jtm-template and rename it to the name of your new project (for example, MyTransformerModule):

    cp -r ./jtm-template ~/src/MyTransformerModule
  3. Edit the file ~/src/MyTransformerModule/settings.gradle, and change the value of the rootProject.name variable to the name of your project (MyTransformerModule). When you later export your project as an blade, the project name will be used as the name for the blade.

  4. Supply your project's dependencies manually, or configure Gradle to download them automatically from the Caplin Software Repository (coming soon).

    • Caplin Software Repository: create the file ~/src/MyTransformerModule/gradle.properties, and assign your Caplin username and password to the Gradle properties caplinNexusUser and caplinNexusSecret:

      caplinNexusUser=<username>
      caplinNexusSecret=<password>
      
    • Manual download: visit the Caplin Download site and download the latest versions of the following Caplin software libraries to the ~/src/MyTransformerModule/lib directory:

      • JTM-version.jar

Import your new project into an IDE

Follow the instructions below to import your new adapter project into Eclipse or IntelliJ IDEA.

Eclipse

These instructions require the Buildship Gradle Integration plugin. To install the plugin, click Help > Eclipse Marketplace and search for Buildship.

To import your project into Eclipse, follow the steps below:

  1. In Eclipse, click File > Import. The Import dialog appears.

  2. Click Existing Gradle Project. The Import Gradle Project dialog appears.

  3. Under Project location, deselect Use default location.

  4. In the Location field, select your adapter's project directory: ~/src/MyTransformerModule

  5. Click Finish.

IntelliJ IDEA

To import your project into IntelliJ IDEA, follow the steps below:

  1. Click File > New > Project from existing sources

  2. Select the project's Gradle build file: ~/src/MyTransformerModule/build.gradle

Running your JTM during development

A Java Transformer Module (JTM) can be run only within Transformer's embedded JVM; it cannot be run within your IDE. To run and debug your JTM during development, deploy your JTM to the Deployment Framework (DFW) that hosts your Transformer, and then use remote debugging to monitor its execution.

To setup remote debugging:

  1. In the Deployment Framework file global_config/overrides/servers/Transformer/etc/java.conf, set the configuration item TRANSFORMER_JVM_DEBUGGER_PORT to a valid port number.

    Note: if your Transformer is on a remote server, check that the server's firewall does not block the port number you assign to TRANSFORMER_JVM_DEBUGGER_PORT.

  2. From the root of your DFW, run the command ./dfw start Transformer to start (or restart) Transformer.

  3. In your IDE, create a 'remote debugging' configuration for your project.

    • Set the host to Transformer's network address.

    • Set the port to the number you assigned to TRANSFORMER_JVM_DEBUGGER_PORT.

To deploy your JTM:

  1. From the root of your project, run the command ./gradlew assemble. This command packages your JTM within a new service blade under the build directory.

  2. Deploy the service blade to the DFW that hosts your Transformer. For instructions on how to deploy an adapter blade to a DFW, see Deploy a custom blade.

    Tip: If you are deploying the service blade to a local DFW, then follow this tip to skip this step in future. Replace the JAR file dfw-root/active_blades/your_module/Transformer/lib/java/your_module.jar with a symlink to the JAR file generated by Gradle in the build/distributions directory.

  3. From the root of the DFW, run ./dfw start Transformer to start (or restart) Transformer.

Building and deploying the JTM's service blade

Follow the steps below to deploy your service blade:

  1. From the root of your project, run the command ./gradlew assemble. This command packages your JTM within a new service blade under the build directory.

  2. Deploy the service blade to each DFW in your deployment infrastructue. For instructions on how to deploy an adapter blade to a DFW, see Deploy a custom blade.

Issues

To report an issue with the template, please contact Caplin Support or raise an issue on GitHub.

You can’t perform that action at this time.