Install and build code samples
3 minute read
Install the code samples
Your installation of API Gateway includes code samples to demonstrate some of the tasks discussed in this guide, such as adding a custom filter or adding a message listener to API Gateway. The code samples are available in the
Alternatively, the associated code samples are available from Axway Support as a zip file.
This section describes how to install the code samples.
Before you install the code samples:
- You must install the API Gateway core server and Policy Studio, as the samples require certain classes that ship with these components to be on the CLASSPATH.
- To write custom message filters for API Gateway, you must install the samples on the same machine as API Gateway.
Unzip the downloaded zip file
If you downloaded the samples from Axway Support as a zip file, the zip file contains the following directory structure:
Use your preferred zip utility to unzip the file to a suitable location.
Location of code samples
DEVELOPER_SAMPLES is used throughout this guide to refer to the location of the code samples:
- If you have installed API Gateway,
DEVELOPER_SAMPLESrefers to the
- If you have installed the code samples from a zip file,
DEVELOPER_SAMPLESrefers to the location where you installed the samples (for example, the
Build the code samples
API Gateway is built with JDK 1.8. To avoid
BadClassVersion errors that might arise when deploying your sample classes with the API Gateway, you must also build the code samples with JDK 1.8.
This section describes how to build the code samples.
Build the samples
Complete the following steps to build the samples:
VORDEL_HOMEenvironment variable to point to the root of your Axway API Gateway installation.
For example, if you installed API Gateway in
VORDEL_HOMEto this directory.
POLICYSTUDIO_HOMEenvironment variable to point to the root of your Policy Studio installation.
For example, if you installed Policy Studio in
POLICYSTUDIO_HOMEto this directory.
JAVA_HOMEenvironment variable to point to the root of a JDK 1.8 installation.
JUNIT_HOMEenvironment variable to point to the directory containing your JUnit JAR file. The required version is 4.8.2.
Add Apache Ant to your
PATHenvironment variable. For example, if Apache Ant is installed in
PATH. See the Apache Ant website for more information on Apache Ant.
Change to the directory where the sample is installed. Each sample is installed under
README.TXTfile and follow the instructions to build and run the sample.
Description of samples
The following code samples are included:
DEVELOPER_SAMPLES/FilterInterceptorLoadableModule– Sample classes that implement Java interfaces. For more information, see Java interfaces for extending API Gateway.