{@link ConnectionFactoryProvider} implementations are typically discovered by {@link ConnectionFactories} from the class path using {@link ServiceLoader}. @@ -27,6 +32,15 @@ * @see ConnectionFactories * @see ServiceLoader */ + +@ServiceConsumer( + // This instance enables resolving a provider at _assembly_ without incurring a strict runtime + // dependency on Service Loader Mediator (SML) impl + cardinality = MULTIPLE, effective = "active", value = ConnectionFactoryProvider.class) +@ServiceConsumer( + // This instance enables SML to instrument ServiceLoader calls _if SML is present_ + // (without preventing the bundles from resolving if it is not) + cardinality = MULTIPLE, resolution = OPTIONAL, value = ConnectionFactoryProvider.class) public interface ConnectionFactoryProvider { /** diff --git a/r2dbc-spi/verifyOSGi.bndrun b/r2dbc-spi/verifyOSGi.bndrun new file mode 100644 index 0000000..a5d6de5 --- /dev/null +++ b/r2dbc-spi/verifyOSGi.bndrun @@ -0,0 +1,8 @@ +-runfw: org.eclipse.osgi +-resolve.effective: resolve, active + +-runsystempackages: \ + sun.misc + +-runsystemcapabilities: \ + osgi.serviceloader;osgi.serviceloader=io.r2dbc.spi.ConnectionFactoryProvider