cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r470172 - in /cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main: java/org/apache/cocoon/core/container/reloading/ resources/COB-INF/reloading/
Date Thu, 02 Nov 2006 01:31:26 GMT
Author: simoneg
Date: Wed Nov  1 17:31:23 2006
New Revision: 470172

URL: http://svn.apache.org/viewvc?view=rev&rev=470172
Log:
Adding missing files from COCOON-1929

Added:
    cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/java/org/apache/cocoon/core/container/reloading/
    cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/java/org/apache/cocoon/core/container/reloading/MyGenerator.java
    cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/reloading/
    cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/reloading/sitemap.xmap

Added: cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/java/org/apache/cocoon/core/container/reloading/MyGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/java/org/apache/cocoon/core/container/reloading/MyGenerator.java?view=auto&rev=470172
==============================================================================
--- cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/java/org/apache/cocoon/core/container/reloading/MyGenerator.java
(added)
+++ cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/java/org/apache/cocoon/core/container/reloading/MyGenerator.java
Wed Nov  1 17:31:23 2006
@@ -0,0 +1,44 @@
+/*
+ * 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.core.container.reloading;
+
+
+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 = "cc generator".toCharArray();
+        contentHandler.characters(message, 0, message.length);
+        
+        contentHandler.endElement("","body","body");
+        contentHandler.endElement("","page","page");
+        contentHandler.endDocument();
+    }
+    
+}

Added: cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/reloading/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/reloading/sitemap.xmap?view=auto&rev=470172
==============================================================================
--- cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/reloading/sitemap.xmap
(added)
+++ cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/reloading/sitemap.xmap
Wed Nov  1 17:31:23 2006
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!--
+  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" check-reload="yes">
+
+ <map:components>
+  <map:classloader factory-role="org.apache.cocoon.classloader.ClassLoaderFactory/reloading">
 
+    <class-dir src="../../../../../../../blocks/cocoon-core-sample/cocoon-core-main-sample/target/classes">
+      <store class="org.apache.commons.jci.stores.MemoryResourceStore"/>
+    </class-dir>
+    <!-- Implicit exclude-all, except those included -->
+    <include-classes pattern="org.apache.cocoon.core.container.reloading.**"/>
+  </map:classloader>
+  <map:generators default="file">
+   <map:generator name="mygenerator" src="org.apache.cocoon.core.container.reloading.MyGenerator"/>
+  </map:generators>  
+ </map:components>
+
+  <map:pipelines>
+    <map:pipeline>
+      <map:match pattern="">
+        <map:generate type="mygenerator"/>
+        <map:serialize type="html"/>
+      </map:match>
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>



Mime
View raw message