cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r482656 [1/2] - in /cocoon/trunk/tools/cocoon-rcl: ./ cocoon-rcl-plugin-demo/ cocoon-rcl-plugin-demo/src/ cocoon-rcl-plugin-demo/src/main/ cocoon-rcl-plugin-demo/src/main/java/ cocoon-rcl-plugin-demo/src/main/java/demo/ cocoon-rcl-plugin-de...
Date Tue, 05 Dec 2006 14:03:21 GMT
Author: reinhard
Date: Tue Dec  5 06:03:18 2006
New Revision: 482656

URL: http://svn.apache.org/viewvc?view=rev&rev=482656
Log:
initial commit of the reloading-classloaderwrapper which is used by the cocoon-rcl-plugin, a Maven 2 plugin, to create a web application that loads all servlets, listeners and filters by using wrapper classes; additionally there is a Jetty 6.0.1 container that can be used to run the cocoon-rcl-plugin-demo project

Added:
    cocoon/trunk/tools/cocoon-rcl/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/pom.xml   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyBean.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyGenerator.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.js   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.xml   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/sitemap.xmap   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/block.xml   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/demo-application-context.xml   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/pom.xml   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/ReloadingWebappMojo.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/RwmProperties.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/applicationContext.xml   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/log4j.xml   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/web.xml   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/apache/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/apache/cocoon/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/apache/cocoon/maven/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/apache/cocoon/maven/rcl/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/apache/cocoon/maven/rcl/RwmPropertiesTest.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/apache/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/apache/cocoon/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/apache/cocoon/maven/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/apache/cocoon/maven/rcl/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/apache/cocoon/maven/rcl/rcl.properties   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/pom.xml   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/CocoonReloadingListener.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/JarListener.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/ReloadingClassloaderCreationException.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/ReloadingClassloaderManager.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/ReloadingListener.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/ReloadingNotificationSubscriber.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/ReloadingServlet.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/ReloadingServletFilter.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/ReloadingSpringFilter.java   (with props)
    cocoon/trunk/tools/cocoon-rcl/pom.xml   (with props)

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/pom.xml?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/pom.xml (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/pom.xml Tue Dec  5 06:03:18 2006
@@ -0,0 +1,119 @@
+<?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.
+-->
+<!--+
+    | @version $Id$
+    |
+    +-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>jar</packaging>
+  <name>cocoon-rcl-plugin-demo</name>
+  <groupId>org.apache.cocoon</groupId>
+  <artifactId>cocoon-rcl-plugin-demo</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <build>
+    <!-- with multimodule project setting finalName like this results in having 2 jars in cocoon/lib:
+         my-module.jar and my-module-1.0-SNAPSHOT.jar -->
+    <!-- finalName>cocoon-rcl-plugin-demo2</finalName -->
+    <plugins>
+      <plugin>
+        <groupId>org.apache.cocoon</groupId>
+        <artifactId>cocoon-rcl-plugin</artifactId>
+        <version>1.0.0-M1-SNAPSHOT</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.cocoon</groupId>
+        <artifactId>cocoon-deployer-plugin</artifactId>
+        <version>1.0.0-M2-SNAPSHOT</version>
+      </plugin>      
+      <plugin>
+        <groupId>org.mortbay.jetty</groupId>
+        <artifactId>maven-jetty-plugin</artifactId>
+        <version>6.0.2</version>
+        <configuration>
+          <connectors>
+            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+              <port>8888</port>
+              <maxIdleTime>30000</maxIdleTime>
+            </connector>
+          </connectors>
+          <webAppSourceDirectory>${project.build.directory}/${pom.artifactId}-${pom.version}</webAppSourceDirectory>
+          <contextPath>/</contextPath>
+          <systemProperties>
+            <systemProperty>
+              <name>org.apache.commons.logging.Log</name>
+              <value>org.apache.commons.logging.impl.SimpleLog</value>
+            </systemProperty>
+            <systemProperty>
+              <name>org.apache.cocoon.mode</name>
+              <value>dev</value>
+            </systemProperty>            
+          </systemProperties>          
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.1</version>
+        <configuration>
+          <archive>
+            <manifestEntries>
+              <Cocoon-Block-Name>${pom.artifactId}</Cocoon-Block-Name>
+            </manifestEntries>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-core</artifactId>
+      <version>2.2.0-M2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-blocks-fw-impl</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
+    </dependency>      
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-forms-impl</artifactId>
+      <version>1.0.0-M2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-template-impl</artifactId>
+      <version>1.0.0-M2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>com.indoqa.site</groupId>
+      <artifactId>indoqa-site-app</artifactId>
+      <version>1.0-SNAPSHOT</version>      
+    </dependency>
+  </dependencies>
+  <repositories>
+    <repository>
+      <id>apache.snapshot</id>
+      <name>Apache Snapshot Repository</name>
+      <url>http://svn.apache.org/maven-snapshot-repository</url>
+    </repository>
+  </repositories>
+</project>

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyBean.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyBean.java?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyBean.java (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyBean.java Tue Dec  5 06:03:18 2006
@@ -0,0 +1,30 @@
+/*
+ * 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 demo;
+
+public class MyBean {
+    
+    public String message = "This is a message coming from a Spring bean!";
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public String getMessage() {
+        return this.message;
+    }
+}

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyBean.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyGenerator.java?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyGenerator.java (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyGenerator.java Tue Dec  5 06:03:18 2006
@@ -0,0 +1,43 @@
+/*
+ * 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 demo;
+
+
+import java.io.IOException;
+
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.generation.AbstractGenerator;
+import org.apache.cocoon.xml.AttributesImpl;
+import org.xml.sax.SAXException;
+
+public final class MyGenerator extends AbstractGenerator {
+
+    public void generate() throws IOException, SAXException, ProcessingException {
+        contentHandler.startDocument();
+        contentHandler.startElement("","html","html", new AttributesImpl());
+        contentHandler.startElement("","body","body", new AttributesImpl());
+        
+        //Change message to see the Reloading classloader working
+        final char[] message = "generator!".toCharArray();
+        contentHandler.characters(message, 0, message.length);
+        
+        contentHandler.endElement("","body","body");
+        contentHandler.endElement("","html","html");
+        contentHandler.endDocument();
+    }
+    
+}

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/java/demo/MyGenerator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.js
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.js?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.js (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.js Tue Dec  5 06:03:18 2006
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+//
+// @version $Id: demo.js 448451 2006-09-21 04:04:16Z crossley $
+//
+
+function demo() {
+    var demoBean = cocoon.getComponent("demo");
+    cocoon.sendPage("screens/demo", 
+        { 
+            "message" : demoBean.message
+        }
+    );
+}

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.xml?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.xml (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.xml Tue Dec  5 06:03:18 2006
@@ -0,0 +1,21 @@
+<?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.
+-->
+<demo>
+  <module>org.apache.cocoon.:cocoon-rcl-plugin-demo!</module>
+  <spring>#{message}</spring>
+</demo>

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/demo.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/sitemap.xmap?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/sitemap.xmap (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/sitemap.xmap Tue Dec  5 06:03:18 2006
@@ -0,0 +1,42 @@
+<?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.
+-->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+  <map:components>
+    <map:generators default="file">
+      <map:generator logger="sitemap.generator.mygenerator" name="mygenerator" src="demo.MyGenerator"/>
+    </map:generators>
+  </map:components>
+  <map:flow language="javascript">
+    <map:script src="demo.js"/>
+  </map:flow>
+  <map:pipelines>
+    <map:pipeline>
+      <map:match pattern="demo">
+        <map:call function="demo"/>
+      </map:match>
+      <map:match pattern="">
+        <map:generate type="mygenerator"/>
+        <map:serialize/>
+      </map:match>
+      <map:match pattern="screens/demo">
+        <map:generate src="demo.xml" type="jx"/>
+        <map:serialize type="xml"/>
+      </map:match>
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/sitemap.xmap
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/COB-INF/sitemap.xmap
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/block.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/block.xml?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/block.xml (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/block.xml Tue Dec  5 06:03:18 2006
@@ -0,0 +1,31 @@
+<?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
+  und
+-->
+<!--+
+    | @version $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.xsd">
+  <bean id="org.apache.cocoon.cocoon-rcl-plugin-demo.block" class="org.apache.cocoon.blocks.BlockServlet">
+    <property name="mountPath" value="/cocoon-rcl-plugin-demo"/>
+    <property name="servletClass" value="org.apache.cocoon.sitemap.SitemapServlet"/>
+    <property name="blockContextURL" value="blockcontext:/cocoon-rcl-plugin-demo/"/>
+  </bean>
+</beans>

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/block.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/block.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/block.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/demo-application-context.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/demo-application-context.xml?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/demo-application-context.xml (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/demo-application-context.xml Tue Dec  5 06:03:18 2006
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
+    "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
+<!--
+  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.
+-->
+<beans>
+  <bean id="demo" class="demo.MyBean" scope="singleton">
+    <property name="message" value="This is a message coming from a Spring bean."/>
+  </bean>
+</beans>

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/demo-application-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/demo-application-context.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin-demo/src/main/resources/META-INF/cocoon/spring/demo-application-context.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/pom.xml?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/pom.xml (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/pom.xml Tue Dec  5 06:03:18 2006
@@ -0,0 +1,95 @@
+<?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.
+-->
+<!--+
+    | @version $Id$
+    +-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.cocoon</groupId>
+    <artifactId>cocoon-rcl-modules</artifactId>
+    <version>1-SNAPSHOT</version>
+  </parent>
+  <artifactId>cocoon-rcl-plugin</artifactId>
+  <version>1.0.0-M1-SNAPSHOT</version>
+  <packaging>maven-plugin</packaging>
+  <name>Cocoon Reloading Classloader - Maven 2 Plugin</name>
+  <dependencies>
+    <!-- utility libs -->
+    <dependency>
+      <groupId>antlr</groupId>
+      <artifactId>stringtemplate</artifactId>
+      <version>2.2</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>1.2</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.1</version>
+    </dependency>  
+    <!-- Maven specific -->
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact</artifactId>
+      <version>2.0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-model</artifactId>
+      <version>2.0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact</artifactId>
+      <version>2.0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+      <version>2.0.1</version>
+    </dependency>
+    <!-- test libs -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.2</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-plugin-plugin</artifactId>
+        <configuration>
+          <goalPrefix>cocoon-rcl</goalPrefix>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/ReloadingWebappMojo.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/ReloadingWebappMojo.java?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/ReloadingWebappMojo.java (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/ReloadingWebappMojo.java Tue Dec  5 06:03:18 2006
@@ -0,0 +1,376 @@
+/*
+ * 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.cocoon.maven.rcl;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.antlr.stringtemplate.StringTemplate;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.Validate;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.artifact.InvalidDependencyVersionException;
+import org.apache.maven.project.artifact.MavenMetadataSource;
+
+/**
+ * @goal webapp
+ * @requiresProject true
+ * @requiresDependencyResolution runtime
+ * @phase package
+ */
+public class ReloadingWebappMojo extends AbstractMojo {
+
+    private static final String WEB_INF_WEB_XML = "WEB-INF/web.xml";
+
+    private static final String WEB_INF_APP_CONTEXT = "WEB-INF/applicationContext.xml";
+
+    private static final String WEB_INF_LOG4J = "WEB-INF/log4j.xml";
+
+    private static final String WEB_INF_LIB = "WEB-INF/lib";
+    
+    private static final String WEB_INF_COCOON_SPRING_PROPS = "WEB-INF/cocoon/spring/rcl.properties";
+
+    private static final String WEB_INF_RCL_URLCL_CONF = "WEB-INF/cocoon/rclwrapper.urlcl.conf";
+    
+    private static final String WEB_INF_RCLWRAPPER_RCL_CONF = "WEB-INF/cocoon/rclwrapper.rcl.conf";    
+
+    /**
+     * The directory that contains the Cocoon web application.
+     * 
+     * @parameter expression="${cocoon.rcl.target}"
+     */
+    private File target = new File("./target/rcl");
+    
+    /**
+     * The directory that contains the Cocoon web application.
+     * 
+     * @parameter expression="${cocoon.rcl.properties}"
+     */
+    private File rclPropertiesFile = new File("./rcl.properties");    
+
+    /**
+     * Use socket appender
+     * 
+     * @parameter expression="${cocoon.rcl.log4j.useSocketAppender}"
+     */
+    private boolean useSocketAppender = false;
+
+    /**
+     * Use console appender
+     * 
+     * @parameter expression="${cocoon.rcl.log4j.useConsoleAppender}"
+     */
+    private boolean useConsoleAppender = false;
+
+    /**
+     * Use a custom log4j xml configuration file.
+     * 
+     * @parameter expression="${cocoon.rcl.log4j.conf}"
+     */
+    private String customLog4jXconf;
+    
+    /**
+     * Artifact factory, needed to download source jars for inclusion in classpath.
+     *
+     * @component role="org.apache.maven.artifact.factory.ArtifactFactory"
+     * @required
+     * @readonly
+     */
+    private ArtifactFactory artifactFactory;     
+    
+    /**
+     * Artifact resolver, needed to download source jars for inclusion in classpath.
+     *
+     * @component role="org.apache.maven.artifact.resolver.ArtifactResolver"
+     * @required
+     * @readonly
+     */
+    private ArtifactResolver artifactResolver;     
+    
+    /**
+     * Remote repositories which will be searched for blocks.
+     *
+     * @parameter expression="${project.remoteArtifactRepositories}"
+     * @required
+     * @readonly
+     */
+    private List remoteArtifactRepositories;  
+    
+    /**
+     * Local maven repository.
+     *
+     * @parameter expression="${localRepository}"
+     * @required
+     * @readonly
+     */
+    private ArtifactRepository localRepository;   
+    
+    /**
+     * Artifact resolver, needed to download source jars for inclusion in classpath.
+     *
+     * @component role="org.apache.maven.artifact.metadata.ArtifactMetadataSource"
+     * @required
+     * @readonly
+     */
+    private MavenMetadataSource metadataSource;    
+    
+    /**
+     * The project whose project files to create.
+     * 
+     * @parameter expression="${project}"
+     * @required
+     */
+    private MavenProject project;    
+
+    public void execute() throws MojoExecutionException {
+        getLog().info("Creating a reloading Cocoon web application.");
+        
+        // create web application containing all necessary files (web.xml, applicationContext.xml, log4j.xconf)
+        File webAppBaseDir = new File(target, "webapp");
+        writeInputStreamToFile(readResourceFromClassloader(WEB_INF_WEB_XML), createPath(new File(webAppBaseDir, WEB_INF_WEB_XML)));
+        writeInputStreamToFile(readResourceFromClassloader(WEB_INF_APP_CONTEXT), createPath(new File(webAppBaseDir, WEB_INF_APP_CONTEXT)));
+        writeLog4jXml(webAppBaseDir);        
+
+        // copy rcl webapp wrapper and all its dependencies to WEB-INF/lib
+        copyRclWrapperLibs(webAppBaseDir);
+        
+        // read the properties
+        RwmProperties props = readProperties();
+        
+        // create a file that contains the URLs of all libraries (config for the UrlClassLoader)
+        createUrlClassLoaderConf(webAppBaseDir, props);   
+        
+        // create a file that contains the URLs of all classes directories (config for the ReloadingClassLoader)
+        createReloadingClassLoaderconf(webAppBaseDir, props);
+        
+        // based on the RCL configuration file, create a Spring properties file
+        createSpringProperties(webAppBaseDir, props);
+
+    }
+
+    protected RwmProperties readProperties() throws MojoExecutionException {
+        RwmProperties props = null;
+        try {
+            props  = new RwmProperties(this.rclPropertiesFile);
+        } catch (IOException e) {
+            throw new MojoExecutionException("Can't read " + this.rclPropertiesFile.getAbsolutePath(), e);
+        }
+        return props;
+    }
+
+    protected void createReloadingClassLoaderconf(File webAppBaseDir, RwmProperties props) throws MojoExecutionException {
+        File urlClConfFile = createPath(new File(webAppBaseDir, WEB_INF_RCLWRAPPER_RCL_CONF));
+        try {
+            FileWriter fw = new FileWriter(urlClConfFile);
+            for(Iterator aIt = props.getClassesDirs().iterator(); aIt.hasNext();) {
+                String dir = (String) aIt.next();
+                fw.write(dir + "\n");            
+                this.getLog().debug("Adding classes-dir to RCLClassLoader configuration: " + dir);
+            }
+            fw.close();
+        } catch(IOException e) {
+            throw new MojoExecutionException("Error while writing to " + urlClConfFile);
+        }
+    }
+
+    protected void createUrlClassLoaderConf(File webAppBaseDir, RwmProperties props) throws MojoExecutionException {
+        File urlClConfFile = createPath(new File(webAppBaseDir, WEB_INF_RCL_URLCL_CONF));
+        try {
+            FileWriter fw = new FileWriter(urlClConfFile);
+            for(Iterator aIt = props.getClassesDirs().iterator(); aIt.hasNext();) {
+                String dir = (String) aIt.next();
+                fw.write(new File(dir).toURL().toExternalForm() + "\n");  
+                this.getLog().debug("Adding classes-dir to URLClassLoader configuration: " + dir);
+            }
+            for(Iterator aIt = this.project.getArtifacts().iterator(); aIt.hasNext();) {
+                Artifact a = (Artifact) aIt.next();
+                try {
+                    fw.write(a.getFile().toURL().toExternalForm() + "\n");
+                } catch (MalformedURLException e) {
+                    throw new MojoExecutionException("Error while creating URL for artifact " + a.getArtifactId());
+                }                
+                this.getLog().debug("Adding dependency to URLClassLoader configuration: " + a.getArtifactId());
+            }
+            fw.close();
+        } catch(IOException e) {
+            throw new MojoExecutionException("Error while writing to " + urlClConfFile, e);
+        }
+    }
+
+    protected void createSpringProperties(File webAppBaseDir, RwmProperties props) throws MojoExecutionException {
+        File springPropFile = createPath(new File(webAppBaseDir, WEB_INF_COCOON_SPRING_PROPS));
+        try {
+            FileOutputStream springPropsOs = new FileOutputStream(springPropFile);
+            props.getSpringProperties().store(springPropsOs, "Spring properties as read from " + this.rclPropertiesFile.toURL());
+            springPropsOs.close();
+        } catch (IOException e) {
+            throw new MojoExecutionException("Can't write to  " + springPropFile.getAbsolutePath(), e);
+        }
+    }
+
+    protected void copyRclWrapperLibs(File webAppBaseDir) throws MojoExecutionException {
+        Set rclWebappDependencies = getDependencies("org.apache.cocoon",  "cocoon-rcl-webapp-wrapper", "1.0.0-M1-SNAPSHOT", "jar");        
+        for (Iterator rclIt = rclWebappDependencies.iterator(); rclIt.hasNext();) {
+            Artifact artifact = (Artifact) rclIt.next();
+            try {
+                FileUtils.copyFileToDirectory(artifact.getFile(), createPath(new File(webAppBaseDir, WEB_INF_LIB)));
+            } catch (IOException e) {
+                throw new MojoExecutionException("Can't copy artifact " + artifact);
+            }
+            getLog().info("Adding lib to " + WEB_INF_LIB + ": " + artifact.getGroupId() + ":" + artifact.getArtifactId() + ":"
+                    + artifact.getVersion() + ":" + artifact.getType());
+        }
+    }
+
+    protected void writeLog4jXml(File webAppBaseDir) throws MojoExecutionException {
+        Map log4jTemplateMap = new HashMap();
+        log4jTemplateMap.put("useConsoleAppender", new Boolean(this.useConsoleAppender));
+        log4jTemplateMap.put("useSocketAppender", new Boolean(this.useSocketAppender));
+        writeStringTemplateToFile(webAppBaseDir, WEB_INF_LOG4J, customLog4jXconf, log4jTemplateMap);
+    }
+
+    protected Set getDependencies(final String groupId, final String artifactId, final String version,
+            final String packaging) throws MojoExecutionException {
+        Set returnSet = new HashSet();
+        try {
+            Set artifacts = null;
+            ArtifactResolutionResult result = null;
+            
+            Dependency dependency = new Dependency();
+            dependency.setGroupId(groupId);
+            dependency.setArtifactId(artifactId);
+            dependency.setVersion(version);
+            
+            List dependencies = new ArrayList();
+            dependencies.add(dependency);
+            Artifact pomArtifact = artifactFactory.createBuildArtifact("unspecified", "unspecified", "0.0", "jar");
+            Map managedDependencies = Collections.EMPTY_MAP;
+            artifacts = MavenMetadataSource.createArtifacts(artifactFactory, dependencies, "compile", null, null);
+            result = artifactResolver.resolveTransitively(artifacts, pomArtifact, managedDependencies, localRepository,
+                    remoteArtifactRepositories, metadataSource);
+            
+            for (Iterator i = artifacts.iterator(); i.hasNext();) {
+                Artifact artifact = (Artifact) i.next();
+                returnSet.add(artifact);
+            }
+            for (Iterator i = result.getArtifacts().iterator(); i.hasNext();) {
+                Artifact artifact = (Artifact) i.next();
+                returnSet.add(artifact);
+            }
+        } catch (ArtifactResolutionException e) {
+            throw new MojoExecutionException("Can't resolve artifact " + groupId + ":" + artifactId + ":" + version, e);
+        } catch (ArtifactNotFoundException e) {
+            throw new MojoExecutionException("Can't find artifact " + groupId + ":" + artifactId + ":" + version, e);
+        } catch (InvalidDependencyVersionException e) {
+            throw new MojoExecutionException("Invalid version of artifact " + groupId + ":" + artifactId + ":"
+                    + version, e);
+        }
+        return returnSet;
+    }
+    
+    protected void writeStringTemplateToFile(final File basedir, final String fileName, final String customFile,
+            final Map templateObjects) throws MojoExecutionException {
+        OutputStream fos = null;
+        try {
+            File outFile = createPath(new File(basedir, fileName));
+            fos = new BufferedOutputStream(new FileOutputStream(outFile));
+            InputStream fileIs = null;
+            if (customFile != null) {
+                if (new File(customFile).exists()) {
+                    fileIs = new BufferedInputStream(new FileInputStream(customFile));
+                } else {
+                    this.getLog().info(
+                            "supplied custom file " + customFile + " doesn't exist. Fallback to default: " + fileName);
+                    fileIs = readResourceFromClassloader(fileName);
+                }
+            } else {
+                fileIs = readResourceFromClassloader(fileName);
+            }
+            StringTemplate stringTemplate = new StringTemplate(IOUtils.toString(fileIs));
+            for (Iterator templateObjectsIt = templateObjects.keySet().iterator(); templateObjectsIt.hasNext();) {
+                Object key = templateObjectsIt.next();
+                stringTemplate.setAttribute((String) key, templateObjects.get(key));
+            }
+            this.getLog().info("Deploying string-template to " + fileName);
+            IOUtils.write(stringTemplate.toString(), fos);
+        } catch (FileNotFoundException e) {
+            throw new MojoExecutionException((customFile == null ? fileName : customFile) + " not found.", e);
+        } catch (IOException e) {
+            throw new MojoExecutionException("Error while reading or writing.", e);
+        } finally {
+            try {
+                fos.close();
+            } catch (IOException e) {
+                throw new MojoExecutionException("Error while closing the output stream.", e);
+            }
+        }
+    }
+
+    protected InputStream readResourceFromClassloader(String fileName) {
+        String resource = ReloadingWebappMojo.class.getPackage().getName().replace('.', '/') + "/" + fileName;
+        System.out.println("Reading resource from classpath: " + resource);
+        return ReloadingWebappMojo.class.getClassLoader().getResourceAsStream(resource);
+    }
+
+    protected static File createPath(File file) {
+        if (file.getParentFile() != null && !file.getParentFile().exists()) {
+            file.getParentFile().mkdirs();
+        }
+        return file;
+    }
+    
+    protected void writeInputStreamToFile(final InputStream is, final File f) throws MojoExecutionException {
+        Validate.notNull(is);
+        Validate.notNull(f);        
+        try {
+            FileWriter fw = new FileWriter(f);
+            IOUtils.copy(is, fw);
+            fw.close();
+        } catch (IOException e) {
+            throw new MojoExecutionException("Can't write to file " + f);
+        }    
+    }
+    
+}

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/ReloadingWebappMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/ReloadingWebappMojo.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/ReloadingWebappMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/RwmProperties.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/RwmProperties.java?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/RwmProperties.java (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/RwmProperties.java Tue Dec  5 06:03:18 2006
@@ -0,0 +1,81 @@
+/*
+ * 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.cocoon.maven.rcl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+public class RwmProperties {
+
+    private static final String COB_INF_DIR = "/COB-INF";
+    private static final String BLOCK_CONTEXT_URL_PARAM = "/blockContextURL";
+    private static final String ARTIFACT = "%artifact";
+    private static final String CLASSES_DIR = "%classes-dir";    
+    
+    private Properties rclProps = new Properties();
+
+    public RwmProperties(InputStream propsIs) throws IOException {
+        this.rclProps.load(propsIs);
+    }
+    
+    public RwmProperties(File propsFile) throws IOException {
+        this(new FileInputStream(propsFile));
+    }
+
+    public Set getArtifacts() {
+        return getFilteredPropertiesValuesAsSet(ARTIFACT);
+    }
+    
+    public Set getClassesDirs() {
+        return getFilteredPropertiesValuesAsSet(CLASSES_DIR);
+    }
+    
+    public Properties getSpringProperties() {
+        Properties springProps = new Properties();
+        for(Enumeration rclEnum = rclProps.keys(); rclEnum.hasMoreElements();) {
+            String key = (String) rclEnum.nextElement();
+            if(!key.endsWith(ARTIFACT) && !key.endsWith(CLASSES_DIR)) {
+                springProps.put(key, this.rclProps.getProperty(key));
+            }
+            if(key.endsWith(CLASSES_DIR)) {
+                String newKey = key.substring(0, key.length() - CLASSES_DIR.length()) + BLOCK_CONTEXT_URL_PARAM;
+                springProps.put(newKey, this.rclProps.getProperty(key) + COB_INF_DIR);
+            }
+        } 
+        return springProps;
+    }    
+    
+    private Set getFilteredPropertiesValuesAsSet(String filter) {
+        Set returnSet = new HashSet();
+        for(Enumeration rclEnum = rclProps.keys(); rclEnum.hasMoreElements();) {
+            String key = (String) rclEnum.nextElement();
+            if(key.endsWith(filter)) {
+                returnSet.add(this.rclProps.getProperty(key));
+            }
+        }        
+        return returnSet;
+    }
+    
+}
+
+    

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/RwmProperties.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/RwmProperties.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/java/org/apache/cocoon/maven/rcl/RwmProperties.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/applicationContext.xml?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/applicationContext.xml (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/applicationContext.xml Tue Dec  5 06:03:18 2006
@@ -0,0 +1,41 @@
+<?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.
+-->
+<!-- @version $Id$ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:cocoon="http://cocoon.apache.org/core"
+       xmlns:avalon="http://cocoon.apache.org/avalon"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
+                           http://cocoon.apache.org/core http://cocoon.apache.org/core.xsd
+                           http://cocoon.apache.org/avalon http://cocoon.apache.org/avalon.xsd">
+
+  <!-- Load all the properties for Cocoon -->
+  <cocoon:settings/>
+
+  <!-- Load Avalon configurations
+       If you want to use a different logger than the default log4j logger,
+       add a bean conforming to the Avalon Logger interface to this definition
+       and leave out the loggingConfiguration attribute.
+       If you have an own cocoon.xconf specify the location attribute,
+       like location="/WEB-INF/cocoon/cocoon.xconf".
+   -->
+  <avalon:avalon loggingConfiguration="/WEB-INF/log4j.xml"/>
+
+</beans>

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/applicationContext.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/applicationContext.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/applicationContext.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/log4j.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/log4j.xml?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/log4j.xml (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/log4j.xml Tue Dec  5 06:03:18 2006
@@ -0,0 +1,48 @@
+<?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.
+-->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+    <!-- This is a sample configuration for log4j.
+         It simply just logs everything into a single
+         log file.
+         Note, that you can use properties for value substitution.
+    -->
+    <appender name="COCOON_DEFAULT" class="org.apache.log4j.FileAppender">
+        <param name="File"   value="\${log-dir}/log4j.log" />
+        <param name="Append" value="false" />       
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
+        </layout>     
+    </appender>
+
+    $if(useConsoleAppender)$
+    <appender name="COCOON_DEFAULT_CONSOLE" class="org.apache.log4j.ConsoleAppender">
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
+        </layout>     
+    </appender>
+    $endif$
+
+    <root>
+      <priority value="\${org.apache.cocoon.log4j.loglevel}"/>
+      <appender-ref ref="COCOON_DEFAULT" />
+    $if(useConsoleAppender)$
+      <appender-ref ref="COCOON_DEFAULT_CONSOLE" />
+    $endif$
+    </root>
+</log4j:configuration>

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/log4j.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/log4j.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/log4j.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/web.xml?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/web.xml (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/web.xml Tue Dec  5 06:03:18 2006
@@ -0,0 +1,123 @@
+<?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.
+-->
+<!--+
+    | This is the Cocoon web-app configurations file
+    +--><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+    <web-app>
+      <context-param>
+        <param-name>org.apache.cocoon.servlet.ReloadingListener</param-name>
+        <param-value>org.springframework.web.context.ContextLoaderListener</param-value>
+      </context-param>
+      <filter>
+        <filter-name>ReloadingSpringFilter</filter-name>
+        <display-name>ReloadingSpringFilter</display-name>
+        <description>Reloads the Spring application context if a classloader change was detected.</description>
+        <filter-class>org.apache.cocoon.servlet.ReloadingServletFilter</filter-class>
+        <init-param>
+          <param-name>filter-class</param-name>
+          <param-value>org.apache.cocoon.servlet.ReloadingSpringFilter</param-value>
+        </init-param>
+      </filter>   
+      <filter>
+        <filter-name>CocoonMultipartFilter</filter-name>
+        <display-name>Cocoon multipart filter</display-name>
+        <description>Multipart MIME handling filter for Cocoon</description>
+        <filter-class>org.apache.cocoon.servlet.ReloadingServletFilter</filter-class>
+        <init-param>
+          <param-name>filter-class</param-name>
+          <param-value>org.apache.cocoon.servlet.multipart.MultipartFilter</param-value>
+        </init-param>
+      </filter>
+      <filter>
+        <filter-name>CocoonDebugFilter</filter-name>
+        <display-name>Cocoon debug filter</display-name>
+        <description>Log debug information about each request</description>
+        <filter-class>org.apache.cocoon.servlet.ReloadingServletFilter</filter-class>
+        <init-param>
+          <param-name>filter-class</param-name>
+          <param-value>org.apache.cocoon.servlet.DebugFilter</param-value>
+        </init-param>
+      </filter>   
+      <!--filter-mapping>
+        <filter-name>ReloadingSpringFilter</filter-name>
+        <servlet-name>Cocoon</servlet-name>
+      </filter-mapping-->  
+      <filter-mapping>
+        <filter-name>CocoonMultipartFilter</filter-name>
+        <servlet-name>Cocoon</servlet-name>
+      </filter-mapping>
+      <listener>
+        <listener-class>org.apache.cocoon.servlet.ReloadingListener</listener-class>
+      </listener>
+      <servlet>
+        <servlet-name>DispatcherServlet</servlet-name>
+        <display-name>DispatcherServlet</display-name>
+        <description>Cocoon blocks dispatcher</description>
+        <servlet-class>org.apache.cocoon.servlet.ReloadingServlet</servlet-class>
+        <init-param>
+          <param-name>servlet-class</param-name>
+          <param-value>org.apache.cocoon.blocks.DispatcherServlet</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+      </servlet>
+      <servlet-mapping>
+        <servlet-name>DispatcherServlet</servlet-name>
+        <url-pattern>/*</url-pattern>
+      </servlet-mapping>
+      <servlet-mapping>
+        <servlet-name>DispatcherServlet</servlet-name>
+        <url-pattern>*.jsp</url-pattern>
+      </servlet-mapping>
+      <servlet-mapping>
+        <servlet-name>DispatcherServlet</servlet-name>
+        <url-pattern>*.html</url-pattern>
+      </servlet-mapping>
+      <servlet-mapping>
+        <servlet-name>DispatcherServlet</servlet-name>
+        <url-pattern>/*</url-pattern>
+      </servlet-mapping>
+      <!-- various MIME type mappings ====================================== -->
+      <mime-mapping>
+        <extension>css</extension>
+        <mime-type>text/css</mime-type>
+      </mime-mapping>
+      <mime-mapping>
+        <extension>xml</extension>
+        <mime-type>text/xml</mime-type>
+      </mime-mapping>
+      <mime-mapping>
+        <extension>xsl</extension>
+        <mime-type>text/xml</mime-type>
+      </mime-mapping>
+      <mime-mapping>
+        <extension>xconf</extension>
+        <mime-type>text/xml</mime-type>
+      </mime-mapping>
+      <mime-mapping>
+        <extension>xmap</extension>
+        <mime-type>text/xml</mime-type>
+      </mime-mapping>
+      <mime-mapping>
+        <extension>ent</extension>
+        <mime-type>text/plain</mime-type>
+      </mime-mapping>
+      <mime-mapping>
+        <extension>grm</extension>
+        <mime-type>text/plain</mime-type>
+      </mime-mapping>
+    </web-app>    

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/main/resources/org/apache/cocoon/maven/rcl/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/apache/cocoon/maven/rcl/RwmPropertiesTest.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/apache/cocoon/maven/rcl/RwmPropertiesTest.java?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/apache/cocoon/maven/rcl/RwmPropertiesTest.java (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/apache/cocoon/maven/rcl/RwmPropertiesTest.java Tue Dec  5 06:03:18 2006
@@ -0,0 +1,61 @@
+/*
+ * 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.cocoon.maven.rcl;
+
+import java.io.InputStream;
+import java.util.Properties;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+public class RwmPropertiesTest extends TestCase {
+
+    public void testLoadingSpringProps() throws Exception {
+        RwmProperties p = createTestProperties();
+        Properties springProps = p.getSpringProperties();
+        assertEquals(5, springProps.size());
+        assertTrue(springProps.containsKey("org.apache.cocoon.cocoon-rcl-plugin-demo.block/blockContextURL"));
+        assertEquals("file:/F:/blocks/myBlock1/target/classes/COB-INF", 
+            springProps.getProperty("org.apache.cocoon.cocoon-rcl-plugin-demo.block1/blockContextURL"));
+    }
+    
+    public void testLoadingArtifactValues() throws Exception {
+        RwmProperties p = createTestProperties();
+        Set as = p.getArtifacts();
+        assertEquals(2, as.size());
+        assertTrue(as.contains("org.apache.cocoon:cocoon-myBlock"));
+        assertTrue(as.contains("org.apache.cocoon:cocoon-myBlock1"));    
+    }   
+
+    public void testLoadingBasedirs() throws Exception {
+        RwmProperties p = createTestProperties();
+        Set as = p.getClassesDirs();
+        assertEquals(3, as.size());
+        assertTrue(as.contains("file:/F:/blocks/myBlock/target/classes"));
+        assertTrue(as.contains("file:/F:/blocks/myBlock1/target/classes"));        
+    }      
+    
+    protected RwmProperties createTestProperties() throws Exception {    
+        return new RwmProperties(readResourceFromClassloader("rcl.properties"));
+    }
+    
+    protected InputStream readResourceFromClassloader(String fileName) {
+        String resource = RwmPropertiesTest.class.getPackage().getName().replace('.', '/') + "/" + fileName;
+        return ReloadingWebappMojo.class.getClassLoader().getResourceAsStream(resource);
+    }    
+    
+}

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/apache/cocoon/maven/rcl/RwmPropertiesTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/apache/cocoon/maven/rcl/RwmPropertiesTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/java/org/apache/cocoon/maven/rcl/RwmPropertiesTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/apache/cocoon/maven/rcl/rcl.properties
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/apache/cocoon/maven/rcl/rcl.properties?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/apache/cocoon/maven/rcl/rcl.properties (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/apache/cocoon/maven/rcl/rcl.properties Tue Dec  5 06:03:18 2006
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+org.apache.cocoon.cocoon-rcl-plugin-demo.block/123=456
+org.apache.cocoon.cocoon-rcl-plugin-demo.block%artifact=org.apache.cocoon:cocoon-myBlock
+org.apache.cocoon.cocoon-rcl-plugin-demo.block%classes-dir=file:/F:/blocks/myBlock/target/classes
+org.apache.cocoon.cocoon-rcl-plugin-demo.block/xyz=abc
+org.apache.cocoon.cocoon-rcl-plugin-demo.block1%artifact=org.apache.cocoon:cocoon-myBlock1
+org.apache.cocoon.cocoon-rcl-plugin-demo.block1%classes-dir=file:/F:/blocks/myBlock1/target/classes
+org.apache.cocoon.cocoon-rcl-plugin-demo.block2%classes-dir=file:/F:/blocks/myBlock2/target/classes

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/apache/cocoon/maven/rcl/rcl.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/apache/cocoon/maven/rcl/rcl.properties
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-plugin/src/test/resources/org/apache/cocoon/maven/rcl/rcl.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/pom.xml?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/pom.xml (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/pom.xml Tue Dec  5 06:03:18 2006
@@ -0,0 +1,106 @@
+<?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.
+-->
+<!--+
+    | @version $Id$
+    |
+    +-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>jar</packaging>
+  <parent>
+    <groupId>org.apache.cocoon</groupId>
+    <artifactId>cocoon-rcl-modules</artifactId>
+    <version>1-SNAPSHOT</version>
+  </parent>
+  <artifactId>cocoon-rcl-webapp-wrapper</artifactId>
+  <version>1.0.0-M1-SNAPSHOT</version>
+  <name>Cocoon Reloading ClassLoader - webapp wrapper</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.commons</groupId> 
+      <artifactId>commons-jci-core</artifactId> 
+      <version>1.0-SNAPSHOT</version> 
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.4</version>
+      <exclusions>
+        <exclusion>
+          <artifactId>logkit</artifactId>
+          <groupId>logkit</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>avalon-framework</artifactId>
+          <groupId>avalon-framework</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>    
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.4</version>
+      <scope>provided</scope>
+    </dependency>    
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-core</artifactId>
+      <version>2.0.1</version>
+      <scope>provided</scope>
+    </dependency>   
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <version>2.0.1</version>
+      <scope>provided</scope>
+    </dependency>    
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+      <version>2.0.1</version>
+      <scope>provided</scope>
+    </dependency>   
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-aop</artifactId>
+      <version>2.0.1</version>
+      <scope>provided</scope>
+    </dependency>      
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-web</artifactId>
+      <version>2.0.1</version>
+      <scope>provided</scope>
+    </dependency>             
+    <!--  test dependencies  -->
+    <dependency>
+      <groupId>xmlunit</groupId>
+      <artifactId>xmlunit</artifactId>
+      <version>0.8</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.2</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/CocoonReloadingListener.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/CocoonReloadingListener.java?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/CocoonReloadingListener.java (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/CocoonReloadingListener.java Tue Dec  5 06:03:18 2006
@@ -0,0 +1,67 @@
+/*
+ * 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.cocoon.servlet;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.jci.listeners.ReloadingListener;
+
+public class CocoonReloadingListener extends ReloadingListener {
+
+    private static boolean reload = false;
+    private static List subscribers = new ArrayList();
+    
+    public CocoonReloadingListener(File file) {
+        super(file);
+    }
+
+    public void onChangeFile(File changedFile) {
+        System.out.println("A file changed: "
+                + changedFile.getAbsolutePath());
+        super.onChangeFile(changedFile);
+        notifySubscribers();
+        reload = true;
+    }
+
+    public void onChangeDirectory(File changedDirectory) {
+        super.onChangeDirectory(changedDirectory);
+        notifySubscribers();        
+    }    
+    
+    public static synchronized boolean isReload() {
+        if(reload == true) {
+            reload = false;
+            return true;
+        }
+        return reload;
+    }
+    
+    private void notifySubscribers() {
+        for(Iterator nIt = subscribers.iterator(); nIt.hasNext(); ) {
+            ((ReloadingNotificationSubscriber) nIt.next()).handleNotification();
+        }
+    }
+    
+    public static void subscribe(ReloadingNotificationSubscriber subscriber) {
+        System.out.println("----------> Subscription by: " + subscriber);
+        subscribers.add(subscriber);
+    }
+    
+}

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/CocoonReloadingListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/CocoonReloadingListener.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/CocoonReloadingListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/JarListener.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/JarListener.java?view=auto&rev=482656
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/JarListener.java (added)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/JarListener.java Tue Dec  5 06:03:18 2006
@@ -0,0 +1,63 @@
+/*
+ * 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.cocoon.servlet;
+
+import java.io.File;
+
+import org.apache.commons.jci.stores.ResourceStore;
+import org.apache.commons.jci.stores.Transactional;
+
+class JarListener extends org.apache.commons.jci.listeners.ReloadingListener {
+
+    private final ResourceStore store;
+
+    public JarListener(File file, ResourceStore store) {
+        super(file, store);
+        this.store = store;
+    }
+
+    public void onStop() {
+        boolean reload = false;
+
+        if (store instanceof Transactional) {
+            ((Transactional) store).onStart();
+        }
+
+        if (deleted.size() > 0) {
+            reload = true;
+        }
+
+        if (created.size() > 0) {
+            // FIXME: not necessary
+            // reload = true;
+        }
+
+        if (changed.size() > 0) {
+            reload = true;
+        }
+
+        if (store instanceof Transactional) {
+            ((Transactional) store).onStop();
+        }
+
+        // TODO: either clear the whole store or iterate the jar and remove
+        // resource that are in there
+
+        checked(reload);
+
+    }
+}

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/JarListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/JarListener.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/servlet/JarListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message