cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1520599 - in /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl: ConfigurableImpl.java ConfigurationImpl.java
Date Fri, 06 Sep 2013 15:24:38 GMT
Author: sergeyb
Date: Fri Sep  6 15:24:38 2013
New Revision: 1520599

URL: http://svn.apache.org/r1520599
Log:
[CXF-5135] Adding Feature instances to the list of configuration instances

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurableImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurationImpl.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurableImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurableImpl.java?rev=1520599&r1=1520598&r2=1520599&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurableImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurableImpl.java
Fri Sep  6 15:24:38 2013
@@ -83,8 +83,9 @@ public class ConfigurableImpl<C extends 
     public C register(Object provider, Map<Class<?>, Integer> contracts) {
         if (provider instanceof Feature) {
             Feature feature = (Feature)provider;
-            config.setFeature(feature);
-            feature.configure(new FeatureContextImpl(this));
+            if (feature.configure(new FeatureContextImpl(this))) {
+                config.setFeature(feature);
+            }
             return configurable;
         }
         config.register(provider, contracts);

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurationImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurationImpl.java?rev=1520599&r1=1520598&r2=1520599&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurationImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ConfigurationImpl.java
Fri Sep  6 15:24:38 2013
@@ -49,7 +49,11 @@ public class ConfigurationImpl implement
             
             Set<Class<?>> providerClasses = new HashSet<Class<?>>(parent.getClasses());
             for (Object o : parent.getInstances()) {
-                registerParentProvider(o, parent, defaultContracts);
+                if (!(o instanceof Feature)) {
+                    registerParentProvider(o, parent, defaultContracts);
+                } else {
+                    features.add((Feature)o);
+                }
                 providerClasses.remove(o.getClass());
             }
             for (Class<?> cls : providerClasses) {
@@ -89,7 +93,10 @@ public class ConfigurationImpl implement
 
     @Override
     public Set<Object> getInstances() {
-        return providers.keySet();
+        Set<Object> allInstances = new HashSet<Object>();
+        allInstances.addAll(providers.keySet());
+        allInstances.addAll(features);
+        return Collections.unmodifiableSet(allInstances);
     }
 
     @Override



Mime
View raw message