geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rotty3...@apache.org
Subject svn commit: r1834163 - in /geronimo/specs/trunk/geronimo-jsonb_1.0_spec: pom.xml src/main/java/javax/json/bind/spi/JsonbProvider.java
Date Fri, 22 Jun 2018 21:00:39 GMT
Author: rotty3000
Date: Fri Jun 22 21:00:39 2018
New Revision: 1834163

URL: http://svn.apache.org/viewvc?rev=1834163&view=rev
Log:
GERONIMO-6610 Add service loader mediator metadata to JSONB spec

.. and remove the legacy locator code which was not used.

Signed-off-by: Raymond Auge <rotty3000@apache.org>

Modified:
    geronimo/specs/trunk/geronimo-jsonb_1.0_spec/pom.xml
    geronimo/specs/trunk/geronimo-jsonb_1.0_spec/src/main/java/javax/json/bind/spi/JsonbProvider.java

Modified: geronimo/specs/trunk/geronimo-jsonb_1.0_spec/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jsonb_1.0_spec/pom.xml?rev=1834163&r1=1834162&r2=1834163&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jsonb_1.0_spec/pom.xml (original)
+++ geronimo/specs/trunk/geronimo-jsonb_1.0_spec/pom.xml Fri Jun 22 21:00:39 2018
@@ -99,6 +99,10 @@
                         <Provide-Capability><![CDATA[
                            osgi.contract;osgi.contract=JavaJSONB;uses:="${packages;NAMED;javax.*}";version:List<Version>='1.0'
                         ]]></Provide-Capability>
+                        <Require-Capability><![CDATA[
+                          osgi.serviceloader;filter:="(osgi.serviceloader=javax.json.bind.spi.JsonbProvider)";cardinality:=multiple,
+                          osgi.extender;filter:="(osgi.extender=osgi.serviceloader.processor)"
+                        ]]></Require-Capability>
                         <_contract>JavaJSONP</_contract>
                     </instructions>
                 </configuration>

Modified: geronimo/specs/trunk/geronimo-jsonb_1.0_spec/src/main/java/javax/json/bind/spi/JsonbProvider.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jsonb_1.0_spec/src/main/java/javax/json/bind/spi/JsonbProvider.java?rev=1834163&r1=1834162&r2=1834163&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jsonb_1.0_spec/src/main/java/javax/json/bind/spi/JsonbProvider.java
(original)
+++ geronimo/specs/trunk/geronimo-jsonb_1.0_spec/src/main/java/javax/json/bind/spi/JsonbProvider.java
Fri Jun 22 21:00:39 2018
@@ -48,19 +48,6 @@ public abstract class JsonbProvider {
     }
 
     private static JsonbProvider doLoadProvider(final String providerFqn) {
-
-        final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
-        try {
-            final Class<?> clazz = Class.forName("org.apache.geronimo.osgi.locator.ProviderLocator");
-            final Method getServices = clazz.getDeclaredMethod("getServices", String.class,
Class.class, ClassLoader.class);
-            final List<JsonbProvider> osgiProviders = (List<JsonbProvider>) getServices.invoke(null,
JsonbProvider.class.getName(), JsonbProvider.class, tccl);
-            if (osgiProviders != null && !osgiProviders.isEmpty()) {
-                return osgiProviders.iterator().next();
-            }
-        } catch (final Throwable e) {
-            // locator not available, try normal mode
-        }
-
         for (final JsonbProvider provider : ServiceLoader.load(JsonbProvider.class)) {
             if (providerFqn == null) {
                 return provider;



Mime
View raw message