Providers are extensible service modules responsible for the concrete implementation of a specific I/O type. The providers also allow separating the internal logic of the Pi4J core from the concrete implementation of the board on which they are used.
As of Pi4J 2.5 multiple providers for the same I/O type is no longer supported. During the Context initialization it will ensure only a single provider for an I/O type is loaded. In addition, the Mock Providers are not loaded unless expressly requested when creating the Context. See Create Context
We plan to remove the GpioD, LinuxFS, PiGpio providers in a next release (4.1.0?) to simplify the Pi4J codebase, remove Docker native builds of libraries, and simplify the build process. Starting from Pi4J V4 we ask you to use the FFM provider and let us know if you have any issues by creating a ticket or starting a discussion.
sudosudoAfter creating the Context the following code will print the currently loaded provider for each I/O type.
System.out.println("-------------------------------------------------");
System.out.println("PI4J PROVIDERS");
System.out.println("-------------------------------------------------");
pi4j.providers().describe().print(System.out);
System.out.println("-------------------------------------------------");