You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by cs...@apache.org on 2018/01/30 08:24:01 UTC
aries-jax-rs-whiteboard git commit: Harmonize capitalization
Repository: aries-jax-rs-whiteboard
Updated Branches:
refs/heads/master 8ef88acf2 -> d9a83a05d
Harmonize capitalization
Project: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/commit/d9a83a05
Tree: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/tree/d9a83a05
Diff: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/diff/d9a83a05
Branch: refs/heads/master
Commit: d9a83a05d2fea6712a5738f3e0a675da029871af
Parents: 8ef88ac
Author: Carlos Sierra <cs...@apache.org>
Authored: Tue Jan 30 09:23:38 2018 +0100
Committer: Carlos Sierra <cs...@apache.org>
Committed: Tue Jan 30 09:23:38 2018 +0100
----------------------------------------------------------------------
jax-rs.whiteboard/bnd.bnd | 2 +-
.../AriesJaxRSWhiteboardConstants.java | 35 --
.../AriesJaxrsWhiteboardConstants.java | 33 ++
.../activator/CXFJaxRsBundleActivator.java | 161 ---------
.../activator/CxfJaxrsBundleActivator.java | 161 +++++++++
.../internal/AriesJaxRSServiceRuntime.java | 8 +-
.../internal/CXFJaxRsServiceRegistrator.java | 338 -------------------
.../internal/CxfJaxrsServiceRegistrator.java | 338 +++++++++++++++++++
.../jax/rs/whiteboard/internal/Whiteboard.java | 28 +-
9 files changed, 551 insertions(+), 553 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/d9a83a05/jax-rs.whiteboard/bnd.bnd
----------------------------------------------------------------------
diff --git a/jax-rs.whiteboard/bnd.bnd b/jax-rs.whiteboard/bnd.bnd
index 4e5ccd6..643ed8c 100644
--- a/jax-rs.whiteboard/bnd.bnd
+++ b/jax-rs.whiteboard/bnd.bnd
@@ -1,4 +1,4 @@
-Bundle-Activator: org.apache.aries.jax.rs.whiteboard.activator.CXFJaxRsBundleActivator
+Bundle-Activator: org.apache.aries.jax.rs.whiteboard.activator.CxfJaxrsBundleActivator
Provide-Capability: \
osgi.implementation; \
osgi.implementation='aries.jax-rs'; \
http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/d9a83a05/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/AriesJaxRSWhiteboardConstants.java
----------------------------------------------------------------------
diff --git a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/AriesJaxRSWhiteboardConstants.java b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/AriesJaxRSWhiteboardConstants.java
deleted file mode 100644
index f74123c..0000000
--- a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/AriesJaxRSWhiteboardConstants.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.aries.jax.rs.whiteboard;
-
-import java.nio.file.DirectoryStream.Filter;
-
-public class AriesJaxRSWhiteboardConstants {
-
- /**
- * A Service property specifying a target filter used to select
- * an Application onto which to bind the service.
- * <p>
- * If this service property is not specified, the service is ignored.
- * <p>
- * The value of this service property must be of type {@code String} and be
- * a valid {@link Filter filter string}.
- */
- public static final String JAX_RS_APPLICATION_SELECT = "org.apache.aries.jaxrs.application.select";
-
-}
http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/d9a83a05/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/AriesJaxrsWhiteboardConstants.java
----------------------------------------------------------------------
diff --git a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/AriesJaxrsWhiteboardConstants.java b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/AriesJaxrsWhiteboardConstants.java
new file mode 100644
index 0000000..94b4ff4
--- /dev/null
+++ b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/AriesJaxrsWhiteboardConstants.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.aries.jax.rs.whiteboard;
+
+public class AriesJaxrsWhiteboardConstants {
+
+ /**
+ * A Service property specifying a target filter used to select
+ * an Application onto which to bind the service.
+ * <p>
+ * If this service property is not specified, the service is ignored.
+ * <p>
+ * The value of this service property must be of type {@code String} and be
+ * a valid {@link org.osgi.framework.Filter filter string}.
+ */
+ public static final String JAX_RS_APPLICATION_SELECT = "org.apache.aries.jaxrs.application.select";
+
+}
http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/d9a83a05/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CXFJaxRsBundleActivator.java
----------------------------------------------------------------------
diff --git a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CXFJaxRsBundleActivator.java b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CXFJaxRsBundleActivator.java
deleted file mode 100644
index 6ec4532..0000000
--- a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CXFJaxRsBundleActivator.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.aries.jax.rs.whiteboard.activator;
-
-import java.util.Arrays;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.List;
-
-import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.ext.RuntimeDelegate;
-
-import org.apache.aries.jax.rs.whiteboard.internal.ClientBuilderFactory;
-import org.apache.aries.jax.rs.whiteboard.internal.Utils.PropertyHolder;
-import org.apache.aries.osgi.functional.OSGi;
-import org.apache.aries.osgi.functional.OSGiResult;
-import org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.service.http.runtime.HttpServiceRuntime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static java.lang.String.format;
-import static org.apache.aries.jax.rs.whiteboard.internal.Utils.canonicalize;
-import static org.apache.aries.jax.rs.whiteboard.internal.Utils.ignoreResult;
-import static org.apache.aries.jax.rs.whiteboard.internal.Whiteboard.createWhiteboard;
-import static org.apache.aries.osgi.functional.OSGi.all;
-import static org.apache.aries.osgi.functional.OSGi.configurations;
-import static org.apache.aries.osgi.functional.OSGi.effects;
-import static org.apache.aries.osgi.functional.OSGi.ignore;
-import static org.apache.aries.osgi.functional.OSGi.just;
-import static org.apache.aries.osgi.functional.OSGi.once;
-import static org.apache.aries.osgi.functional.OSGi.register;
-import static org.apache.aries.osgi.functional.OSGi.serviceReferences;
-import static org.osgi.service.http.runtime.HttpServiceRuntimeConstants.HTTP_SERVICE_ENDPOINT;
-import static org.osgi.service.http.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_TARGET;
-
-public class CXFJaxRsBundleActivator implements BundleActivator {
-
- private static final Logger _log = LoggerFactory.getLogger(
- CXFJaxRsBundleActivator.class);
-
- static {
- RuntimeDelegate.setInstance(new RuntimeDelegateImpl());
- }
-
- @Override
- public void start(BundleContext bundleContext) throws Exception {
- if (_log.isDebugEnabled()) {
- _log.debug("Starting the whiteboard factory");
- }
-
- OSGi<?> whiteboards =
- configurations("org.apache.aries.jax.rs.whiteboard").flatMap(
- configuration -> runWhiteboard(bundleContext, configuration)
- );
-
- _whiteboardsResult = whiteboards.run(bundleContext);
-
- Dictionary<String, Object> defaultConfiguration = new Hashtable<>();
-
- defaultConfiguration.put(
- Constants.SERVICE_PID,
- "org.apache.aries.jax.rs.whiteboard.default");
-
- _defaultOSGiResult =
- all(
- ignoreResult(
- register(
- ClientBuilder.class, new ClientBuilderFactory(), null)),
- ignoreResult(runWhiteboard(bundleContext, defaultConfiguration))
- )
- .run(bundleContext);
-
- if (_log.isDebugEnabled()) {
- _log.debug("Whiteboard factory started");
- }
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- if (_log.isDebugEnabled()) {
- _log.debug("Stopping whiteboard factory");
- }
-
- _defaultOSGiResult.close();
-
- _whiteboardsResult.close();
-
- if (_log.isDebugEnabled()) {
- _log.debug("Stopped whiteboard factory");
- }
- }
- private OSGiResult _defaultOSGiResult;
- private OSGiResult _whiteboardsResult;
-
- private static String endpointFilter(PropertyHolder configuration ) {
-
- Object whiteBoardTargetProperty = configuration.get(
- HTTP_WHITEBOARD_TARGET);
-
- String targetFilter =
- whiteBoardTargetProperty != null ?
- whiteBoardTargetProperty.toString() :
- "(osgi.http.endpoint=*)";
-
-
- return format(
- "(&(objectClass=%s)%s)", HttpServiceRuntime.class.getName(),
- targetFilter);
- }
-
- private static OSGi<?> runWhiteboard(
- BundleContext bundleContext, Dictionary<String, ?> configuration) {
-
- OSGi<List<String>> endpoints =
- serviceReferences(endpointFilter(configuration::get)
- ).map(
- r -> Arrays.asList(
- canonicalize(r.getProperty(HTTP_SERVICE_ENDPOINT)))
- );
-
- return
- once(
- serviceReferences(
- endpointFilter(configuration::get),
- __ -> false //never reload
- ).then(
- just(createWhiteboard(bundleContext, configuration))
- .flatMap(
- whiteboard ->
- all(
- ignore(
- endpoints.effects(
- whiteboard::addHttpEndpoints,
- whiteboard::removeHttpEndpoints)
- ),
- effects(whiteboard::start, whiteboard::stop)
- )
- ))
- );
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/d9a83a05/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CxfJaxrsBundleActivator.java
----------------------------------------------------------------------
diff --git a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CxfJaxrsBundleActivator.java b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CxfJaxrsBundleActivator.java
new file mode 100644
index 0000000..e9b58ba
--- /dev/null
+++ b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/activator/CxfJaxrsBundleActivator.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.aries.jax.rs.whiteboard.activator;
+
+import java.util.Arrays;
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.List;
+
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.ext.RuntimeDelegate;
+
+import org.apache.aries.jax.rs.whiteboard.internal.ClientBuilderFactory;
+import org.apache.aries.jax.rs.whiteboard.internal.Utils.PropertyHolder;
+import org.apache.aries.osgi.functional.OSGi;
+import org.apache.aries.osgi.functional.OSGiResult;
+import org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.service.http.runtime.HttpServiceRuntime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static java.lang.String.format;
+import static org.apache.aries.jax.rs.whiteboard.internal.Utils.canonicalize;
+import static org.apache.aries.jax.rs.whiteboard.internal.Utils.ignoreResult;
+import static org.apache.aries.jax.rs.whiteboard.internal.Whiteboard.createWhiteboard;
+import static org.apache.aries.osgi.functional.OSGi.all;
+import static org.apache.aries.osgi.functional.OSGi.configurations;
+import static org.apache.aries.osgi.functional.OSGi.effects;
+import static org.apache.aries.osgi.functional.OSGi.ignore;
+import static org.apache.aries.osgi.functional.OSGi.just;
+import static org.apache.aries.osgi.functional.OSGi.once;
+import static org.apache.aries.osgi.functional.OSGi.register;
+import static org.apache.aries.osgi.functional.OSGi.serviceReferences;
+import static org.osgi.service.http.runtime.HttpServiceRuntimeConstants.HTTP_SERVICE_ENDPOINT;
+import static org.osgi.service.http.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_TARGET;
+
+public class CxfJaxrsBundleActivator implements BundleActivator {
+
+ private static final Logger _log = LoggerFactory.getLogger(
+ CxfJaxrsBundleActivator.class);
+
+ static {
+ RuntimeDelegate.setInstance(new RuntimeDelegateImpl());
+ }
+
+ @Override
+ public void start(BundleContext bundleContext) throws Exception {
+ if (_log.isDebugEnabled()) {
+ _log.debug("Starting the whiteboard factory");
+ }
+
+ OSGi<?> whiteboards =
+ configurations("org.apache.aries.jax.rs.whiteboard").flatMap(
+ configuration -> runWhiteboard(bundleContext, configuration)
+ );
+
+ _whiteboardsResult = whiteboards.run(bundleContext);
+
+ Dictionary<String, Object> defaultConfiguration = new Hashtable<>();
+
+ defaultConfiguration.put(
+ Constants.SERVICE_PID,
+ "org.apache.aries.jax.rs.whiteboard.default");
+
+ _defaultOSGiResult =
+ all(
+ ignoreResult(
+ register(
+ ClientBuilder.class, new ClientBuilderFactory(), null)),
+ ignoreResult(runWhiteboard(bundleContext, defaultConfiguration))
+ )
+ .run(bundleContext);
+
+ if (_log.isDebugEnabled()) {
+ _log.debug("Whiteboard factory started");
+ }
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ if (_log.isDebugEnabled()) {
+ _log.debug("Stopping whiteboard factory");
+ }
+
+ _defaultOSGiResult.close();
+
+ _whiteboardsResult.close();
+
+ if (_log.isDebugEnabled()) {
+ _log.debug("Stopped whiteboard factory");
+ }
+ }
+ private OSGiResult _defaultOSGiResult;
+ private OSGiResult _whiteboardsResult;
+
+ private static String endpointFilter(PropertyHolder configuration ) {
+
+ Object whiteBoardTargetProperty = configuration.get(
+ HTTP_WHITEBOARD_TARGET);
+
+ String targetFilter =
+ whiteBoardTargetProperty != null ?
+ whiteBoardTargetProperty.toString() :
+ "(osgi.http.endpoint=*)";
+
+
+ return format(
+ "(&(objectClass=%s)%s)", HttpServiceRuntime.class.getName(),
+ targetFilter);
+ }
+
+ private static OSGi<?> runWhiteboard(
+ BundleContext bundleContext, Dictionary<String, ?> configuration) {
+
+ OSGi<List<String>> endpoints =
+ serviceReferences(endpointFilter(configuration::get)
+ ).map(
+ r -> Arrays.asList(
+ canonicalize(r.getProperty(HTTP_SERVICE_ENDPOINT)))
+ );
+
+ return
+ once(
+ serviceReferences(
+ endpointFilter(configuration::get),
+ __ -> false //never reload
+ ).then(
+ just(createWhiteboard(bundleContext, configuration))
+ .flatMap(
+ whiteboard ->
+ all(
+ ignore(
+ endpoints.effects(
+ whiteboard::addHttpEndpoints,
+ whiteboard::removeHttpEndpoints)
+ ),
+ effects(whiteboard::start, whiteboard::stop)
+ )
+ ))
+ );
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/d9a83a05/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/AriesJaxRSServiceRuntime.java
----------------------------------------------------------------------
diff --git a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/AriesJaxRSServiceRuntime.java b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/AriesJaxRSServiceRuntime.java
index ebfeb1a..af06485 100644
--- a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/AriesJaxRSServiceRuntime.java
+++ b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/AriesJaxRSServiceRuntime.java
@@ -341,7 +341,7 @@ public class AriesJaxrsServiceRuntime implements JaxrsServiceRuntime {
public ApplicationRuntimeInformation setApplicationForPath(
String path,
CachingServiceReference<Application> serviceReference,
- CXFJaxRsServiceRegistrator cxfJaxRsServiceRegistrator) {
+ CxfJaxrsServiceRegistrator cxfJaxRsServiceRegistrator) {
ApplicationRuntimeInformation ari = new ApplicationRuntimeInformation(
serviceReference, cxfJaxRsServiceRegistrator);
@@ -544,7 +544,7 @@ public class AriesJaxrsServiceRuntime implements JaxrsServiceRuntime {
ExtensionDTO[]::new
);
- CXFJaxRsServiceRegistrator cxfJaxRsServiceRegistrator =
+ CxfJaxrsServiceRegistrator cxfJaxRsServiceRegistrator =
ari._cxfJaxRsServiceRegistrator;
Bus bus = cxfJaxRsServiceRegistrator.getBus();
@@ -736,7 +736,7 @@ public class AriesJaxrsServiceRuntime implements JaxrsServiceRuntime {
private static class ApplicationRuntimeInformation {
public ApplicationRuntimeInformation(
CachingServiceReference cachingServiceReference,
- CXFJaxRsServiceRegistrator cxfJaxRsServiceRegistrator) {
+ CxfJaxrsServiceRegistrator cxfJaxRsServiceRegistrator) {
_cachingServiceReference = cachingServiceReference;
_cxfJaxRsServiceRegistrator = cxfJaxRsServiceRegistrator;
@@ -759,7 +759,7 @@ public class AriesJaxrsServiceRuntime implements JaxrsServiceRuntime {
}
CachingServiceReference _cachingServiceReference;
- CXFJaxRsServiceRegistrator _cxfJaxRsServiceRegistrator;
+ CxfJaxrsServiceRegistrator _cxfJaxRsServiceRegistrator;
}
http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/d9a83a05/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/CXFJaxRsServiceRegistrator.java
----------------------------------------------------------------------
diff --git a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/CXFJaxRsServiceRegistrator.java b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/CXFJaxRsServiceRegistrator.java
deleted file mode 100644
index a92f714..0000000
--- a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/CXFJaxRsServiceRegistrator.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.aries.jax.rs.whiteboard.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeSet;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import javax.ws.rs.RuntimeType;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.core.Feature;
-import javax.ws.rs.core.FeatureContext;
-import javax.ws.rs.ext.RuntimeDelegate;
-
-import org.apache.aries.jax.rs.whiteboard.internal.Utils.ServiceReferenceResourceProvider;
-import org.apache.aries.jax.rs.whiteboard.internal.Utils.ServiceTuple;
-import org.apache.aries.osgi.functional.CachingServiceReference;
-import org.apache.cxf.Bus;
-import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
-import org.apache.cxf.jaxrs.JAXRSServiceFactoryBean;
-import org.apache.cxf.jaxrs.ext.ResourceComparator;
-import org.apache.cxf.jaxrs.impl.ConfigurableImpl;
-import org.apache.cxf.jaxrs.lifecycle.ResourceProvider;
-import org.apache.cxf.jaxrs.model.ApplicationInfo;
-import org.apache.cxf.jaxrs.model.ClassResourceInfo;
-import org.apache.cxf.jaxrs.model.OperationResourceInfo;
-import org.apache.cxf.jaxrs.provider.ServerConfigurableFactory;
-import org.apache.cxf.message.Message;
-import org.osgi.framework.ServiceReference;
-
-import static org.apache.aries.jax.rs.whiteboard.internal.Utils.canonicalize;
-
-public class CXFJaxRsServiceRegistrator {
-
- public CXFJaxRsServiceRegistrator(
- Bus bus, Application application, Map<String, Object> properties) {
- _bus = bus;
- _application = application;
- _properties = Collections.unmodifiableMap(new HashMap<>(properties));
-
- Comparator<ServiceTuple<?>> comparing = Comparator.comparing(
- ServiceTuple::getCachingServiceReference);
-
- _providers = new TreeSet<>(comparing);
-
- rewire();
- }
-
- public Bus getBus() {
- return _bus;
- }
-
- public void add(ResourceProvider resourceProvider) {
- if (_closed) {
- return;
- }
-
- _services.add(resourceProvider);
-
- try {
- rewire();
- }
- catch (Exception e) {
- remove(resourceProvider);
-
- throw e;
- }
- }
-
- public void addProvider(ServiceTuple<?> tuple) {
- if (_closed) {
- return;
- }
-
- _providers.add(tuple);
-
- try {
- rewire();
- }
- catch (Exception e) {
- removeProvider(tuple);
-
- throw e;
- }
-
- }
-
- public void close() {
- if (_closed) {
- return;
- }
-
- if (_server != null) {
- _server.destroy();
- }
-
- _closed = true;
- }
-
- public <T> T createEndpoint(Application app, Class<T> endpointType) {
- JAXRSServerFactoryBean bean =
- RuntimeDelegate.getInstance().createEndpoint(
- app, JAXRSServerFactoryBean.class);
-
- if (JAXRSServerFactoryBean.class.isAssignableFrom(endpointType)) {
- return endpointType.cast(bean);
- }
- bean.setStart(false);
- Server server = bean.create();
- return endpointType.cast(server);
- }
-
- public void remove(ResourceProvider resourceProvider) {
- if (_closed) {
- return;
- }
-
- _services.remove(resourceProvider);
-
- rewire();
- }
-
- public void removeProvider(ServiceTuple<?> tuple) {
- if (_closed) {
- return;
- }
-
- _providers.remove(tuple);
-
- rewire();
- }
-
- private final Application _application;
- private final Bus _bus;
- private final Collection<ServiceTuple<?>> _providers;
- private final Collection<ResourceProvider> _services = new ArrayList<>();
- private Map<String, Object> _properties;
- private volatile boolean _closed = false;
- private Server _server;
- private JAXRSServerFactoryBean _jaxRsServerFactoryBean;
-
- private static class ComparableResourceComparator
- implements ResourceComparator {
-
- static {
- comparator = Comparator.comparing(
- srrp -> srrp.getImmutableServiceReference());
- }
-
- @Override
- public int compare(
- ClassResourceInfo cri1, ClassResourceInfo cri2, Message message) {
-
- ResourceProvider rp1 = cri1.getResourceProvider();
- ResourceProvider rp2 = cri2.getResourceProvider();
-
- if (rp1 instanceof ServiceReferenceResourceProvider &&
- rp2 instanceof ServiceReferenceResourceProvider) {
-
- return comparator.compare(
- (ServiceReferenceResourceProvider)rp2,
- (ServiceReferenceResourceProvider)rp1);
- }
-
- if (rp1 instanceof ServiceReferenceResourceProvider) {
- return -1;
- }
-
- if (rp2 instanceof ServiceReferenceResourceProvider) {
- return 1;
- }
-
- return 0;
- }
-
- @Override
- public int compare(
- OperationResourceInfo oper1, OperationResourceInfo oper2,
- Message message) {
-
- return 0;
- }
- private static Comparator<ServiceReferenceResourceProvider> comparator;
-
- }
-
- protected synchronized void rewire() {
- if (_server != null) {
- _server.destroy();
- }
-
- if (_services.isEmpty() &&
- _application.getSingletons().isEmpty() &&
- _application.getClasses().isEmpty()) {
-
- return;
- }
-
- _jaxRsServerFactoryBean = createEndpoint(
- _application, JAXRSServerFactoryBean.class);
-
- _jaxRsServerFactoryBean.setBus(_bus);
-
- _bus.setExtension(
- context -> {
- ConfigurableImpl<FeatureContext> configurable =
- new ConfigurableImpl<>(
- context, RuntimeType.SERVER,
- ServerConfigurableFactory.
- SERVER_FILTER_INTERCEPTOR_CLASSES);
-
- configurable.property(
- "osgi.jaxrs.application.serviceProperties", _properties);
-
- return configurable;
- },
- ServerConfigurableFactory.class);
-
- _jaxRsServerFactoryBean.setStart(false);
-
- _jaxRsServerFactoryBean.setProvider(
- (Feature) featureContext -> {
- for (ServiceTuple<?> provider : _providers) {
- CachingServiceReference<?> cachingServiceReference =
- provider.getCachingServiceReference();
-
- ServiceReference<?> serviceReference =
- cachingServiceReference.getServiceReference();
-
- int ranking = Utils.getRanking(cachingServiceReference);
-
- String[] interfaces = canonicalize(
- serviceReference.getProperty("objectClass"));
-
- if (ranking != 0) {
- Map<Class<?>, Integer> classesWithPriorities=
- Arrays.stream(interfaces).flatMap(
- className -> {
- try {
- return Stream.of(
- Class.forName(className));
- }
- catch (ClassNotFoundException e) {
- return Stream.empty();
- }
- }
- ).collect(
- Collectors.toMap(c -> c, __ -> ranking)
- );
-
- featureContext.register(
- provider.getService(), classesWithPriorities);
- }
- else {
- for (String className : interfaces) {
- try {
- featureContext.register(
- provider.getService(),
- Class.forName(className));
- }
- catch (ClassNotFoundException e) {
- }
- }
- }
-
- }
-
- return true;
- });
-
- for (ResourceProvider resourceProvider: _services) {
- _jaxRsServerFactoryBean.setResourceProvider(resourceProvider);
- }
-
- if (_jaxRsServerFactoryBean.getResourceClasses().isEmpty()) {
- return;
- }
-
- _jaxRsServerFactoryBean.setResourceComparator(
- new ComparableResourceComparator());
-
- _server = _jaxRsServerFactoryBean.create();
-
- ApplicationInfo applicationInfo = (ApplicationInfo)
- _server.getEndpoint().get(Application.class.getName());
-
- applicationInfo.setOverridingProps(new HashMap<String, Object>() {{
- put("osgi.jaxrs.application.serviceProperties", _properties);
- }});
-
- _server.start();
- }
-
- protected Iterable<Class<?>> getStaticResourceClasses() {
- JAXRSServiceFactoryBean serviceFactory =
- _jaxRsServerFactoryBean.getServiceFactory();
-
- List<ClassResourceInfo> classResourceInfo =
- serviceFactory.getClassResourceInfo();
-
- ArrayList<Class<?>> classes = new ArrayList<>();
-
- for (ClassResourceInfo resourceInfo : classResourceInfo) {
- if (!ServiceReferenceResourceProvider.class.isAssignableFrom(
- resourceInfo.getResourceProvider().getClass())) {
-
- classes.add(resourceInfo.getResourceClass());
- }
- }
-
- return classes;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/d9a83a05/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/CxfJaxrsServiceRegistrator.java
----------------------------------------------------------------------
diff --git a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/CxfJaxrsServiceRegistrator.java b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/CxfJaxrsServiceRegistrator.java
new file mode 100644
index 0000000..6318904
--- /dev/null
+++ b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/CxfJaxrsServiceRegistrator.java
@@ -0,0 +1,338 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.aries.jax.rs.whiteboard.internal;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeSet;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import javax.ws.rs.RuntimeType;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.core.Feature;
+import javax.ws.rs.core.FeatureContext;
+import javax.ws.rs.ext.RuntimeDelegate;
+
+import org.apache.aries.jax.rs.whiteboard.internal.Utils.ServiceReferenceResourceProvider;
+import org.apache.aries.jax.rs.whiteboard.internal.Utils.ServiceTuple;
+import org.apache.aries.osgi.functional.CachingServiceReference;
+import org.apache.cxf.Bus;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
+import org.apache.cxf.jaxrs.JAXRSServiceFactoryBean;
+import org.apache.cxf.jaxrs.ext.ResourceComparator;
+import org.apache.cxf.jaxrs.impl.ConfigurableImpl;
+import org.apache.cxf.jaxrs.lifecycle.ResourceProvider;
+import org.apache.cxf.jaxrs.model.ApplicationInfo;
+import org.apache.cxf.jaxrs.model.ClassResourceInfo;
+import org.apache.cxf.jaxrs.model.OperationResourceInfo;
+import org.apache.cxf.jaxrs.provider.ServerConfigurableFactory;
+import org.apache.cxf.message.Message;
+import org.osgi.framework.ServiceReference;
+
+import static org.apache.aries.jax.rs.whiteboard.internal.Utils.canonicalize;
+
+public class CxfJaxrsServiceRegistrator {
+
+ public CxfJaxrsServiceRegistrator(
+ Bus bus, Application application, Map<String, Object> properties) {
+ _bus = bus;
+ _application = application;
+ _properties = Collections.unmodifiableMap(new HashMap<>(properties));
+
+ Comparator<ServiceTuple<?>> comparing = Comparator.comparing(
+ ServiceTuple::getCachingServiceReference);
+
+ _providers = new TreeSet<>(comparing);
+
+ rewire();
+ }
+
+ public Bus getBus() {
+ return _bus;
+ }
+
+ public void add(ResourceProvider resourceProvider) {
+ if (_closed) {
+ return;
+ }
+
+ _services.add(resourceProvider);
+
+ try {
+ rewire();
+ }
+ catch (Exception e) {
+ remove(resourceProvider);
+
+ throw e;
+ }
+ }
+
+ public void addProvider(ServiceTuple<?> tuple) {
+ if (_closed) {
+ return;
+ }
+
+ _providers.add(tuple);
+
+ try {
+ rewire();
+ }
+ catch (Exception e) {
+ removeProvider(tuple);
+
+ throw e;
+ }
+
+ }
+
+ public void close() {
+ if (_closed) {
+ return;
+ }
+
+ if (_server != null) {
+ _server.destroy();
+ }
+
+ _closed = true;
+ }
+
+ public <T> T createEndpoint(Application app, Class<T> endpointType) {
+ JAXRSServerFactoryBean bean =
+ RuntimeDelegate.getInstance().createEndpoint(
+ app, JAXRSServerFactoryBean.class);
+
+ if (JAXRSServerFactoryBean.class.isAssignableFrom(endpointType)) {
+ return endpointType.cast(bean);
+ }
+ bean.setStart(false);
+ Server server = bean.create();
+ return endpointType.cast(server);
+ }
+
+ public void remove(ResourceProvider resourceProvider) {
+ if (_closed) {
+ return;
+ }
+
+ _services.remove(resourceProvider);
+
+ rewire();
+ }
+
+ public void removeProvider(ServiceTuple<?> tuple) {
+ if (_closed) {
+ return;
+ }
+
+ _providers.remove(tuple);
+
+ rewire();
+ }
+
+ private final Application _application;
+ private final Bus _bus;
+ private final Collection<ServiceTuple<?>> _providers;
+ private final Collection<ResourceProvider> _services = new ArrayList<>();
+ private Map<String, Object> _properties;
+ private volatile boolean _closed = false;
+ private Server _server;
+ private JAXRSServerFactoryBean _jaxRsServerFactoryBean;
+
+ private static class ComparableResourceComparator
+ implements ResourceComparator {
+
+ static {
+ comparator = Comparator.comparing(
+ srrp -> srrp.getImmutableServiceReference());
+ }
+
+ @Override
+ public int compare(
+ ClassResourceInfo cri1, ClassResourceInfo cri2, Message message) {
+
+ ResourceProvider rp1 = cri1.getResourceProvider();
+ ResourceProvider rp2 = cri2.getResourceProvider();
+
+ if (rp1 instanceof ServiceReferenceResourceProvider &&
+ rp2 instanceof ServiceReferenceResourceProvider) {
+
+ return comparator.compare(
+ (ServiceReferenceResourceProvider)rp2,
+ (ServiceReferenceResourceProvider)rp1);
+ }
+
+ if (rp1 instanceof ServiceReferenceResourceProvider) {
+ return -1;
+ }
+
+ if (rp2 instanceof ServiceReferenceResourceProvider) {
+ return 1;
+ }
+
+ return 0;
+ }
+
+ @Override
+ public int compare(
+ OperationResourceInfo oper1, OperationResourceInfo oper2,
+ Message message) {
+
+ return 0;
+ }
+ private static Comparator<ServiceReferenceResourceProvider> comparator;
+
+ }
+
+ protected synchronized void rewire() {
+ if (_server != null) {
+ _server.destroy();
+ }
+
+ if (_services.isEmpty() &&
+ _application.getSingletons().isEmpty() &&
+ _application.getClasses().isEmpty()) {
+
+ return;
+ }
+
+ _jaxRsServerFactoryBean = createEndpoint(
+ _application, JAXRSServerFactoryBean.class);
+
+ _jaxRsServerFactoryBean.setBus(_bus);
+
+ _bus.setExtension(
+ context -> {
+ ConfigurableImpl<FeatureContext> configurable =
+ new ConfigurableImpl<>(
+ context, RuntimeType.SERVER,
+ ServerConfigurableFactory.
+ SERVER_FILTER_INTERCEPTOR_CLASSES);
+
+ configurable.property(
+ "osgi.jaxrs.application.serviceProperties", _properties);
+
+ return configurable;
+ },
+ ServerConfigurableFactory.class);
+
+ _jaxRsServerFactoryBean.setStart(false);
+
+ _jaxRsServerFactoryBean.setProvider(
+ (Feature) featureContext -> {
+ for (ServiceTuple<?> provider : _providers) {
+ CachingServiceReference<?> cachingServiceReference =
+ provider.getCachingServiceReference();
+
+ ServiceReference<?> serviceReference =
+ cachingServiceReference.getServiceReference();
+
+ int ranking = Utils.getRanking(cachingServiceReference);
+
+ String[] interfaces = canonicalize(
+ serviceReference.getProperty("objectClass"));
+
+ if (ranking != 0) {
+ Map<Class<?>, Integer> classesWithPriorities=
+ Arrays.stream(interfaces).flatMap(
+ className -> {
+ try {
+ return Stream.of(
+ Class.forName(className));
+ }
+ catch (ClassNotFoundException e) {
+ return Stream.empty();
+ }
+ }
+ ).collect(
+ Collectors.toMap(c -> c, __ -> ranking)
+ );
+
+ featureContext.register(
+ provider.getService(), classesWithPriorities);
+ }
+ else {
+ for (String className : interfaces) {
+ try {
+ featureContext.register(
+ provider.getService(),
+ Class.forName(className));
+ }
+ catch (ClassNotFoundException e) {
+ }
+ }
+ }
+
+ }
+
+ return true;
+ });
+
+ for (ResourceProvider resourceProvider: _services) {
+ _jaxRsServerFactoryBean.setResourceProvider(resourceProvider);
+ }
+
+ if (_jaxRsServerFactoryBean.getResourceClasses().isEmpty()) {
+ return;
+ }
+
+ _jaxRsServerFactoryBean.setResourceComparator(
+ new ComparableResourceComparator());
+
+ _server = _jaxRsServerFactoryBean.create();
+
+ ApplicationInfo applicationInfo = (ApplicationInfo)
+ _server.getEndpoint().get(Application.class.getName());
+
+ applicationInfo.setOverridingProps(new HashMap<String, Object>() {{
+ put("osgi.jaxrs.application.serviceProperties", _properties);
+ }});
+
+ _server.start();
+ }
+
+ protected Iterable<Class<?>> getStaticResourceClasses() {
+ JAXRSServiceFactoryBean serviceFactory =
+ _jaxRsServerFactoryBean.getServiceFactory();
+
+ List<ClassResourceInfo> classResourceInfo =
+ serviceFactory.getClassResourceInfo();
+
+ ArrayList<Class<?>> classes = new ArrayList<>();
+
+ for (ClassResourceInfo resourceInfo : classResourceInfo) {
+ if (!ServiceReferenceResourceProvider.class.isAssignableFrom(
+ resourceInfo.getResourceProvider().getClass())) {
+
+ classes.add(resourceInfo.getResourceClass());
+ }
+ }
+
+ return classes;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/d9a83a05/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Whiteboard.java
----------------------------------------------------------------------
diff --git a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Whiteboard.java b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Whiteboard.java
index 17e9d80..5b473a5 100644
--- a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Whiteboard.java
+++ b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/Whiteboard.java
@@ -288,13 +288,13 @@ public class Whiteboard {
return bus;
}
- private OSGi<CachingServiceReference<CXFJaxRsServiceRegistrator>>
+ private OSGi<CachingServiceReference<CxfJaxrsServiceRegistrator>>
defaultApplication() {
return
highest(
serviceReferences(
- CXFJaxRsServiceRegistrator.class,
+ CxfJaxrsServiceRegistrator.class,
String.format("(%s=%s)", JAX_RS_NAME, DEFAULT_NAME)
).filter(
new TargetFilter<>(_runtimeReference)
@@ -302,7 +302,7 @@ public class Whiteboard {
);
}
- private OSGi<CXFJaxRsServiceRegistrator> deployApplication(
+ private OSGi<CxfJaxrsServiceRegistrator> deployApplication(
ServiceTuple<Application> tuple) {
return
@@ -326,16 +326,16 @@ public class Whiteboard {
))));
}
- private OSGi<CXFJaxRsServiceRegistrator> deployRegistrator(
+ private OSGi<CxfJaxrsServiceRegistrator> deployRegistrator(
Bus bus, ServiceTuple<Application> tuple,
Map<String, Object> props) {
return
just(() ->
- new CXFJaxRsServiceRegistrator(bus, tuple.getService(), props)).
+ new CxfJaxrsServiceRegistrator(bus, tuple.getService(), props)).
flatMap(registrator ->
onClose(registrator::close).then(
- register(CXFJaxRsServiceRegistrator.class, registrator, props).then(
+ register(CxfJaxrsServiceRegistrator.class, registrator, props).then(
just(registrator)
)));
}
@@ -418,7 +418,7 @@ public class Whiteboard {
private <T> OSGi<?> safeRegisterEndpoint(
CachingServiceReference<T> serviceReference,
- CachingServiceReference<CXFJaxRsServiceRegistrator>
+ CachingServiceReference<CxfJaxrsServiceRegistrator>
registratorReference) {
String applicationName = getApplicationName(
@@ -454,7 +454,7 @@ public class Whiteboard {
private OSGi<?> safeRegisterExtension(
CachingServiceReference<?> serviceReference,
- CachingServiceReference<CXFJaxRsServiceRegistrator> registratorReference) {
+ CachingServiceReference<CxfJaxrsServiceRegistrator> registratorReference) {
return
just(() -> getApplicationName(registratorReference::getProperty)).
@@ -573,7 +573,7 @@ public class Whiteboard {
private OSGi<?> waitForExtensionDependencies(
CachingServiceReference<?> serviceReference,
- CachingServiceReference<CXFJaxRsServiceRegistrator>
+ CachingServiceReference<CxfJaxrsServiceRegistrator>
applicationRegistratorReference,
Consumer<CachingServiceReference<?>> onAddingDependent,
Consumer<CachingServiceReference<?>> onRemovingDependent) {
@@ -646,16 +646,16 @@ public class Whiteboard {
return properties.get(JAX_RS_APPLICATION_BASE).toString();
}
- private static OSGi<CachingServiceReference<CXFJaxRsServiceRegistrator>>
+ private static OSGi<CachingServiceReference<CxfJaxrsServiceRegistrator>>
allApplicationReferences() {
- return serviceReferences(CXFJaxRsServiceRegistrator.class);
+ return serviceReferences(CxfJaxrsServiceRegistrator.class);
}
- private static OSGi<CachingServiceReference<CXFJaxRsServiceRegistrator>>
+ private static OSGi<CachingServiceReference<CxfJaxrsServiceRegistrator>>
chooseApplication(
CachingServiceReference<?> serviceReference,
- Supplier<OSGi<CachingServiceReference<CXFJaxRsServiceRegistrator>>>
+ Supplier<OSGi<CachingServiceReference<CxfJaxrsServiceRegistrator>>>
theDefault,
Consumer<CachingServiceReference<?>> onWaiting,
Consumer<CachingServiceReference<?>> onResolved) {
@@ -672,7 +672,7 @@ public class Whiteboard {
() -> onWaiting.accept(serviceReference),
() -> onResolved.accept(serviceReference)).then(
serviceReferences(
- CXFJaxRsServiceRegistrator.class,
+ CxfJaxrsServiceRegistrator.class,
applicationSelectProperty.toString()).
effects(__ -> onResolved.accept(serviceReference), __ -> {}));
}