[seam-commits] Seam SVN: r9989 - in trunk: src/resteasy/org/jboss/seam/resteasy and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Jan 30 08:59:00 EST 2009


Author: jharting
Date: 2009-01-30 08:59:00 -0500 (Fri, 30 Jan 2009)
New Revision: 9989

Added:
   trunk/src/resteasy/org/jboss/seam/resteasy/Application.java
Removed:
   trunk/src/resteasy/org/jboss/seam/resteasy/ApplicationConfig.java
Modified:
   trunk/build/resteasy.pom.xml
   trunk/build/root.pom.xml
   trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java
   trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java
   trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java
Log:
JBSEAM-3449

Modified: trunk/build/resteasy.pom.xml
===================================================================
--- trunk/build/resteasy.pom.xml	2009-01-30 11:52:09 UTC (rev 9988)
+++ trunk/build/resteasy.pom.xml	2009-01-30 13:59:00 UTC (rev 9989)
@@ -22,7 +22,7 @@
       </dependency>
       
       <dependency>
-         <groupId>org.resteasy</groupId>
+         <groupId>org.jboss.resteasy</groupId>
          <artifactId>resteasy-jaxrs</artifactId>
       </dependency>
       

Modified: trunk/build/root.pom.xml
===================================================================
--- trunk/build/root.pom.xml	2009-01-30 11:52:09 UTC (rev 9988)
+++ trunk/build/root.pom.xml	2009-01-30 13:59:00 UTC (rev 9989)
@@ -298,9 +298,9 @@
       </dependency>
       
       <dependency>
-         <groupId>org.resteasy</groupId>
+         <groupId>org.jboss.resteasy</groupId>
          <artifactId>resteasy-jaxrs</artifactId>
-         <version>1.0-beta-5</version>
+         <version>1.0.1.GA</version>
          <exclusions>
              <exclusion>
                <groupId>commons-codec</groupId>

Copied: trunk/src/resteasy/org/jboss/seam/resteasy/Application.java (from rev 9965, trunk/src/resteasy/org/jboss/seam/resteasy/ApplicationConfig.java)
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/Application.java	                        (rev 0)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/Application.java	2009-01-30 13:59:00 UTC (rev 9989)
@@ -0,0 +1,183 @@
+package org.jboss.seam.resteasy;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.Component;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Install;
+
+import javax.ws.rs.core.MediaType;
+import java.util.*;
+
+/**
+ * Resteasy and JAX-RS configuration, override in components.xml to
+ * customize Resteasy settings.
+ *
+ * @author Christian Bauer
+ */
+ at Name("org.jboss.seam.resteasy.application")
+ at Scope(ScopeType.APPLICATION)
+ at Install(precedence = Install.BUILT_IN)
+ at AutoCreate
+public class Application extends javax.ws.rs.core.Application
+{
+
+    private Map<Class<?>, Component> providerClasses = new HashMap<Class<?>, Component>();
+    private Map<Class<?>, Component> resourceClasses = new HashMap<Class<?>, Component>();
+
+    private List<String> providerClassNames = new ArrayList<String>();
+    private List<String> resourceClassNames = new ArrayList<String>();
+
+    private Map<String, String> mediaTypeMappings = new HashMap<String, String>();
+    private Map<String, String> languageMappings = new HashMap<String, String>();
+
+    private boolean scanProviders = true;
+    private boolean scanResources = true;
+    private boolean useBuiltinProviders = true;
+
+    private String resourcePathPrefix = "/rest";
+    private boolean stripSeamResourcePath = true;
+
+    public Application()
+    {
+        super();
+    }
+
+    public Set<Class<?>> getProviderClasses()
+    {
+        return providerClasses.keySet();
+    }
+
+    @Override
+    public Set<Class<?>> getClasses()
+    {
+        return resourceClasses.keySet();
+    }
+
+    public void addProviderClass(Class<?> clazz, Component component)
+    {
+        providerClasses.put(clazz, component);
+    }
+
+    public void removeProviderClass(Class<?> clazz)
+    {
+        providerClasses.remove(clazz);
+    }
+
+    public void addResourceClass(Class<?> clazz, Component component)
+    {
+        resourceClasses.put(clazz, component);
+    }
+
+    public void removeResourceClass(Class<?> clazz)
+    {
+        resourceClasses.remove(clazz);
+    }
+
+    public Component getProviderClassComponent(Class clazz)
+    {
+        return providerClasses.get(clazz) != null ? providerClasses.get(clazz) : null;
+    }
+
+    public Component getResourceClassComponent(Class clazz)
+    {
+        return resourceClasses.get(clazz) != null ? resourceClasses.get(clazz) : null;
+    }
+
+    public Map<String, MediaType> getMediaTypeMappings()
+    {
+        Map<String, MediaType> extMap = new HashMap<String, MediaType>();
+        for (String ext : mediaTypeMappings.keySet())
+        {
+            String value = mediaTypeMappings.get(ext);
+            extMap.put(ext, MediaType.valueOf(value));
+        }
+        return extMap;
+    }
+
+    public void setMediaTypeMappings(Map<String, String> mediaTypeMappings)
+    {
+        this.mediaTypeMappings = mediaTypeMappings;
+    }
+
+    public Map<String, String> getLanguageMappings()
+    {
+        return languageMappings;
+    }
+
+    public void setLanguageMappings(Map<String, String> languageMappings)
+    {
+        this.languageMappings = languageMappings;
+    }
+
+    public List<String> getProviderClassNames()
+    {
+        return providerClassNames;
+    }
+
+    public void setProviderClassNames(List<String> providerClassNames)
+    {
+        this.providerClassNames = providerClassNames;
+    }
+
+    public List<String> getResourceClassNames()
+    {
+        return resourceClassNames;
+    }
+
+    public void setResourceClassNames(List<String> resourceClassNames)
+    {
+        this.resourceClassNames = resourceClassNames;
+    }
+
+    public boolean isScanProviders()
+    {
+        return scanProviders;
+    }
+
+    public void setScanProviders(boolean scanProviders)
+    {
+        this.scanProviders = scanProviders;
+    }
+
+    public boolean isScanResources()
+    {
+        return scanResources;
+    }
+
+    public void setScanResources(boolean scanResources)
+    {
+        this.scanResources = scanResources;
+    }
+
+    public boolean isUseBuiltinProviders()
+    {
+        return useBuiltinProviders;
+    }
+
+    public void setUseBuiltinProviders(boolean useBuiltinProviders)
+    {
+        this.useBuiltinProviders = useBuiltinProviders;
+    }
+
+    public String getResourcePathPrefix()
+    {
+        return resourcePathPrefix;
+    }
+
+    public void setResourcePathPrefix(String resourcePathPrefix)
+    {
+        this.resourcePathPrefix = resourcePathPrefix;
+    }
+
+    public boolean isStripSeamResourcePath()
+    {
+        return stripSeamResourcePath;
+    }
+
+    public void setStripSeamResourcePath(boolean stripSeamResourcePath)
+    {
+        this.stripSeamResourcePath = stripSeamResourcePath;
+    }
+}

Deleted: trunk/src/resteasy/org/jboss/seam/resteasy/ApplicationConfig.java
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/ApplicationConfig.java	2009-01-30 11:52:09 UTC (rev 9988)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/ApplicationConfig.java	2009-01-30 13:59:00 UTC (rev 9989)
@@ -1,182 +0,0 @@
-package org.jboss.seam.resteasy;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.Component;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Install;
-
-import javax.ws.rs.core.MediaType;
-import java.util.*;
-
-/**
- * Resteasy and JAX-RS configuration, override in components.xml to
- * customize Resteasy settings.
- *
- * @author Christian Bauer
- */
- at Name("org.jboss.seam.resteasy.applicationConfig")
- at Scope(ScopeType.APPLICATION)
- at Install(precedence = Install.BUILT_IN)
- at AutoCreate
-public class ApplicationConfig extends javax.ws.rs.core.ApplicationConfig
-{
-
-    private Map<Class<?>, Component> providerClasses = new HashMap<Class<?>, Component>();
-    private Map<Class<?>, Component> resourceClasses = new HashMap<Class<?>, Component>();
-
-    private List<String> providerClassNames = new ArrayList<String>();
-    private List<String> resourceClassNames = new ArrayList<String>();
-
-    private Map<String, String> mediaTypeMappings = new HashMap<String, String>();
-    private Map<String, String> languageMappings = new HashMap<String, String>();
-
-    private boolean scanProviders = true;
-    private boolean scanResources = true;
-    private boolean useBuiltinProviders = true;
-
-    private String resourcePathPrefix = "/rest";
-    private boolean stripSeamResourcePath = true;
-
-    public ApplicationConfig()
-    {
-        super();
-    }
-
-    public Set<Class<?>> getProviderClasses()
-    {
-        return providerClasses.keySet();
-    }
-
-    public Set<Class<?>> getResourceClasses()
-    {
-        return resourceClasses.keySet();
-    }
-
-    public void addProviderClass(Class<?> clazz, Component component)
-    {
-        providerClasses.put(clazz, component);
-    }
-
-    public void removeProviderClass(Class<?> clazz)
-    {
-        providerClasses.remove(clazz);
-    }
-
-    public void addResourceClass(Class<?> clazz, Component component)
-    {
-        resourceClasses.put(clazz, component);
-    }
-
-    public void removeResourceClass(Class<?> clazz)
-    {
-        resourceClasses.remove(clazz);
-    }
-
-    public Component getProviderClassComponent(Class clazz)
-    {
-        return providerClasses.get(clazz) != null ? providerClasses.get(clazz) : null;
-    }
-
-    public Component getResourceClassComponent(Class clazz)
-    {
-        return resourceClasses.get(clazz) != null ? resourceClasses.get(clazz) : null;
-    }
-
-    public Map<String, MediaType> getMediaTypeMappings()
-    {
-        Map<String, MediaType> extMap = new HashMap<String, MediaType>();
-        for (String ext : mediaTypeMappings.keySet())
-        {
-            String value = mediaTypeMappings.get(ext);
-            extMap.put(ext, MediaType.valueOf(value));
-        }
-        return extMap;
-    }
-
-    public void setMediaTypeMappings(Map<String, String> mediaTypeMappings)
-    {
-        this.mediaTypeMappings = mediaTypeMappings;
-    }
-
-    public Map<String, String> getLanguageMappings()
-    {
-        return languageMappings;
-    }
-
-    public void setLanguageMappings(Map<String, String> languageMappings)
-    {
-        this.languageMappings = languageMappings;
-    }
-
-    public List<String> getProviderClassNames()
-    {
-        return providerClassNames;
-    }
-
-    public void setProviderClassNames(List<String> providerClassNames)
-    {
-        this.providerClassNames = providerClassNames;
-    }
-
-    public List<String> getResourceClassNames()
-    {
-        return resourceClassNames;
-    }
-
-    public void setResourceClassNames(List<String> resourceClassNames)
-    {
-        this.resourceClassNames = resourceClassNames;
-    }
-
-    public boolean isScanProviders()
-    {
-        return scanProviders;
-    }
-
-    public void setScanProviders(boolean scanProviders)
-    {
-        this.scanProviders = scanProviders;
-    }
-
-    public boolean isScanResources()
-    {
-        return scanResources;
-    }
-
-    public void setScanResources(boolean scanResources)
-    {
-        this.scanResources = scanResources;
-    }
-
-    public boolean isUseBuiltinProviders()
-    {
-        return useBuiltinProviders;
-    }
-
-    public void setUseBuiltinProviders(boolean useBuiltinProviders)
-    {
-        this.useBuiltinProviders = useBuiltinProviders;
-    }
-
-    public String getResourcePathPrefix()
-    {
-        return resourcePathPrefix;
-    }
-
-    public void setResourcePathPrefix(String resourcePathPrefix)
-    {
-        this.resourcePathPrefix = resourcePathPrefix;
-    }
-
-    public boolean isStripSeamResourcePath()
-    {
-        return stripSeamResourcePath;
-    }
-
-    public void setStripSeamResourcePath(boolean stripSeamResourcePath)
-    {
-        this.stripSeamResourcePath = stripSeamResourcePath;
-    }
-}

Modified: trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java	2009-01-30 11:52:09 UTC (rev 9988)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java	2009-01-30 13:59:00 UTC (rev 9989)
@@ -23,7 +23,7 @@
 @Scope(ScopeType.APPLICATION)
 @Startup
 @AutoCreate
- at Install(classDependencies = "org.resteasy.Dispatcher")
+ at Install(classDependencies = "org.jboss.resteasy.core.Dispatcher")
 public class ResteasyBootstrap
 {
 
@@ -31,7 +31,7 @@
     Log log;
 
     @In
-    protected ApplicationConfig applicationConfig;
+    protected Application application;
 
     @Create
     public void onStartup()
@@ -40,7 +40,7 @@
 
         Collection<Class<?>> annotatedProviderClasses = null;
         Collection<Class<?>> annotatedResourceClasses = null;
-        if (applicationConfig.isScanProviders() || applicationConfig.isScanResources())
+        if (application.isScanProviders() || application.isScanResources())
         {
             log.debug("scanning all classes for JAX-RS annotations");
 
@@ -76,10 +76,10 @@
         Collection<Class> providerClasses = new HashSet<Class>();
         try
         {
-            if (applicationConfig.isScanProviders() && annotatedProviderClasses != null)
+            if (application.isScanProviders() && annotatedProviderClasses != null)
                 providerClasses.addAll(annotatedProviderClasses);
 
-            for (String s : new HashSet<String>(applicationConfig.getProviderClassNames()))
+            for (String s : new HashSet<String>(application.getProviderClassNames()))
                 providerClasses.add(Reflections.classForName(s));
 
         }
@@ -90,7 +90,7 @@
         for (Class providerClass : providerClasses)
         {
             // Ignore built-in providers, we register them manually later
-            if (providerClass.getName().startsWith("org.resteasy.plugins.providers")) continue;
+            if (providerClass.getName().startsWith("org.jboss.resteasy.plugins.providers")) continue;
 
             Component seamComponent = null;
             // Check if this is also a Seam component bean class
@@ -114,10 +114,10 @@
             {
                 log.debug("registering provider class: " + providerClass.getName());
             }
-            applicationConfig.addProviderClass(providerClass, seamComponent);
+            application.addProviderClass(providerClass, seamComponent);
         }
-        if (applicationConfig.getProviderClasses().size() == 0 &&
-                !applicationConfig.isUseBuiltinProviders())
+        if (application.getProviderClasses().size() == 0 &&
+                !application.isUseBuiltinProviders())
         {
             log.info("no RESTEasy provider classes registered");
         }
@@ -129,10 +129,10 @@
         Collection<Class> resourceClasses = new HashSet<Class>();
         try
         {
-            if (applicationConfig.isScanResources() && annotatedResourceClasses != null)
+            if (application.isScanResources() && annotatedResourceClasses != null)
                 resourceClasses.addAll(annotatedResourceClasses);
 
-            for (String s : new HashSet<String>(applicationConfig.getResourceClassNames()))
+            for (String s : new HashSet<String>(application.getResourceClassNames()))
                 resourceClasses.add(Reflections.classForName(s));
 
         }
@@ -154,9 +154,9 @@
             {
                 log.debug("registering resource class with JAX-RS default lifecycle: " + resourceClass.getName());
             }
-            applicationConfig.addResourceClass(resourceClass, seamComponent);
+            application.addResourceClass(resourceClass, seamComponent);
         }
-        if (applicationConfig.getResourceClasses().size() == 0)
+        if (application.getClasses().size() == 0)
             log.info("no JAX-RS resource classes registered");
     }
 

Modified: trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java	2009-01-30 11:52:09 UTC (rev 9988)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java	2009-01-30 13:59:00 UTC (rev 9989)
@@ -2,13 +2,26 @@
 
 import org.jboss.seam.Component;
 import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.*;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Startup;
 import org.jboss.seam.log.Log;
-import org.resteasy.Dispatcher;
-import org.resteasy.plugins.providers.RegisterBuiltin;
-import org.resteasy.plugins.server.servlet.HttpServletDispatcher;
-import org.resteasy.plugins.server.resourcefactory.POJOResourceFactory;
-import org.resteasy.spi.*;
+import org.jboss.resteasy.core.AsynchronousDispatcher;
+import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
+import org.jboss.resteasy.plugins.server.resourcefactory.POJOResourceFactory;
+import org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher;
+import org.jboss.resteasy.spi.HttpRequest;
+import org.jboss.resteasy.spi.HttpResponse;
+import org.jboss.resteasy.spi.InjectorFactory;
+import org.jboss.resteasy.spi.PropertyInjector;
+import org.jboss.resteasy.spi.Registry;
+import org.jboss.resteasy.spi.ResourceFactory;
+import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
 /**
  * An extended version of the RESTEasy dispatcher, configured on Seam application
@@ -19,14 +32,14 @@
  */
 @Name("org.jboss.seam.resteasy.dispatcher")
 @Scope(ScopeType.APPLICATION)
- at Startup(depends = "resteasyBootstrap")
+ at Startup(depends = "org.jboss.seam.resteasy.bootstrap")
 @AutoCreate
- at Install(classDependencies = "org.resteasy.Dispatcher")
+ at Install(classDependencies = "org.jboss.resteasy.core.Dispatcher")
 public class ResteasyDispatcher extends HttpServletDispatcher
 {
 
     @In
-    ApplicationConfig applicationConfig;
+    Application application;
 
     @Logger
     Log log;
@@ -38,16 +51,16 @@
 
         ResteasyProviderFactory providerFactory = new ResteasyProviderFactory();
         ResteasyProviderFactory.setInstance(providerFactory); // This is really necessary
-        setDispatcher(new Dispatcher(providerFactory));
+        setDispatcher(new AsynchronousDispatcher(providerFactory));
 
-        getDispatcher().setLanguageMappings(applicationConfig.getLanguageMappings());
-        getDispatcher().setMediaTypeMappings(applicationConfig.getMediaTypeMappings());
+        getDispatcher().setLanguageMappings(application.getLanguageMappings());
+        getDispatcher().setMediaTypeMappings(application.getMediaTypeMappings());
 
         // Resource registration
         Registry registry = getDispatcher().getRegistry();
-        for (final Class resourceClass : applicationConfig.getResourceClasses())
+        for (final Class resourceClass : application.getClasses())
         {
-            final Component seamComponent = applicationConfig.getResourceClassComponent(resourceClass);
+            final Component seamComponent = application.getResourceClassComponent(resourceClass);
             if (seamComponent != null)
             {
                 // Seam component lookup when call is dispatched to resource
@@ -92,14 +105,14 @@
         }
 
         // Provider registration
-        if (applicationConfig.isUseBuiltinProviders())
+        if (application.isUseBuiltinProviders())
         {
             log.info("registering built-in RESTEasy providers");
             RegisterBuiltin.register(providerFactory);
         }
-        for (Class providerClass : applicationConfig.getProviderClasses())
+        for (Class providerClass : application.getProviderClasses())
         {
-            Component seamComponent = applicationConfig.getProviderClassComponent(providerClass);
+            Component seamComponent = application.getProviderClassComponent(providerClass);
             if (seamComponent != null)
             {
                 if (ScopeType.STATELESS.equals(seamComponent.getScope()))

Modified: trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java	2009-01-30 11:52:09 UTC (rev 9988)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java	2009-01-30 13:59:00 UTC (rev 9989)
@@ -9,17 +9,18 @@
 import org.jboss.seam.log.Log;
 import org.jboss.seam.servlet.ContextualHttpServletRequest;
 import org.jboss.seam.web.AbstractResource;
-import org.resteasy.plugins.server.servlet.HttpServletDispatcher;
-import org.resteasy.plugins.server.servlet.HttpServletInputMessage;
-import org.resteasy.plugins.server.servlet.HttpServletResponseWrapper;
-import org.resteasy.plugins.server.servlet.ServletSecurityContext;
-import org.resteasy.specimpl.PathSegmentImpl;
-import org.resteasy.specimpl.UriBuilderImpl;
-import org.resteasy.specimpl.UriInfoImpl;
-import org.resteasy.spi.HttpRequest;
-import org.resteasy.spi.HttpResponse;
-import org.resteasy.spi.ResteasyProviderFactory;
-import org.resteasy.util.PathHelper;
+import org.jboss.resteasy.core.SynchronousDispatcher;
+import org.jboss.resteasy.plugins.server.servlet.HttpServletInputMessage;
+import org.jboss.resteasy.plugins.server.servlet.HttpServletResponseWrapper;
+import org.jboss.resteasy.plugins.server.servlet.ServletSecurityContext;
+import org.jboss.resteasy.plugins.server.servlet.ServletUtil;
+import org.jboss.resteasy.specimpl.PathSegmentImpl;
+import org.jboss.resteasy.specimpl.UriBuilderImpl;
+import org.jboss.resteasy.specimpl.UriInfoImpl;
+import org.jboss.resteasy.spi.HttpRequest;
+import org.jboss.resteasy.spi.HttpResponse;
+import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.jboss.resteasy.util.PathHelper;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
@@ -51,7 +52,7 @@
     @Override
     public String getResourcePath()
     {
-        ApplicationConfig appConfig = (ApplicationConfig)Component.getInstance(ApplicationConfig.class);
+        Application appConfig = (Application)Component.getInstance(Application.class);
         return appConfig.getResourcePathPrefix();
     }
 
@@ -74,7 +75,7 @@
                 public void process() throws ServletException, IOException
                 {
 
-                    HttpHeaders headers = HttpServletDispatcher.extractHttpHeaders(request);
+                    HttpHeaders headers = ServletUtil.extractHttpHeaders(request);
                     String path = PathHelper.getEncodedPathInfo(request.getRequestURI(), request.getContextPath());
                     URI absolutePath;
                     try
@@ -86,7 +87,7 @@
                         builder.host(absolute.getHost());
                         builder.port(absolute.getPort());
                         builder.path(absolute.getPath());
-                        builder.replaceQueryParams(absolute.getQuery());
+                        builder.replaceQuery(absolute.getQuery());
                         absolutePath = builder.build();
                     }
                     catch (MalformedURLException e)
@@ -94,7 +95,7 @@
                         throw new RuntimeException(e);
                     }
 
-                    ApplicationConfig appConfig = (ApplicationConfig)Component.getInstance(ApplicationConfig.class);
+                    Application appConfig = (Application)Component.getInstance(Application.class);
                     if (appConfig.isStripSeamResourcePath()) {
                         log.debug("removing SeamResourceServlet url-pattern and dispatcher prefix from request path");
                         path = path.substring(path.indexOf(getResourcePath())+getResourcePath().length());
@@ -105,25 +106,13 @@
                     UriInfoImpl uriInfo = new UriInfoImpl(absolutePath, path, request.getQueryString(), pathSegments);
 
                     HttpRequest in;
-                    try
-                    {
-                        in =
-                            new HttpServletInputMessage(
-                                headers,
-                                request.getInputStream(),
-                                uriInfo,
-                                request.getMethod().toUpperCase()
-                            );
-                    }
-                    catch (IOException e)
-                    {
-                        throw new RuntimeException(e);
-                    }
-
                     ResteasyDispatcher dispatcher =
                             (ResteasyDispatcher) Component.getInstance(ResteasyDispatcher.class);
                     HttpResponse theResponse =
                             new HttpServletResponseWrapper(response, dispatcher.getDispatcher().getProviderFactory());
+                    in = new HttpServletInputMessage( 
+                          request, theResponse, headers, uriInfo, request.getMethod().toUpperCase(), (SynchronousDispatcher)dispatcher.getDispatcher());
+                    
                     dispatcher.getDispatcher().invoke(in, theResponse);
                 }
             }.run();




More information about the seam-commits mailing list