Developing and Packaging Multiple Adapters

A project in SDK terminology is a bundle that will be packaged and deployed to the traffic manager, and will show up as an OSGi bundle in the traffic manager.

A bundle can either package a single adapter or multiple adapters per user choice. Adapters' boiler plate code can be generated using the adapter creation script.

Developing Multiple Adapters

  • One project per adapter
./create-adapter.sh -p <New adapter project name> -c <New adapter full package name> -a <New Adapter class name>
Example
./create-adapter.sh -p DemoProject1 -c com.tibco.apim.examples1 -a DemoAdapter1
./create-adapter.sh -p DemoProject2 -c com.tibco.apim.examples2 -a DemoAdapter2
Running the above two commands will create two new projects under the extract location <extract location>/MasheryLocalSDK/ with one adapter class each.
  • Multiple adapters per project
    1. Create a new project with a new adapter class.
      ./create-adapter.sh -p <New adapter project name> -c <New adapter full package name> -a <New Adapter class name>
    2. Create an adapter class in same project.
      ./create-adapter.sh -p <Existing adapter project name> -c <Existing/New adapter full package name> -a <New Adapter class name>
    Example
    ./create-adapter.sh -p DemoProject1 -c com.tibco.apim.examples1 -a DemoAdapter1
    ./create-adapter.sh -p DemoProject1 -c com.tibco.apim.examples1 -a DemoAdapter2

    Running these two commands creates a Demo project with two adapter classes in package. com.tibco.apim.examples1.

  • Bundling Multiple adapters

    Use the build-adapters.sh script to compile; build jars and bundle them as a deployable artifact. The script ensures that the adapters are packaged properly.