You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by da...@apache.org on 2007/02/04 15:43:02 UTC

svn commit: r503416 - in /cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components: ./ src/main/java/org/apache/cocoon/servletservice/components/ src/main/resources/META-INF/cocoon/avalon/ src/main/resources/META-INF/cocoon/spring/

Author: danielf
Date: Sun Feb  4 06:43:01 2007
New Revision: 503416

URL: http://svn.apache.org/viewvc?view=rev&rev=503416
Log:
POJOfied the servlet service components and removed unnecessary dependencies.

Added:
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-path-module.xml   (with props)
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-property-module.xml   (with props)
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-servlet-source-factory.xml   (with props)
Removed:
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/avalon/
Modified:
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/pom.xml
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/BlockPathModule.java
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/BlockPropertyModule.java
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSourceFactory.java

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/pom.xml?view=diff&rev=503416&r1=503415&r2=503416
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/pom.xml (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/pom.xml Sun Feb  4 06:43:01 2007
@@ -39,28 +39,13 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.cocoon</groupId>
-      <artifactId>cocoon-core</artifactId>
-      <version>2.2.0-M3-SNAPSHOT</version>
+      <artifactId>cocoon-sitemap-impl</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.cocoon</groupId>
       <artifactId>cocoon-servlet-service-impl</artifactId>
       <version>1.0.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.excalibur.components.sourceresolve</groupId>
-      <artifactId>excalibur-sourceresolve</artifactId>
-      <version>2.1</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.apache.avalon.framework</groupId>
-          <artifactId>avalon-framework-impl</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.avalon.logkit</groupId>
-          <artifactId>avalon-logkit</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
     <dependency>
       <groupId>javax.servlet</groupId>

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/BlockPathModule.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/BlockPathModule.java?view=diff&rev=503416&r1=503415&r2=503416
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/BlockPathModule.java (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/BlockPathModule.java Sun Feb  4 06:43:01 2007
@@ -24,9 +24,8 @@
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.thread.ThreadSafe;
-import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.components.modules.input.InputModule;
+import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.environment.internal.EnvironmentHelper;
 import org.apache.cocoon.servletservice.CallStack;
 import org.apache.cocoon.servletservice.ServletServiceContext;
@@ -36,7 +35,7 @@
  *
  * @version $Id: BlockPathModule.java 448464 2006-09-21 05:29:11Z crossley $
  */
-public class BlockPathModule implements InputModule, ThreadSafe {
+public class BlockPathModule implements InputModule {
 
     public Object getAttribute( String name, Configuration modeConf, Map objectModel )
     throws ConfigurationException {

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/BlockPropertyModule.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/BlockPropertyModule.java?view=diff&rev=503416&r1=503415&r2=503416
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/BlockPropertyModule.java (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/BlockPropertyModule.java Sun Feb  4 06:43:01 2007
@@ -22,7 +22,6 @@
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.components.modules.input.InputModule;
 import org.apache.cocoon.servletservice.CallStack;
 
@@ -31,7 +30,7 @@
  *
  * @version $Id: BlockPropertyModule.java 448464 2006-09-21 05:29:11Z crossley $
  */
-public class BlockPropertyModule implements InputModule, ThreadSafe {
+public class BlockPropertyModule implements InputModule {
 
     public Object getAttribute( String name, Configuration modeConf, Map objectModel )
     throws ConfigurationException {

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java?view=diff&rev=503416&r1=503415&r2=503416
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java Sun Feb  4 06:43:01 2007
@@ -21,7 +21,6 @@
 
 import javax.servlet.ServletException;
 
-import org.apache.avalon.framework.logger.Logger;
 import org.apache.cocoon.CascadingIOException;
 import org.apache.cocoon.servletservice.ServletConnection;
 import org.apache.excalibur.source.Source;
@@ -38,7 +37,7 @@
     
     private ServletConnection blockConnection;
     
-    public ServletSource(String location, Logger logger) throws IOException {
+    public ServletSource(String location) throws IOException {
         // the systemId (returned by getURI()) is by default null
         // using the block uri is a little bit questionable as it only is valid
         // whithin the current block, not globally

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSourceFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSourceFactory.java?view=diff&rev=503416&r1=503415&r2=503416
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSourceFactory.java (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSourceFactory.java Sun Feb  4 06:43:01 2007
@@ -20,52 +20,65 @@
 import java.net.MalformedURLException;
 import java.util.Map;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceFactory;
 import org.apache.excalibur.source.SourceUtil;
 import org.apache.excalibur.source.URIAbsolutizer;
 
 /**
- * This class implements the block: protocol.
- *
- *
+ * This class implements the servlet: protocol.
+ * 
+ * 
  * @version $Id$
  */
-public final class ServletSourceFactory
-extends AbstractLogEnabled
-implements SourceFactory, ThreadSafe, URIAbsolutizer
-{
+public final class ServletSourceFactory implements SourceFactory,
+        URIAbsolutizer {
 
-/* (non-Javadoc)
- * @see org.apache.excalibur.source.SourceFactory#getSource(java.lang.String, java.util.Map)
- */
-public Source getSource( String location, Map parameters )
-    throws MalformedURLException, IOException {
-    if( getLogger().isDebugEnabled() ) {
-        getLogger().debug( "Creating source object for " + location );
+    /** By default we use the logger for this class. */
+    private Log logger = LogFactory.getLog(getClass());
+
+    private Log getLogger() {
+        return this.logger;
     }
 
-    return new ServletSource(location, getLogger());
-}
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.excalibur.source.SourceFactory#getSource(java.lang.String,
+     *      java.util.Map)
+     */
+    public Source getSource(String location, Map parameters)
+            throws MalformedURLException, IOException {
+        if (getLogger().isDebugEnabled()) {
+            getLogger().debug("Creating source object for " + location);
+        }
 
-/* (non-Javadoc)
- * @see org.apache.excalibur.source.SourceFactory#release(org.apache.excalibur.source.Source)
- */
-public void release( Source source ) {
-    if ( null != source ) {
-        if ( this.getLogger().isDebugEnabled() ) {
-            this.getLogger().debug("Releasing source " + source.getURI());
+        return new ServletSource(location);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.excalibur.source.SourceFactory#release(org.apache.excalibur.source.Source)
+     */
+    public void release(Source source) {
+        if (null != source) {
+            if (this.getLogger().isDebugEnabled()) {
+                this.getLogger().debug("Releasing source " + source.getURI());
+            }
         }
     }
-}
 
-/* (non-Javadoc)
- * @see org.apache.excalibur.source.URIAbsolutizer#absolutize(java.lang.String, java.lang.String)
- */
-public String absolutize(String baseURI, String location) {
-    return SourceUtil.absolutize(baseURI, location, true);
-}
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.excalibur.source.URIAbsolutizer#absolutize(java.lang.String,
+     *      java.lang.String)
+     */
+    public String absolutize(String baseURI, String location) {
+        return SourceUtil.absolutize(baseURI, location, true);
+    }
 
 }

Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-path-module.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-path-module.xml?view=auto&rev=503416
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-path-module.xml (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-path-module.xml Sun Feb  4 06:43:01 2007
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<!-- SVN $Id$ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+  <bean name="org.apache.cocoon.components.modules.input.InputModule/block-path" class="org.apache.cocoon.servletservice.components.BlockPathModule"/>
+
+</beans>

Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-path-module.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-path-module.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-property-module.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-property-module.xml?view=auto&rev=503416
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-property-module.xml (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-property-module.xml Sun Feb  4 06:43:01 2007
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<!-- SVN $Id$ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+  <bean name="org.apache.cocoon.components.modules.input.InputModule/block-property" class="org.apache.cocoon.servletservice.components.BlockPropertyModule"/>
+
+</beans>

Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-property-module.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-property-module.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-servlet-source-factory.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-servlet-source-factory.xml?view=auto&rev=503416
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-servlet-source-factory.xml (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-servlet-source-factory.xml Sun Feb  4 06:43:01 2007
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<!-- SVN $Id$ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+  <!--+
+      | Source Factories
+      |
+      | Each source factory adds a special uri schemes to the system.
+      +-->
+  <bean name="org.apache.excalibur.source.SourceFactory/servlet" class="org.apache.cocoon.servletservice.components.ServletSourceFactory"/>
+
+</beans>

Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-servlet-source-factory.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-servlet-source-factory.xml
------------------------------------------------------------------------------
    svn:keywords = Id