Integration adapters are designed to be deployed and run in the context of a Deployment Framework (DFW), not an IDE. To run your adapter within an IDE requires some extra steps, but this will save you time and allow you to use your IDE's debugging tools.
To run your adapter in your IDE, perform the following steps:
- Export your project as a config-only blade
- Deploy the config-only blade to your DFW
- Customise how Eclipse runs your adapter
A config-only blade contains all of your adapter's files except for its binary files. Your adapter project contains configuration files for Liberator and Transformer that describe the data your adapter serves. If you don't deploy these configuration files to your DFW, then Liberator and Transformer will not accept connections from your adapter and will not route subject requests to your adapter.
To export and deploy your adapter's configuration, follow the steps below:
- Open a Bash shell
Create a directory to hold new blades:
From the root directory of your CIS installation, run the CIS export command to export your adapter's configuration as a config-only blade. For example, to export the configuration for a project in directory ~/src/PricingAdapter, execute one of the commands below:
On Linux and MacOS, use Bash file paths for the project directory and the output directory:
java -jar tools/cis-blade-toolkit-version.jar export ~/src/PricingAdapter -o ~/blades --config-only
On Cygwin, use Microsoft Windows file paths for the project directory and the output directory:
java -jar tools/cis-blade-toolkit-version.jar export 'C:\\cygwin64\\home\\username\\src\\PricingAdapter' -o 'C:\\cygwin64\\home\\username\\blades' --config-only
Deploying your adapter's config-only blade creates your adapter's directory structure in the DFW, and deploys configuration files required by the adapter, Liberator, and Transformer. The configuration files provide the adapter with details of the component (Liberator or Transformer) it should connect to, and provide Liberator and Transformer with details of the data served by the adapter.
To deploy your adapter's configuration to your Deployment Framework (DFW), follow the steps below:
From the root directory of your Deployment Framework, run the command below to stop all running Platform components:
Copy your project's config-only blade to your Deployment Framework's kits directory. For example, to copy the config-only blade created in the previous section, execute the command below:
cp ~/blades/PricingAdapter-version.zip ~/DeploymentFramework-version/kits
From the root directory of your DFW, run the command below to deploy your blade:
From the root directory of your DFW, run the command below to start all Platform components:
To configure Eclipse to run your adapter, follow the steps below:
- In Eclipse, click Run > Run Configurations. The Run Configurations dialog appears.
- From the list of configuration types, right-click Java Application and select New
- In the Name box, type a name for this Run Configuration. A good choice would be the name of your adapter's project in Eclipse.
- In the Project box, click Browse, and select your adapter's project in Eclipse.
- In the Main class box, enter the fully-qualified name of the main class of your adapter.
- Click the Arguments tab
In the Working directory box, select Other, click File System, and select the path to your adapter's DataSource directory in your Deployment Framework.
If you're running Linux or MacOS, which recognise Unix symbolic links, then select the logical path to your adapter's DataSource directory:
If you're running Microsoft Windows, which does not recognise Unix symbolic links, then select the physical path to your adapter's DataSource directory:
If you created your project using the CIS Toolkit argument -i trading, then your adapter needs an additional command-line argument supplying the path to the adapter's trading-provider.properties file in your Deployment Framework. In the Program arguments field, add the following argument:
- Click the Environment tab, click New, and set a new environment variable CONFIG_BASE to the absolute path to your DFW's global config directory.
- Click the Common tab, and in Display in favorites menu, select Run.
- At the bottom of the dialog, click the Run button.
To run your adapter on subsequent occasions, click Run > Run, or press Ctrl-F11.