cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5899] Better support for injecting Configuration
Date Mon, 25 Aug 2014 13:30:29 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes b34912c44 -> 62ab4a935


[CXF-5899] Better support for injecting Configuration


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/62ab4a93
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/62ab4a93
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/62ab4a93

Branch: refs/heads/3.0.x-fixes
Commit: 62ab4a9354e97f96ffc5f6446a32382a8c8acb8a
Parents: b34912c
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Mon Aug 25 14:28:11 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Mon Aug 25 14:30:05 2014 +0100

----------------------------------------------------------------------
 .../cxf/jaxrs/JAXRSServerFactoryBean.java       |   8 +-
 .../apache/cxf/jaxrs/model/ApplicationInfo.java |  54 ++++++++++
 .../cxf/jaxrs/provider/ProviderFactory.java     |  12 ++-
 .../jaxrs/provider/ServerProviderFactory.java   | 103 ++++++++++++++++---
 .../jaxrs/servlet/CXFNonSpringJaxrsServlet.java |  29 ++++--
 .../org/apache/cxf/jaxrs/utils/JAXRSUtils.java  |   2 +-
 .../cxf/jaxrs/client/spec/ClientImpl.java       |   2 +-
 .../client/spec/ClientRequestContextImpl.java   |   2 +-
 .../cxf/systest/jaxrs/BookApplication.java      |   8 ++
 .../org/apache/cxf/systest/jaxrs/BookStore.java |   6 +-
 .../JAXRSClientServerNonSpringBookTest.java     |   2 +-
 11 files changed, 194 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/62ab4a93/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
index 1f6bc1e..6d9e888 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
@@ -44,8 +44,8 @@ import org.apache.cxf.jaxrs.ext.ResourceComparator;
 import org.apache.cxf.jaxrs.impl.RequestPreprocessor;
 import org.apache.cxf.jaxrs.lifecycle.PerRequestResourceProvider;
 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.ProviderInfo;
 import org.apache.cxf.jaxrs.provider.ServerProviderFactory;
 import org.apache.cxf.jaxrs.utils.AnnotationUtils;
 import org.apache.cxf.jaxrs.utils.InjectionUtils;
@@ -81,7 +81,7 @@ public class JAXRSServerFactoryBean extends AbstractJAXRSFactoryBean {
     private Map<Object, Object> languageMappings;
     private Map<Object, Object> extensionMappings;
     private ResourceComparator rc;
-    private ProviderInfo<Application> appProvider;
+    private ApplicationInfo appProvider;
     private String documentLocation;
     
     public JAXRSServerFactoryBean() {
@@ -97,10 +97,10 @@ public class JAXRSServerFactoryBean extends AbstractJAXRSFactoryBean {
      * @param app
      */
     public void setApplication(Application app) {
-        setApplication(new ProviderInfo<Application>(app, getBus()));
+        setApplication(new ApplicationInfo(app, getBus()));
     }
     
-    public void setApplication(ProviderInfo<Application> provider) {
+    public void setApplication(ApplicationInfo provider) {
         appProvider = provider;
         Set<String> appNameBindings = AnnotationUtils.getNameBindings(provider.getProvider()
                                                                       .getClass().getAnnotations());

http://git-wip-us.apache.org/repos/asf/cxf/blob/62ab4a93/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ApplicationInfo.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ApplicationInfo.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ApplicationInfo.java
new file mode 100644
index 0000000..d60b319
--- /dev/null
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ApplicationInfo.java
@@ -0,0 +1,54 @@
+/**
+ * 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.cxf.jaxrs.model;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.ws.rs.core.Application;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.jaxrs.impl.tl.ThreadLocalProxy;
+
+public class ApplicationInfo extends ProviderInfo<Application> {
+    private Map<String, Object> overridingProps = Collections.emptyMap();
+    public ApplicationInfo(Application provider, Bus bus) {
+        this(provider, null, bus);
+    }
+    public ApplicationInfo(Application provider, 
+                        Map<Class<?>, ThreadLocalProxy<?>> constructorProxies,

+                        Bus bus) {
+        super(provider, constructorProxies, bus);
+    }
+    
+    public Map<String, Object> getProperties() {
+        Map<String, Object> appProps = super.getProvider().getProperties();
+        if (overridingProps.isEmpty()) {
+            return appProps;
+        } else {
+            Map<String, Object> props = new HashMap<String, Object>(appProps);
+            props.putAll(overridingProps);
+            return props;
+        }
+    }
+    public void setOverridingProps(Map<String, Object> overridingProps) {
+        this.overridingProps = overridingProps;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/62ab4a93/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
index ce47262..35469f6 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
@@ -67,6 +67,7 @@ import org.apache.cxf.jaxrs.impl.ReaderInterceptorMBR;
 import org.apache.cxf.jaxrs.impl.WriterInterceptorMBW;
 import org.apache.cxf.jaxrs.impl.tl.ThreadLocalProxy;
 import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
+import org.apache.cxf.jaxrs.model.ApplicationInfo;
 import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.jaxrs.model.FilterProviderInfo;
 import org.apache.cxf.jaxrs.model.ProviderInfo;
@@ -162,13 +163,13 @@ public abstract class ProviderFactory {
         return null;
     }
     
-    public void setDynamicConfiguration(Configuration config) {
+    public void setConfiguration(Configuration config) {
         // Whatever is set inside Configuration is also set in this ProviderFactory
         // We use it only to support Configuration injection at a basic level
         this.dynamicConfiguration = config;
     }
     
-    public Configuration getDynamicConfiguration() {
+    public Configuration getConfiguration() {
         return dynamicConfiguration;
     }
     
@@ -1093,7 +1094,12 @@ public abstract class ProviderFactory {
                 proxies.put(paramTypes[i], proxy);
             }
         }
-        return new ProviderInfo<Object>(instance, proxies, theBus, checkContexts);

+        boolean isApplication = Application.class.isAssignableFrom(c.getDeclaringClass());
+        if (isApplication) {
+            return new ApplicationInfo((Application)instance, proxies, theBus);
+        } else {
+            return new ProviderInfo<Object>(instance, proxies, theBus, checkContexts);
+        }
     }
     
     protected static class NameKey { 

http://git-wip-us.apache.org/repos/asf/cxf/blob/62ab4a93/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
index d9ad37a..9f93528 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
@@ -35,9 +35,8 @@ import javax.ws.rs.container.ContainerRequestFilter;
 import javax.ws.rs.container.ContainerResponseFilter;
 import javax.ws.rs.container.DynamicFeature;
 import javax.ws.rs.container.PreMatching;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.core.Configurable;
 import javax.ws.rs.core.Configuration;
+import javax.ws.rs.core.Feature;
 import javax.ws.rs.core.FeatureContext;
 import javax.ws.rs.ext.ExceptionMapper;
 import javax.ws.rs.ext.ReaderInterceptor;
@@ -52,6 +51,7 @@ import org.apache.cxf.jaxrs.impl.RequestPreprocessor;
 import org.apache.cxf.jaxrs.impl.ResourceInfoImpl;
 import org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper;
 import org.apache.cxf.jaxrs.lifecycle.ResourceProvider;
+import org.apache.cxf.jaxrs.model.ApplicationInfo;
 import org.apache.cxf.jaxrs.model.BeanParamInfo;
 import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.jaxrs.model.FilterProviderInfo;
@@ -78,10 +78,10 @@ public final class ServerProviderFactory extends ProviderFactory {
         new ArrayList<ProviderInfo<ContainerRequestFilter>>(1);
     private Map<NameKey, ProviderInfo<ContainerRequestFilter>> postMatchContainerRequestFilters
= 
         new NameKeyMap<ProviderInfo<ContainerRequestFilter>>(true);
-    private Map<NameKey, ProviderInfo<ContainerResponseFilter>> postMatchContainerResponseFilters
= 
+    private Map<NameKey, ProviderInfo<ContainerResponseFilter>> containerResponseFilters
= 
         new NameKeyMap<ProviderInfo<ContainerResponseFilter>>(false);
     private RequestPreprocessor requestPreprocessor;
-    private ProviderInfo<Application> application;
+    private ApplicationInfo application;
     private Set<DynamicFeature> dynamicFeatures = new LinkedHashSet<DynamicFeature>();
     
     private Map<Class<?>, BeanParamInfo> beanParams = new HashMap<Class<?>,
BeanParamInfo>();
@@ -167,8 +167,7 @@ public final class ServerProviderFactory extends ProviderFactory {
     }
     
     public List<ProviderInfo<ContainerResponseFilter>> getContainerResponseFilters(Set<String>
names) {
-        return getBoundFilters(postMatchContainerResponseFilters, 
-                                            names);
+        return getBoundFilters(containerResponseFilters, names);
     }
     
     public void addBeanParamInfo(BeanParamInfo bpi) {
@@ -245,12 +244,12 @@ public final class ServerProviderFactory extends ProviderFactory {
             new BindingPriorityComparator(ContainerRequestFilter.class, true));
         mapInterceptorFilters(postMatchContainerRequestFilters, postMatchRequestFilters,
                               ContainerRequestFilter.class, true);
-        mapInterceptorFilters(postMatchContainerResponseFilters, postMatchResponseFilters,
+        mapInterceptorFilters(containerResponseFilters, postMatchResponseFilters,
                               ContainerResponseFilter.class, false);
         
         injectContextProxies(exceptionMappers,
             postMatchContainerRequestFilters.values(), preMatchContainerRequestFilters,
-            postMatchContainerResponseFilters.values());
+            containerResponseFilters.values());
     }
     
     @Override
@@ -299,11 +298,11 @@ public final class ServerProviderFactory extends ProviderFactory {
         return requestPreprocessor;
     }
     
-    public void setApplicationProvider(ProviderInfo<Application> app) {
+    public void setApplicationProvider(ApplicationInfo app) {
         application = app;
     }
     
-    public ProviderInfo<Application> getApplicationProvider() {
+    public ApplicationInfo getApplicationProvider() {
         return application;
     }
     
@@ -319,9 +318,9 @@ public final class ServerProviderFactory extends ProviderFactory {
     public void clearProviders() {
         super.clearProviders();
         exceptionMappers.clear();
-        postMatchContainerRequestFilters.clear();
-        postMatchContainerResponseFilters.clear();
         preMatchContainerRequestFilters.clear();
+        postMatchContainerRequestFilters.clear();
+        containerResponseFilters.clear();
     }
     
     @Override
@@ -340,13 +339,18 @@ public final class ServerProviderFactory extends ProviderFactory {
         }
     }
     
+    @Override
+    public Configuration getConfiguration() {
+        return new ServerConfigurationImpl(super.getConfiguration());
+    }
+    
     private void doApplyDynamicFeatures(ClassResourceInfo cri) {
         Set<OperationResourceInfo> oris = cri.getMethodDispatcher().getOperationResourceInfos();
         for (OperationResourceInfo ori : oris) {
             for (DynamicFeature feature : dynamicFeatures) {
                 FeatureContext featureContext = new MethodFeatureContextImpl(ori);
                 feature.configure(new ResourceInfoImpl(ori), featureContext);
-                super.setDynamicConfiguration(featureContext.getConfiguration());
+                super.setConfiguration(featureContext.getConfiguration());
             }
         }
         Collection<ClassResourceInfo> subs = cri.getSubResources();
@@ -364,13 +368,19 @@ public final class ServerProviderFactory extends ProviderFactory {
     
     
     private class MethodFeatureContextImpl implements FeatureContext {
-        private Configurable<FeatureContext> configImpl;    
+        private MethodFeatureContextConfigurable configImpl;    
         private OperationResourceInfo ori;
         private String nameBinding;
         
         public MethodFeatureContextImpl(OperationResourceInfo ori) {
             this.ori = ori;
             configImpl = new MethodFeatureContextConfigurable(this);
+            if (application != null) {
+                Map<String, Object> appProps = application.getProvider().getProperties();
+                for (Map.Entry<String, Object> entry : appProps.entrySet()) {
+                    configImpl.property(entry.getKey(), entry.getValue());
+                }
+            }
             nameBinding = DEFAULT_FILTER_NAME_BINDING 
                 + ori.getClassResourceInfo().getServiceClass().getName()
                 + "."
@@ -495,6 +505,69 @@ public final class ServerProviderFactory extends ProviderFactory {
     }
     
     
-    
+    private class ServerConfigurationImpl implements Configuration {
+        private Configuration superConfig;
+        public ServerConfigurationImpl(Configuration superConfig) {
+            this.superConfig = superConfig;
+        }
+        
+        @Override
+        public Set<Class<?>> getClasses() {
+            return superConfig != null ? superConfig.getClasses() : Collections.<Class<?>>emptySet();
+        }
+
+        @Override
+        public Set<Object> getInstances() {
+            return superConfig != null ? superConfig.getInstances() : Collections.emptySet();
+        }
+
+        @Override
+        public Map<String, Object> getProperties() {
+            return application != null ? application.getProperties() 
+                : Collections.<String, Object>emptyMap();
+        }
+
+        @Override
+        public Object getProperty(String name) {
+            return getProperties().get(name);
+        }
+
+        @Override
+        public Collection<String> getPropertyNames() {
+            return getProperties().keySet();
+        }
+
+        @Override
+        public RuntimeType getRuntimeType() {
+            return RuntimeType.SERVER;
+        }
+
+        @Override
+        public boolean isEnabled(Feature f) {
+            return superConfig != null ? superConfig.isEnabled(f) : false;
+        }
+
+        @Override
+        public boolean isEnabled(Class<? extends Feature> featureCls) {
+            return superConfig != null ? superConfig.isEnabled(featureCls) : false;
+        }
+
+        @Override
+        public boolean isRegistered(Object o) {
+            return superConfig != null ? superConfig.isRegistered(o) : false;
+        }
+
+        @Override
+        public boolean isRegistered(Class<?> cls) {
+            return superConfig != null ? superConfig.isRegistered(cls) : false;
+        }
+
+        @Override
+        public Map<Class<?>, Integer> getContracts(Class<?> cls) {
+            return superConfig != null ? superConfig.getContracts(cls)
+                : Collections.<Class<?>, Integer>emptyMap();
+        }
+        
+    }
     
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/62ab4a93/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
index 312c383..71fd949 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
@@ -23,6 +23,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
@@ -44,6 +45,7 @@ import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
 import org.apache.cxf.jaxrs.lifecycle.PerRequestResourceProvider;
 import org.apache.cxf.jaxrs.lifecycle.ResourceProvider;
 import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
+import org.apache.cxf.jaxrs.model.ApplicationInfo;
 import org.apache.cxf.jaxrs.model.ProviderInfo;
 import org.apache.cxf.jaxrs.provider.ProviderFactory;
 import org.apache.cxf.jaxrs.utils.InjectionUtils;
@@ -375,7 +377,11 @@ public class CXFNonSpringJaxrsServlet extends CXFNonSpringServlet {
         try {
             ProviderInfo<? extends Object> provider = null;
             if (c.getParameterTypes().length == 0) {
-                provider = new ProviderInfo<Object>(c.newInstance(), getBus(), isApplication);
+                if (isApplication) {
+                    provider = new ApplicationInfo((Application)c.newInstance(), getBus());
+                } else {
+                    provider = new ProviderInfo<Object>(c.newInstance(), getBus(),
false);    
+                }
             } else {
                 Map<Class<?>, Object> values = new HashMap<Class<?>,
Object>();
                 values.put(ServletContext.class, sc.getServletContext());
@@ -444,7 +450,7 @@ public class CXFNonSpringJaxrsServlet extends CXFNonSpringServlet {
         }
         
         for (String cName : classNames) {
-            ProviderInfo<Application> providerApp = createApplicationInstance(cName,
servletConfig);
+            ApplicationInfo providerApp = createApplicationInstance(cName, servletConfig);
             
             JAXRSServerFactoryBean bean = ResourceUtils.createApplication(providerApp.getProvider(),

                                                 ignoreApplicationPath,
@@ -461,15 +467,24 @@ public class CXFNonSpringJaxrsServlet extends CXFNonSpringServlet {
         }
     }
     
-    protected ProviderInfo<Application> createApplicationInstance(String appClassName,
ServletConfig servletConfig) 
+    protected ApplicationInfo createApplicationInstance(String appClassName, ServletConfig
servletConfig) 
         throws ServletException {
         Map<String, List<String>> props = new HashMap<String, List<String>>();
         appClassName = getClassNameAndProperties(appClassName, props);
         Class<?> appClass = loadApplicationClass(appClassName);
-        @SuppressWarnings("unchecked")
-        ProviderInfo<Application> provider = 
-            (ProviderInfo<Application>)createSingletonInstance(appClass, props, servletConfig);
-        return provider;
+        ApplicationInfo appInfo = (ApplicationInfo)createSingletonInstance(appClass, props,
servletConfig);
+        Map<String, Object> servletProps = new HashMap<String, Object>();
+        ServletContext servletContext = servletConfig.getServletContext();
+        for (Enumeration<String> names = servletContext.getInitParameterNames(); names.hasMoreElements();)
{
+            String name = names.nextElement();
+            servletProps.put(name, servletContext.getInitParameter(name));
+        }
+        for (Enumeration<String> names = servletConfig.getInitParameterNames(); names.hasMoreElements();)
{
+            String name = names.nextElement();
+            servletProps.put(name, servletConfig.getInitParameter(name));
+        }
+        appInfo.setOverridingProps(servletProps);
+        return appInfo;
     }
     
     protected Class<?> loadApplicationClass(String appClassName) throws ServletException
{

http://git-wip-us.apache.org/repos/asf/cxf/blob/62ab4a93/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
index d84c00e..a655c9b 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
@@ -1078,7 +1078,7 @@ public final class JAXRSUtils {
         } else if (ContextResolver.class.isAssignableFrom(clazz)) {
             o = createContextResolver(genericType, contextMessage);
         } else if (Configuration.class.isAssignableFrom(clazz)) {
-            o = ProviderFactory.getInstance(contextMessage).getDynamicConfiguration();
+            o = ProviderFactory.getInstance(contextMessage).getConfiguration();
         } else if (Application.class.isAssignableFrom(clazz)) {
             ProviderInfo<?> providerInfo = 
                 (ProviderInfo<?>)contextMessage.getExchange().getEndpoint().get(Application.class.getName());

http://git-wip-us.apache.org/repos/asf/cxf/blob/62ab4a93/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
index cbe5b22..bdcffa0 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
@@ -252,7 +252,7 @@ public class ClientImpl implements Client {
             }
             
             pf.setUserProviders(providers);
-            pf.setDynamicConfiguration(getConfiguration());
+            pf.setConfiguration(getConfiguration());
             WebClient.getConfig(targetClient).getRequestContext().putAll(getConfiguration().getProperties());
             WebClient.getConfig(targetClient).getRequestContext().put(Client.class.getName(),
ClientImpl.this);
             // TLS

http://git-wip-us.apache.org/repos/asf/cxf/blob/62ab4a93/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
index 19f70ce..24963fb 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
@@ -66,7 +66,7 @@ public class ClientRequestContextImpl extends AbstractRequestContextImpl
     @Override
     public Configuration getConfiguration() {
         ClientProviderFactory cpf = ClientProviderFactory.getInstance(m);
-        return cpf.getDynamicConfiguration();
+        return cpf.getConfiguration();
     }
     
     private Object getMessageContent() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/62ab4a93/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication.java
index 6772913..d6fe595 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication.java
@@ -20,8 +20,10 @@ package org.apache.cxf.systest.jaxrs;
 
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import javax.annotation.Priority;
@@ -74,6 +76,12 @@ public class BookApplication extends Application {
         return classes;
     }
     
+
+    @Override
+    public Map<String, Object> getProperties() {
+        return Collections.<String, Object>singletonMap("book", "cxf");
+    }
+    
     public void setDefaultName(String name) {
         defaultName = name;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/62ab4a93/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
index f1331d5..dab5a7a 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
@@ -59,6 +59,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.container.ResourceContext;
+import javax.ws.rs.core.Configuration;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Cookie;
 import javax.ws.rs.core.EntityTag;
@@ -123,6 +124,8 @@ public class BookStore {
     private UriInfo uiFromConstructor;
     @Context 
     private ResourceContext resourceContext;
+    @Context 
+    private Configuration configuration;
     
     @BeanParam
     private BookBean theBookBean;
@@ -177,7 +180,8 @@ public class BookStore {
     @Path("/uifromconstructor")
     @Produces("text/plain")
     public String getPathFromUriInfo() {
-        return uiFromConstructor.getAbsolutePath().toString();
+        return uiFromConstructor.getAbsolutePath().toString() + "?prop=" 
+            + configuration.getProperty("book").toString();
     }
         
     @GET

http://git-wip-us.apache.org/repos/asf/cxf/blob/62ab4a93/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
index 7a4e384..6009004 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
@@ -75,7 +75,7 @@ public class JAXRSClientServerNonSpringBookTest extends AbstractBusClientServerT
         WebClient wc = WebClient.create(address);
         wc.accept("text/plain");
         String response = wc.get(String.class);
-        assertEquals(address, response);
+        assertEquals(address + "?prop=cxf", response);
         
     }
     


Mime
View raw message