You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by cs...@apache.org on 2016/04/29 15:49:33 UTC
[1/2] cxf git commit: Only log namespacehandler reg on debug level
Repository: cxf
Updated Branches:
refs/heads/master 4786e8325 -> 5c0c7df62
Only log namespacehandler reg on debug level
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5c0c7df6
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5c0c7df6
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5c0c7df6
Branch: refs/heads/master
Commit: 5c0c7df629f628fe5e76458e99a2105f6c55ddee
Parents: a752ca6
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Fri Apr 29 15:49:02 2016 +0200
Committer: Christian Schneider <ch...@die-schneider.net>
Committed: Fri Apr 29 15:49:23 2016 +0200
----------------------------------------------------------------------
.../org/apache/cxf/bus/blueprint/NamespaceHandlerRegisterer.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/5c0c7df6/core/src/main/java/org/apache/cxf/bus/blueprint/NamespaceHandlerRegisterer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/blueprint/NamespaceHandlerRegisterer.java b/core/src/main/java/org/apache/cxf/bus/blueprint/NamespaceHandlerRegisterer.java
index 400dfd9..463236f 100644
--- a/core/src/main/java/org/apache/cxf/bus/blueprint/NamespaceHandlerRegisterer.java
+++ b/core/src/main/java/org/apache/cxf/bus/blueprint/NamespaceHandlerRegisterer.java
@@ -41,7 +41,7 @@ public final class NamespaceHandlerRegisterer {
Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put("osgi.service.blueprint.namespace", namespace);
bc.registerService(NamespaceHandler.class.getName(), handler, properties);
- LOG.info("Registered blueprint namespace handler for " + namespace);
+ LOG.fine("Registered blueprint namespace handler for " + namespace);
}
} catch (Throwable e) {
String msg = "Aries Blueprint packages not available. So namespaces will not be registered";
[2/2] cxf git commit: [CXF-6887] Handle multiple busses and avoid NPE
Posted by cs...@apache.org.
[CXF-6887] Handle multiple busses and avoid NPE
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a752ca60
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a752ca60
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a752ca60
Branch: refs/heads/master
Commit: a752ca60b3b430c02feb89eb7930c13c21b94b0e
Parents: 4786e83
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Fri Apr 29 15:45:42 2016 +0200
Committer: Christian Schneider <ch...@die-schneider.net>
Committed: Fri Apr 29 15:49:23 2016 +0200
----------------------------------------------------------------------
.../transport/http/asyncclient/Activator.java | 56 +++++++++++---------
1 file changed, 30 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/a752ca60/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/Activator.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/Activator.java b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/Activator.java
index 32f4321..13d1f52 100644
--- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/Activator.java
+++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/Activator.java
@@ -25,47 +25,36 @@ import java.util.Hashtable;
import java.util.Map;
import org.apache.cxf.Bus;
-import org.apache.cxf.transport.http.HTTPConduitFactory;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceRegistration;
+import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
import org.osgi.util.tracker.ServiceTracker;
public class Activator implements BundleActivator {
-
- private ServiceTracker tracker;
+ private ConduitConfigurer conduitConfigurer;
@Override
public void start(BundleContext context) throws Exception {
- tracker = new ServiceTracker(context, Bus.class.getName(), null);
- tracker.open();
- ConduitConfigurer conduitConfigurer = new ConduitConfigurer(context, tracker);
- registerManagedService(context, conduitConfigurer, "org.apache.cxf.transport.http.async");
- }
-
- private void registerManagedService(BundleContext context, ConduitConfigurer conduitConfigurer, String servicePid) {
+ conduitConfigurer = new ConduitConfigurer(context);
+ conduitConfigurer.open();
Dictionary<String, Object> properties = new Hashtable<String, Object>();
- properties.put(Constants.SERVICE_PID, servicePid);
+ properties.put(Constants.SERVICE_PID, "org.apache.cxf.transport.http.async");
context.registerService(ManagedService.class.getName(), conduitConfigurer, properties);
}
@Override
public void stop(BundleContext context) throws Exception {
- tracker.close();
+ conduitConfigurer.close();
}
- class ConduitConfigurer implements ManagedService {
- private AsyncHTTPConduitFactory conduitFactory;
- private ServiceTracker busTracker;
- private BundleContext context;
- private ServiceRegistration reg;
+ public class ConduitConfigurer extends ServiceTracker implements ManagedService {
+ private Map<String, Object> currentConfig;
- ConduitConfigurer(BundleContext context, ServiceTracker busTracker) {
- this.context = context;
- this.busTracker = busTracker;
+ public ConduitConfigurer(BundleContext context) {
+ super(context, Bus.class.getName(), null);
}
@SuppressWarnings({
@@ -73,12 +62,21 @@ public class Activator implements BundleActivator {
})
@Override
public void updated(Dictionary properties) throws ConfigurationException {
- if (reg != null) {
- reg.unregister();
+ this.currentConfig = toMap(properties);
+ Bus[] buses = (Bus[])getServices();
+ if (buses == null) {
+ return;
}
- conduitFactory = new AsyncHTTPConduitFactory((Bus)this.busTracker.getService());
- conduitFactory.update(toMap(properties));
- reg = context.registerService(HTTPConduitFactory.class.getName(), conduitFactory, null);
+ for (Bus bus : buses) {
+ configureConduitFactory(bus);
+ }
+ }
+
+ @Override
+ public Object addingService(ServiceReference reference) {
+ Bus bus = (Bus)super.addingService(reference);
+ configureConduitFactory(bus);
+ return bus;
}
private Map<String, Object> toMap(Dictionary<String, ?> properties) {
@@ -94,5 +92,11 @@ public class Activator implements BundleActivator {
return props;
}
+ private void configureConduitFactory(Bus bus) {
+ AsyncHTTPConduitFactory conduitFactory = bus.getExtension(AsyncHTTPConduitFactory.class);
+ conduitFactory.update(this.currentConfig);
+ }
+
+
}
}