Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Copy the relevant bundles from Apache Aries to the <AS_HOME>/repository/components/dropins directory. The bundles you should copy depend on whether Dynamic weaving or Static weaving should be enabled as explained below.
    • For Dynamic weaving, copy the following bundles:

        • SPI Fly Dynamic Weaving Bundle

        • Aries Util

        • ASM

    • For Static weaving, copy the following bundles:

        • SPI Fly Static Weaving Bundle

        • Aries Util
  2. These bundles will provide the necessary support for SPI Fly. Along with them, you can apply your SPI providers and consumers to the dropins directory.

    Info

    Sample bundles for SPI providers and consumers are given here. Even though these are the same bundles that are provided by Aries, we have modified the client bundle to address an issue with the static weaving bundle.

  3. If Static weaving is used, it is necessary to process the consumer bundles before the provider bundles. You can do this by executing the following command on a command line:

    Code Block
    java -jar org.apache.aries.spifly.static.tool-1.0.0-jar-with-dependencies.jar <provider-bundle>.jar 

    This command will change the bytecode of the bundle so that static weaving can be used at runtime. Note that the following tool is used in the above command: org.apache.aries.spifly.static.tool.

  4. Start the server.

  5. Check the console logs and you will observe the logs from the consumer bundle that invoked the SPI provided by consumer.

See the Apache Aries documentation for samples and more information.