cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r894487 - in /cocoon/cocoon3/trunk: cocoon-controller/src/main/java/org/apache/cocoon/controller/ cocoon-rest/src/main/java/org/apache/cocoon/rest/controller/
Date Tue, 29 Dec 2009 21:43:08 GMT
Author: reinhard
Date: Tue Dec 29 21:43:07 2009
New Revision: 894487

URL: http://svn.apache.org/viewvc?rev=894487&view=rev
Log:
there is no need anymore that the invoke() method returns the content-type (already set at
RestResponseMetaData) 

Modified:
    cocoon/cocoon3/trunk/cocoon-controller/src/main/java/org/apache/cocoon/controller/Controller.java
    cocoon/cocoon3/trunk/cocoon-controller/src/main/java/org/apache/cocoon/controller/SpringControllerComponent.java
    cocoon/cocoon3/trunk/cocoon-rest/src/main/java/org/apache/cocoon/rest/controller/SpringRESTController.java

Modified: cocoon/cocoon3/trunk/cocoon-controller/src/main/java/org/apache/cocoon/controller/Controller.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-controller/src/main/java/org/apache/cocoon/controller/Controller.java?rev=894487&r1=894486&r2=894487&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-controller/src/main/java/org/apache/cocoon/controller/Controller.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-controller/src/main/java/org/apache/cocoon/controller/Controller.java
Tue Dec 29 21:43:07 2009
@@ -28,9 +28,9 @@
      * @param string
      * @param inputParameters
      * @param configuration
-     * 
+     *
      * @return The mime-type of the returned output stream.
      */
-    String invoke(OutputStream outputStream, String string, Map<String, Object> inputParameters,
+    void invoke(OutputStream outputStream, String string, Map<String, Object> inputParameters,
             Map<String, ? extends Object> configuration);
 }

Modified: cocoon/cocoon3/trunk/cocoon-controller/src/main/java/org/apache/cocoon/controller/SpringControllerComponent.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-controller/src/main/java/org/apache/cocoon/controller/SpringControllerComponent.java?rev=894487&r1=894486&r2=894487&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-controller/src/main/java/org/apache/cocoon/controller/SpringControllerComponent.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-controller/src/main/java/org/apache/cocoon/controller/SpringControllerComponent.java
Tue Dec 29 21:43:07 2009
@@ -37,31 +37,30 @@
     private Map<String, Object> parameters;
     private String selector;
     private Map<String, ? extends Object> configuration;
-    private String contentType;
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.apache.cocoon.pipeline.component.Starter#execute()
      */
     public void execute() {
         Controller controller = (Controller) this.applicationContext.getBean(Controller.class.getName()
+ "/"
                 + this.beanName, Controller.class);
-        this.contentType = controller.invoke(this.outputStream, this.selector, this.parameters,
this.configuration);
+        controller.invoke(this.outputStream, this.selector, this.parameters, this.configuration);
     }
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.apache.cocoon.pipeline.component.Finisher#getContentType()
      */
     public String getContentType() {
-        return this.contentType;
+        return null;
     }
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
      */
     public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
@@ -70,7 +69,7 @@
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.apache.cocoon.pipeline.component.PipelineComponent#setConfiguration(java.util.Map)
      */
     @Override
@@ -82,7 +81,7 @@
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.apache.cocoon.pipeline.component.PipelineComponent#setup(java.util.Map)
      */
     @Override
@@ -92,7 +91,7 @@
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.apache.cocoon.pipeline.component.Finisher#setOutputStream(java.io.OutputStream)
      */
     public void setOutputStream(OutputStream outputStream) {

Modified: cocoon/cocoon3/trunk/cocoon-rest/src/main/java/org/apache/cocoon/rest/controller/SpringRESTController.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-rest/src/main/java/org/apache/cocoon/rest/controller/SpringRESTController.java?rev=894487&r1=894486&r2=894487&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-rest/src/main/java/org/apache/cocoon/rest/controller/SpringRESTController.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-rest/src/main/java/org/apache/cocoon/rest/controller/SpringRESTController.java
Tue Dec 29 21:43:07 2009
@@ -69,7 +69,7 @@
     private ApplicationContext applicationContext;
     private MethodDelegator methodDelegator;
 
-    public String invoke(OutputStream outputStream, String controllerName, Map<String,
Object> inputParameters,
+    public void invoke(OutputStream outputStream, String controllerName, Map<String, Object>
inputParameters,
             Map<String, ? extends Object> configuration) {
         if (!this.applicationContext.isPrototype(controllerName)) {
             throw new ProcessingException("A REST controller bean MUST run within the 'prototype'
scope.");
@@ -91,9 +91,6 @@
 
             // set the content type with the result produced by the restResponse execution
             ResponseHeaderCollector.setMimeType(restResponseMetaData.getContentType());
-
-            // return the content type
-            return restResponseMetaData.getContentType();
         } catch (Exception e) {
             throw ExceptionHandler.getInvocationException(e);
         }



Mime
View raw message