cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r727096 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ rt/frontend/jaxrs/src/main/java/org/apache/c...
Date Tue, 16 Dec 2008 17:35:20 GMT
Author: sergeyb
Date: Tue Dec 16 09:35:19 2008
New Revision: 727096

URL: http://svn.apache.org/viewvc?rev=727096&view=rev
Log:
JAXRS : ServletConfig injection, enhancing MessageContext 

Added:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ProvidersImpl.java
      - copied, changed from r726680, cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MessageBodyWorkersImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalProviders.java
      - copied, changed from r726680, cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalMessageBodyWorkers.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalServletConfig.java   (with props)
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/MessageContextImplTest.java   (with props)
Removed:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MessageBodyWorkersImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalMessageBodyWorkers.java
Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContext.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContextImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalMessageContext.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractCXFServlet.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/security/BookServerSecuritySpringClass.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/security/BookServerSecuritySpringInterface.java
    cxf/trunk/systests/src/test/resources/jaxrs_security_no_annotations/WEB-INF/beans.xml

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java Tue Dec 16 09:35:19 2008
@@ -111,7 +111,7 @@
             String baseAddress = (String)exchange.getInMessage().get(Message.BASE_PATH);
             Response excResponse = JAXRSUtils.convertFaultToResponse(ex.getCause(), baseAddress);
             if (excResponse == null) {
-                ProviderFactory.getInstance(baseAddress).cleatThreadLocalProxies();
+                ProviderFactory.getInstance(baseAddress).clearThreadLocalProxies();
                 ClassResourceInfo criRoot =
                     (ClassResourceInfo)exchange.get(JAXRSInInterceptor.ROOT_RESOURCE_CLASS);
                 if (criRoot != null) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContext.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContext.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContext.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContext.java Tue Dec 16 09:35:19 2008
@@ -19,10 +19,33 @@
 
 package org.apache.cxf.jaxrs.ext;
 
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Request;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.ext.Providers;
+
 /**
  * Represents an inbound internal message
  *
  */
 public interface MessageContext {
     Object get(Object key);
+    
+    UriInfo getUriInfo();
+    Request getRequest();
+    HttpHeaders getHttpHeaders();
+    SecurityContext getSecurityContext();
+    Providers getProviders();
+    
+    HttpServletRequest getHttpServletRequest(); 
+    HttpServletResponse getHttpServletResponse();
+    ServletContext getServletContext();
+    ServletConfig getServletConfig();
+    
+    <T> T getContext(Class<T> contextClass);
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContextImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContextImpl.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContextImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContextImpl.java Tue Dec 16 09:35:19 2008
@@ -18,6 +18,20 @@
  */
 package org.apache.cxf.jaxrs.ext;
 
+import java.lang.reflect.Type;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Request;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.ext.ContextResolver;
+import javax.ws.rs.ext.Providers;
+
+import org.apache.cxf.jaxrs.utils.JAXRSUtils;
 import org.apache.cxf.message.Message;
 
 public class MessageContextImpl implements MessageContext {
@@ -32,4 +46,53 @@
         return m.get(key);
     }
 
+    public <T> T getContext(Class<T> contextClass) {
+        return getContext(contextClass, contextClass);
+    }
+    
+    protected <T> T getContext(Type genericType, Class<T> clazz) {
+        return JAXRSUtils.createContextValue(m, genericType, clazz);
+    }
+    
+    @SuppressWarnings("unchecked")
+    public <T> ContextResolver<T> getContextResolver(Class<T> resolveClazz) {
+        return getContext(resolveClazz, ContextResolver.class);
+    }
+    
+    public Request getRequest() {
+        return getContext(Request.class);
+    }
+    
+    public HttpHeaders getHttpHeaders() {
+        return getContext(HttpHeaders.class);
+    }
+
+    public Providers getProviders() {
+        return getContext(Providers.class);
+    }
+
+    public SecurityContext getSecurityContext() {
+        return getContext(SecurityContext.class);
+    }
+
+    public UriInfo getUriInfo() {
+        return getContext(UriInfo.class);
+    }
+    
+    public HttpServletRequest getHttpServletRequest() {
+        return JAXRSUtils.createServletResourceValue(m, HttpServletRequest.class);
+    }
+
+    public HttpServletResponse getHttpServletResponse() {
+        return JAXRSUtils.createServletResourceValue(m, HttpServletResponse.class);
+    }
+    
+    public ServletConfig getServletConfig() {
+        return JAXRSUtils.createServletResourceValue(m, ServletConfig.class);
+    }
+
+    public ServletContext getServletContext() {
+        return JAXRSUtils.createServletResourceValue(m, ServletContext.class);
+    }
+
 }

Copied: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ProvidersImpl.java (from r726680, cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MessageBodyWorkersImpl.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ProvidersImpl.java?p2=cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ProvidersImpl.java&p1=cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MessageBodyWorkersImpl.java&r1=726680&r2=727096&rev=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MessageBodyWorkersImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ProvidersImpl.java Tue Dec 16 09:35:19 2008
@@ -32,10 +32,10 @@
 import org.apache.cxf.jaxrs.provider.ProviderFactory;
 import org.apache.cxf.message.Message;
 
-public class MessageBodyWorkersImpl implements Providers {
+public class ProvidersImpl implements Providers {
 
     private Message m;
-    public MessageBodyWorkersImpl(Message m) {
+    public ProvidersImpl(Message m) {
         this.m = m;
     }
     

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalMessageContext.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalMessageContext.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalMessageContext.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalMessageContext.java Tue Dec 16 09:35:19 2008
@@ -19,6 +19,16 @@
 
 package org.apache.cxf.jaxrs.impl.tl;
 
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Request;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.ext.Providers;
+
 import org.apache.cxf.jaxrs.ext.MessageContext;
 
 public class ThreadLocalMessageContext extends AbstractThreadLocalProxy<MessageContext> 
@@ -28,6 +38,44 @@
         return get().get(key);
     }
 
-    
+    public <T> T getContext(Class<T> contextClass) {
+        return get().getContext(contextClass);
+    }
+
+    public HttpHeaders getHttpHeaders() {
+        return get().getHttpHeaders();
+    }
+
+    public HttpServletRequest getHttpServletRequest() {
+        return get().getHttpServletRequest();
+    }
+
+    public HttpServletResponse getHttpServletResponse() {
+        return get().getHttpServletResponse();
+    }
+
+    public Providers getProviders() {
+        return get().getProviders();
+    }
+
+    public SecurityContext getSecurityContext() {
+        return get().getSecurityContext();
+    }
+
+    public ServletConfig getServletConfig() {
+        return get().getServletConfig();
+    }
+
+    public ServletContext getServletContext() {
+        return get().getServletContext();
+    }
+
+    public UriInfo getUriInfo() {
+        return get().getUriInfo();
+    }
+
+    public Request getRequest() {
+        return get().getRequest();
+    }
 
 }

Copied: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalProviders.java (from r726680, cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalMessageBodyWorkers.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalProviders.java?p2=cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalProviders.java&p1=cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalMessageBodyWorkers.java&r1=726680&r2=727096&rev=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalMessageBodyWorkers.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalProviders.java Tue Dec 16 09:35:19 2008
@@ -29,7 +29,7 @@
 import javax.ws.rs.ext.MessageBodyWriter;
 import javax.ws.rs.ext.Providers;
 
-public class ThreadLocalMessageBodyWorkers extends AbstractThreadLocalProxy<Providers>
+public class ThreadLocalProviders extends AbstractThreadLocalProxy<Providers>
        implements Providers {
 
     public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> type, 

Added: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalServletConfig.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalServletConfig.java?rev=727096&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalServletConfig.java (added)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalServletConfig.java Tue Dec 16 09:35:19 2008
@@ -0,0 +1,49 @@
+/**
+ * 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.impl.tl;
+
+import java.util.Enumeration;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+
+public class ThreadLocalServletConfig extends AbstractThreadLocalProxy<ServletConfig> 
+    implements ServletConfig {
+
+    public String getInitParameter(String name) {
+        return get().getInitParameter(name);
+    }
+
+    public Enumeration getInitParameterNames() {
+        return get().getInitParameterNames();
+    }
+
+    public ServletContext getServletContext() {
+        return get().getServletContext();    
+    }
+
+    public String getServletName() {
+        return get().getServletName();
+    }
+
+    
+
+}

Propchange: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalServletConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalServletConfig.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java Tue Dec 16 09:35:19 2008
@@ -67,7 +67,7 @@
         } catch (RuntimeException ex) {
             Response excResponse = JAXRSUtils.convertFaultToResponse(ex, baseAddress);
             if (excResponse == null) {
-                ProviderFactory.getInstance(baseAddress).cleatThreadLocalProxies();
+                ProviderFactory.getInstance(baseAddress).clearThreadLocalProxies();
                 throw ex;
             }
             message.getExchange().put(Response.class, excResponse);

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java Tue Dec 16 09:35:19 2008
@@ -61,7 +61,7 @@
         try {
             processResponse(message, baseAddress);
         } finally {
-            ProviderFactory.getInstance(baseAddress).cleatThreadLocalProxies();
+            ProviderFactory.getInstance(baseAddress).clearThreadLocalProxies();
             ClassResourceInfo cri =
                 (ClassResourceInfo)message.getExchange().get(JAXRSInInterceptor.ROOT_RESOURCE_CLASS);
             if (cri != null) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java Tue Dec 16 09:35:19 2008
@@ -504,7 +504,7 @@
         return requestPreprocessor;
     }
     
-    public void cleatThreadLocalProxies() {
+    public void clearThreadLocalProxies() {
         clearProxies(defaultMessageReaders,
                      defaultMessageWriters,
                      userMessageReaders,

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java Tue Dec 16 09:35:19 2008
@@ -39,6 +39,7 @@
 import java.util.TreeSet;
 import java.util.logging.Logger;
 
+import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -60,11 +61,12 @@
 import org.apache.cxf.jaxrs.impl.tl.ThreadLocalHttpHeaders;
 import org.apache.cxf.jaxrs.impl.tl.ThreadLocalHttpServletRequest;
 import org.apache.cxf.jaxrs.impl.tl.ThreadLocalHttpServletResponse;
-import org.apache.cxf.jaxrs.impl.tl.ThreadLocalMessageBodyWorkers;
 import org.apache.cxf.jaxrs.impl.tl.ThreadLocalMessageContext;
+import org.apache.cxf.jaxrs.impl.tl.ThreadLocalProviders;
 import org.apache.cxf.jaxrs.impl.tl.ThreadLocalProxy;
 import org.apache.cxf.jaxrs.impl.tl.ThreadLocalRequest;
 import org.apache.cxf.jaxrs.impl.tl.ThreadLocalSecurityContext;
+import org.apache.cxf.jaxrs.impl.tl.ThreadLocalServletConfig;
 import org.apache.cxf.jaxrs.impl.tl.ThreadLocalServletContext;
 import org.apache.cxf.jaxrs.impl.tl.ThreadLocalUriInfo;
 import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
@@ -336,7 +338,7 @@
         } else if (Request.class.isAssignableFrom(type)) {
             proxy = new ThreadLocalRequest();
         }  else if (Providers.class.isAssignableFrom(type)) {
-            proxy = new ThreadLocalMessageBodyWorkers();
+            proxy = new ThreadLocalProviders();
         } else if (HttpServletRequest.class.isAssignableFrom(type)) {
             proxy = new ThreadLocalHttpServletRequest();
         } else if (ServletContext.class.isAssignableFrom(type)) {
@@ -345,6 +347,8 @@
             proxy = new ThreadLocalHttpServletResponse();
         } else if (MessageContext.class.isAssignableFrom(type)) {
             proxy = new ThreadLocalMessageContext();
+        }  else if (ServletConfig.class.isAssignableFrom(type)) {
+            proxy = new ThreadLocalServletConfig();
         }
         return proxy;
     }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java Tue Dec 16 09:35:19 2008
@@ -36,11 +36,13 @@
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.ResourceBundle;
 import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
 import java.util.logging.Logger;
 
+import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -69,15 +71,15 @@
 import javax.ws.rs.ext.MessageBodyWriter;
 import javax.ws.rs.ext.Providers;
 
+import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.jaxrs.ext.MessageContext;
 import org.apache.cxf.jaxrs.ext.MessageContextImpl;
 import org.apache.cxf.jaxrs.impl.HttpHeadersImpl;
-import org.apache.cxf.jaxrs.impl.MessageBodyWorkersImpl;
 import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.jaxrs.impl.PathSegmentImpl;
+import org.apache.cxf.jaxrs.impl.ProvidersImpl;
 import org.apache.cxf.jaxrs.impl.RequestImpl;
 import org.apache.cxf.jaxrs.impl.SecurityContextImpl;
 import org.apache.cxf.jaxrs.impl.UriInfoImpl;
@@ -96,7 +98,7 @@
 
     public static final MediaType ALL_TYPES = new MediaType();
     private static final Logger LOG = LogUtils.getL7dLogger(JAXRSUtils.class);
-    //private static final ResourceBundle BUNDLE = BundleUtils.getBundle(JAXRSUtils.class);
+    private static final ResourceBundle BUNDLE = BundleUtils.getBundle(JAXRSUtils.class);
 
     private JAXRSUtils() {        
     }
@@ -388,8 +390,12 @@
             String contentType = (String)message.get(Message.CONTENT_TYPE);
 
             if (contentType == null) {
-                throw new Fault(new  org.apache.cxf.common.i18n.Message("NO_CONTENT_TYPE_SPECIFIED",
-                                                                        LOG, ori.getHttpMethod()));
+                org.apache.cxf.common.i18n.Message errorMsg = 
+                    new org.apache.cxf.common.i18n.Message("NO_CONTENT_TYPE_SPECIFIED", 
+                                                           BUNDLE, 
+                                                           ori.getHttpMethod());
+                LOG.fine(errorMsg.toString());
+                contentType = MediaType.WILDCARD;
             }
 
             return readFromMessageBody(parameterClass,
@@ -568,7 +574,7 @@
                                   : defaultValue;
     }
     
-    public static Object createContextValue(Message m, Type genericType, Class<?> clazz) {
+    public static <T> T createContextValue(Message m, Type genericType, Class<T> clazz) {
  
         Object o = null;
         if (UriInfo.class.isAssignableFrom(clazz)) {
@@ -580,14 +586,15 @@
         } else if (SecurityContext.class.isAssignableFrom(clazz)) {
             o = new SecurityContextImpl(m);
         } else if (Providers.class.isAssignableFrom(clazz)) {
-            o = new MessageBodyWorkersImpl(m);
+            o = new ProvidersImpl(m);
         } else if (ContextResolver.class.isAssignableFrom(clazz)) {
             o = createContextResolver(genericType, m);
         } else if (MessageContext.class.isAssignableFrom(clazz)) {
             o = new MessageContextImpl(m);
         }
         
-        return o == null ? createServletResourceValue(m, clazz) : o;
+        o = o == null ? createServletResourceValue(m, clazz) : o;
+        return clazz.cast(o);
     }
     
     @SuppressWarnings("unchecked")
@@ -611,19 +618,23 @@
         return createContextValue(m, genericType, clazz);
     }
     
-    private static Object createServletResourceValue(Message m, Class<?> clazz) {
+    public static <T> T createServletResourceValue(Message m, Class<T> clazz) {
         
+        Object value = null; 
         if (HttpServletRequest.class.isAssignableFrom(clazz)) {
-            return (HttpServletRequest) m.get(AbstractHTTPDestination.HTTP_REQUEST);
+            value = m.get(AbstractHTTPDestination.HTTP_REQUEST);
         }
         if (HttpServletResponse.class.isAssignableFrom(clazz)) {
-            return (HttpServletResponse) m.get(AbstractHTTPDestination.HTTP_RESPONSE);
+            value = m.get(AbstractHTTPDestination.HTTP_RESPONSE);
         }
         if (ServletContext.class.isAssignableFrom(clazz)) {
-            return (ServletContext) m.get(AbstractHTTPDestination.HTTP_CONTEXT);
+            value = m.get(AbstractHTTPDestination.HTTP_CONTEXT);
+        }
+        if (ServletConfig.class.isAssignableFrom(clazz)) {
+            value = m.get(AbstractHTTPDestination.HTTP_CONFIG);
         }
         
-        return null;
+        return clazz.cast(value);
     }
 
     private static Object readFromUriParam(Message m,

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java Tue Dec 16 09:35:19 2008
@@ -22,6 +22,7 @@
 import java.util.List;
 
 import javax.annotation.Resource;
+import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -244,7 +245,8 @@
     
     public void testServletParams(@Context HttpServletRequest req,
                                   @Context HttpServletResponse res,
-                                  @Context ServletContext context) {
+                                  @Context ServletContext context,
+                                  @Context ServletConfig config) {
         // complete
     }
     

Added: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/MessageContextImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/MessageContextImplTest.java?rev=727096&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/MessageContextImplTest.java (added)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/MessageContextImplTest.java Tue Dec 16 09:35:19 2008
@@ -0,0 +1,135 @@
+/**
+ * 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.ext;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Request;
+import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.ext.Providers;
+
+import org.apache.cxf.jaxrs.impl.HttpHeadersImpl;
+import org.apache.cxf.jaxrs.impl.ProvidersImpl;
+import org.apache.cxf.jaxrs.impl.RequestImpl;
+import org.apache.cxf.jaxrs.impl.SecurityContextImpl;
+import org.apache.cxf.jaxrs.impl.UriInfoImpl;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.transport.http.AbstractHTTPDestination;
+import org.easymock.classextension.EasyMock;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class MessageContextImplTest extends Assert {
+
+    @Test
+    public void testGetProperty() {
+        Message m = new MessageImpl();
+        m.put("a", "b");
+        MessageContext mc = new MessageContextImpl(m);
+        assertEquals("b", mc.get("a"));
+        assertNull(mc.get("b"));
+    }
+    
+    @Test
+    public void testGetUriInfo() {
+        MessageContext mc = new MessageContextImpl(new MessageImpl());
+        assertSame(UriInfoImpl.class, mc.getUriInfo().getClass());
+        assertSame(UriInfoImpl.class, mc.getContext(UriInfo.class).getClass());
+    }
+    
+    @Test
+    public void testGetRequest() {
+        MessageContext mc = new MessageContextImpl(new MessageImpl());
+        assertSame(RequestImpl.class, mc.getRequest().getClass());
+        assertSame(RequestImpl.class, mc.getContext(Request.class).getClass());
+    }
+    
+    @Test
+    public void testGetHttpHeaders() {
+        MessageContext mc = new MessageContextImpl(new MessageImpl());
+        assertSame(HttpHeadersImpl.class, mc.getHttpHeaders().getClass());
+        assertSame(HttpHeadersImpl.class, mc.getContext(HttpHeaders.class).getClass());
+    }
+    
+    @Test
+    public void testGetSecurityContext() {
+        MessageContext mc = new MessageContextImpl(new MessageImpl());
+        assertSame(SecurityContextImpl.class, mc.getSecurityContext().getClass());
+        assertSame(SecurityContextImpl.class, mc.getContext(SecurityContext.class).getClass());
+    }
+    
+    @Test
+    public void testProviders() {
+        MessageContext mc = new MessageContextImpl(new MessageImpl());
+        assertSame(ProvidersImpl.class, mc.getProviders().getClass());
+        assertSame(ProvidersImpl.class, mc.getContext(Providers.class).getClass());
+    }
+    
+    @Test
+    public void testHttpRequest() {
+        Message m = new MessageImpl();
+        MessageContext mc = new MessageContextImpl(m);
+        HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
+        m.put(AbstractHTTPDestination.HTTP_REQUEST, request);
+        assertSame(request.getClass(), mc.getHttpServletRequest().getClass());
+        assertSame(request.getClass(), mc.getContext(HttpServletRequest.class).getClass());
+    }
+    
+    @Test
+    public void testHttpResponse() {
+        Message m = new MessageImpl();
+        MessageContext mc = new MessageContextImpl(m);
+        HttpServletResponse request = EasyMock.createMock(HttpServletResponse.class);
+        m.put(AbstractHTTPDestination.HTTP_RESPONSE, request);
+        assertSame(request.getClass(), mc.getHttpServletResponse().getClass());
+        assertSame(request.getClass(), mc.getContext(HttpServletResponse.class).getClass());
+    }
+    
+    @Test
+    public void testServletContext() {
+        Message m = new MessageImpl();
+        MessageContext mc = new MessageContextImpl(m);
+        ServletContext request = EasyMock.createMock(ServletContext.class);
+        m.put(AbstractHTTPDestination.HTTP_CONTEXT, request);
+        assertSame(request.getClass(), mc.getServletContext().getClass());
+        assertSame(request.getClass(), mc.getContext(ServletContext.class).getClass());
+    }
+    
+    @Test
+    public void testServletConfig() {
+        Message m = new MessageImpl();
+        MessageContext mc = new MessageContextImpl(m);
+        ServletConfig request = EasyMock.createMock(ServletConfig.class);
+        m.put(AbstractHTTPDestination.HTTP_CONFIG, request);
+        assertSame(request.getClass(), mc.getServletConfig().getClass());
+        assertSame(request.getClass(), mc.getContext(ServletConfig.class).getClass());
+    }
+    
+    @Test
+    public void testNoContext() {
+        MessageContext mc = new MessageContextImpl(new MessageImpl());
+        assertNull(mc.getContext(Message.class));
+    }
+}

Propchange: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/MessageContextImplTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/MessageContextImplTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java Tue Dec 16 09:35:19 2008
@@ -27,6 +27,7 @@
 import java.util.HashMap;
 import java.util.List;
 
+import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -47,9 +48,9 @@
 import org.apache.cxf.jaxrs.JAXRSServiceImpl;
 import org.apache.cxf.jaxrs.SimpleFactory;
 import org.apache.cxf.jaxrs.impl.HttpHeadersImpl;
-import org.apache.cxf.jaxrs.impl.MessageBodyWorkersImpl;
 import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.jaxrs.impl.PathSegmentImpl;
+import org.apache.cxf.jaxrs.impl.ProvidersImpl;
 import org.apache.cxf.jaxrs.impl.RequestImpl;
 import org.apache.cxf.jaxrs.impl.SecurityContextImpl;
 import org.apache.cxf.jaxrs.impl.UriInfoImpl;
@@ -733,7 +734,7 @@
         assertSame(HttpHeadersImpl.class, params.get(1).getClass());
         assertSame(RequestImpl.class, params.get(2).getClass());
         assertSame(SecurityContextImpl.class, params.get(3).getClass());
-        assertSame(MessageBodyWorkersImpl.class, params.get(4).getClass());
+        assertSame(ProvidersImpl.class, params.get(4).getClass());
         assertSame(String.class, params.get(5).getClass());
         assertEquals("Wrong header param", "bar", params.get(5));
         List<String> values = (List<String>)params.get(6);
@@ -772,27 +773,33 @@
                 Customer.class.getMethod("testServletParams", 
                                          new Class[]{HttpServletRequest.class, 
                                                      HttpServletResponse.class, 
-                                                     ServletContext.class}), 
+                                                     ServletContext.class,
+                                                     ServletConfig.class}), 
                 cri);
         ori.setHttpMethod("GET");
         HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
         HttpServletResponse response = EasyMock.createMock(HttpServletResponse.class);
         ServletContext context = EasyMock.createMock(ServletContext.class);
+        ServletConfig config = EasyMock.createMock(ServletConfig.class);        
+        
         EasyMock.replay(request);
         EasyMock.replay(response);
         EasyMock.replay(context);
+        EasyMock.replay(config);
         
         Message m = new MessageImpl();
         m.put(AbstractHTTPDestination.HTTP_REQUEST, request);
         m.put(AbstractHTTPDestination.HTTP_RESPONSE, response);
         m.put(AbstractHTTPDestination.HTTP_CONTEXT, context);
+        m.put(AbstractHTTPDestination.HTTP_CONFIG, config);
         
         List<Object> params = 
             JAXRSUtils.processParameters(ori, new MetadataMap<String, String>(), m);
-        assertEquals("3 parameters expected", 3, params.size());
+        assertEquals("4 parameters expected", 4, params.size());
         assertSame(request.getClass(), params.get(0).getClass());
         assertSame(response.getClass(), params.get(1).getClass());
         assertSame(context.getClass(), params.get(2).getClass());
+        assertSame(config.getClass(), params.get(3).getClass());
         
     }
     
@@ -813,7 +820,7 @@
         assertSame(HttpHeadersImpl.class, c.getHeaders().getClass());
         assertSame(RequestImpl.class, c.getRequest().getClass());
         assertSame(SecurityContextImpl.class, c.getSecurityContext().getClass());
-        assertSame(MessageBodyWorkersImpl.class, c.getBodyWorkers().getClass());
+        assertSame(ProvidersImpl.class, c.getBodyWorkers().getClass());
         
     }
     
@@ -845,9 +852,9 @@
                    ((ThreadLocalProxy)c.getRequest()).get().getClass());
         assertSame(SecurityContextImpl.class, 
                    ((ThreadLocalProxy)c.getSecurityContext()).get().getClass());
-        assertSame(MessageBodyWorkersImpl.class, 
+        assertSame(ProvidersImpl.class, 
                    ((ThreadLocalProxy)c.getBodyWorkers()).get().getClass());
-        assertSame(MessageBodyWorkersImpl.class, 
+        assertSame(ProvidersImpl.class, 
                    ((ThreadLocalProxy)c.getBodyWorkers()).get().getClass());
   
         assertSame(servletContextMock, 

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java (original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java Tue Dec 16 09:35:19 2008
@@ -36,6 +36,7 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -76,6 +77,7 @@
     public static final String HTTP_REQUEST = "HTTP.REQUEST";
     public static final String HTTP_RESPONSE = "HTTP.RESPONSE";
     public static final String HTTP_CONTEXT = "HTTP.CONTEXT";
+    public static final String HTTP_CONFIG = "HTTP.CONFIG";
     public static final String PROTOCOL_HEADERS_CONTENT_TYPE = Message.CONTENT_TYPE.toLowerCase();
         
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractHTTPDestination.class);
@@ -242,14 +244,24 @@
     }
     
     protected void setupMessage(Message inMessage,
-                                  final ServletContext context, 
-                                  final HttpServletRequest req, 
-                                  final HttpServletResponse resp) throws IOException {
+                                final ServletContext context, 
+                                final HttpServletRequest req, 
+                                final HttpServletResponse resp) throws IOException {
+        setupMessage(inMessage, null, context, req, resp);
+    }
+    
+    protected void setupMessage(Message inMessage,
+                                final ServletConfig config,
+                                final ServletContext context, 
+                                final HttpServletRequest req, 
+                                final HttpServletResponse resp) throws IOException {
 
         inMessage.setContent(InputStream.class, req.getInputStream());
         inMessage.put(HTTP_REQUEST, req);
         inMessage.put(HTTP_RESPONSE, resp);
         inMessage.put(HTTP_CONTEXT, context);
+        inMessage.put(HTTP_CONFIG, config);
+        
         inMessage.put(Message.HTTP_REQUEST_METHOD, req.getMethod());
         inMessage.put(Message.REQUEST_URI, req.getRequestURI());
         String contextPath = req.getContextPath();

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractCXFServlet.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractCXFServlet.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractCXFServlet.java (original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/AbstractCXFServlet.java Tue Dec 16 09:35:19 2008
@@ -52,24 +52,12 @@
     }
     
     public ServletController createServletController(ServletConfig servletConfig) {
-        String hideServiceList = servletConfig.getInitParameter("hide-service-list-page");
         ServletController newController =
-            new ServletController(servletTransportFactory, this.getServletContext(), bus);
-        if (hideServiceList != null) {
-            newController.setHideServiceList(Boolean.valueOf(hideServiceList));
-        }
-        String disableAddressUpdates = servletConfig.getInitParameter("disable-address-updates");
-        if (disableAddressUpdates != null) {
-            newController.setDisableAddressUpdates(Boolean.valueOf(disableAddressUpdates));
-        }
-        String forcedBaseAddress = servletConfig.getInitParameter("base-address");
-        if (forcedBaseAddress != null) {
-            newController.setForcedBaseAddress(forcedBaseAddress);
-        }
-        String serviceListStyleSheet = servletConfig.getInitParameter("service-list-stylesheet");
-        if (serviceListStyleSheet != null) {
-            newController.setServiceListStyleSheet(serviceListStyleSheet);
-        }
+            new ServletController(servletTransportFactory,
+                                  servletConfig,
+                                  this.getServletContext(), 
+                                  bus);
+        
         return newController;
     }
     

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java (original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java Tue Dec 16 09:35:19 2008
@@ -29,6 +29,7 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
@@ -50,6 +51,7 @@
 
     private ServletTransportFactory transport;
     private ServletContext servletContext;
+    private ServletConfig servletConfig;
     private Bus bus;
     private String lastBase = "";
     private boolean isHideServiceList;
@@ -57,11 +59,15 @@
     private String forcedBaseAddress;
     private String serviceListStyleSheet;
  
-    public ServletController(ServletTransportFactory df, ServletContext context, Bus b) {
+    public ServletController(ServletTransportFactory df,
+                             ServletConfig config,
+                             ServletContext context, 
+                             Bus b) {
         this.transport = df;
+        this.servletConfig = config;
         this.servletContext = context;
         this.bus = b;
-        df.setServletController(this);
+        init();
     }
     
     public void setHideServiceList(boolean generate) {
@@ -282,7 +288,7 @@
         }
 
         try {
-            d.invoke(servletContext, request, response);
+            d.invoke(servletConfig, servletContext, request, response);
         } catch (IOException e) {
             throw new ServletException(e);
         } finally {
@@ -292,4 +298,26 @@
         }
 
     }
+    
+    private void init() {
+        
+        transport.setServletController(this);
+        
+        String hideServiceList = servletConfig.getInitParameter("hide-service-list-page");
+        if (hideServiceList != null) {
+            isHideServiceList = Boolean.valueOf(hideServiceList);
+        }
+        String isDisableAddressUpdates = servletConfig.getInitParameter("disable-address-updates");
+        if (isDisableAddressUpdates != null) {
+            disableAddressUpdates = Boolean.valueOf(isDisableAddressUpdates);
+        }
+        String isForcedBaseAddress = servletConfig.getInitParameter("base-address");
+        if (isForcedBaseAddress != null) {
+            forcedBaseAddress = isForcedBaseAddress;
+        }
+        String serviceListTransform = servletConfig.getInitParameter("service-list-stylesheet");
+        if (serviceListTransform != null) {
+            serviceListStyleSheet = serviceListTransform;
+        }
+    }
 }

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java (original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java Tue Dec 16 09:35:19 2008
@@ -22,11 +22,11 @@
 import java.io.IOException;
 import java.util.logging.Logger;
 
+import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.message.ExchangeImpl;
@@ -73,13 +73,20 @@
         return LOG;
     }
 
-    
     public void invoke(final ServletContext context, 
-                         final HttpServletRequest req, 
-                         final HttpServletResponse resp) throws IOException {
+                       final HttpServletRequest req, 
+                       final HttpServletResponse resp) throws IOException {
+        invoke(null, context, req, resp);
+    }
+    
+    public void invoke(final ServletConfig config,
+                       final ServletContext context, 
+                       final HttpServletRequest req, 
+                       final HttpServletResponse resp) throws IOException {
         
         MessageImpl inMessage = new MessageImpl();
         setupMessage(inMessage,
+                     config,
                      context,
                      req,
                      resp);

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/security/BookServerSecuritySpringClass.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/security/BookServerSecuritySpringClass.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/security/BookServerSecuritySpringClass.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/security/BookServerSecuritySpringClass.java Tue Dec 16 09:35:19 2008
@@ -26,7 +26,7 @@
 public class BookServerSecuritySpringClass extends AbstractSpringServer {
 
     public BookServerSecuritySpringClass() {
-        super("/jaxrs_security");
+        super("/jaxrs_security_cglib");
     }
     
     public static void main(String args[]) {

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/security/BookServerSecuritySpringInterface.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/security/BookServerSecuritySpringInterface.java?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/security/BookServerSecuritySpringInterface.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/security/BookServerSecuritySpringInterface.java Tue Dec 16 09:35:19 2008
@@ -25,7 +25,7 @@
 public class BookServerSecuritySpringInterface extends AbstractSpringServer {
 
     public BookServerSecuritySpringInterface() {
-        super("/jaxrs_security_cglib");
+        super("/jaxrs_security");
     }    
     
     public static void main(String args[]) {

Modified: cxf/trunk/systests/src/test/resources/jaxrs_security_no_annotations/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/resources/jaxrs_security_no_annotations/WEB-INF/beans.xml?rev=727096&r1=727095&r2=727096&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/resources/jaxrs_security_no_annotations/WEB-INF/beans.xml (original)
+++ cxf/trunk/systests/src/test/resources/jaxrs_security_no_annotations/WEB-INF/beans.xml Tue Dec 16 09:35:19 2008
@@ -54,7 +54,6 @@
   </jaxrs:server>
 
   <bean id="bookstore" class="org.apache.cxf.systest.jaxrs.security.SecureBookStoreNoAnnotations"/>
-  <aop:config proxy-target-class="true"/>
   
   <security:global-method-security>
       <security:protect-pointcut 



Mime
View raw message