- Copy the relevant bundles from Apache Aries to the
<AS_HOME>/repository/components/dropinsdirectory. 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
For Static weaving, copy the following bundles:
SPI Fly Static Weaving Bundle
- Aries Util
These bundles will provide the necessary support for SPI Fly. Along with them, you can apply your SPI providers and consumers to the
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.
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:
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:
Start the server.
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.