You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by re...@apache.org on 2006/12/07 14:37:35 UTC
svn commit: r483453 - in /cocoon/trunk/core/cocoon-core: ./
src/main/java/org/apache/cocoon/classloader/reloading/
src/main/java/org/apache/cocoon/components/fam/
src/main/java/org/apache/cocoon/components/treeprocessor/
src/main/java/org/apache/cocoon...
Author: reinhard
Date: Thu Dec 7 05:37:33 2006
New Revision: 483453
URL: http://svn.apache.org/viewvc?view=rev&rev=483453
Log:
comment out reloading classloader implementation as we cannot release if we depend on snapshot artifacts
Modified:
cocoon/trunk/core/cocoon-core/pom.xml
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/Monitor.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/NotifyingResourceStore.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoader.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoaderConfiguration.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoaderFactory.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/MonitorImpl.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java
Modified: cocoon/trunk/core/cocoon-core/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/pom.xml?view=diff&rev=483453&r1=483452&r2=483453
==============================================================================
--- cocoon/trunk/core/cocoon-core/pom.xml (original)
+++ cocoon/trunk/core/cocoon-core/pom.xml Thu Dec 7 05:37:33 2006
@@ -205,11 +205,11 @@
<artifactId>commons-collections</artifactId>
<version>3.2</version>
</dependency>
- <dependency>
+ <!--dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-jci-core</artifactId>
<version>1.0-SNAPSHOT</version>
- </dependency>
+ </dependency-->
<dependency>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/Monitor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/Monitor.java?view=diff&rev=483453&r1=483452&r2=483453
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/Monitor.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/Monitor.java Thu Dec 7 05:37:33 2006
@@ -16,8 +16,9 @@
*/
package org.apache.cocoon.classloader.reloading;
-import org.apache.commons.jci.listeners.NotificationListener;
-import org.apache.commons.jci.monitor.FilesystemAlterationListener;
+// TODO rcl
+//import org.apache.commons.jci.listeners.NotificationListener;
+//import org.apache.commons.jci.monitor.FilesystemAlterationListener;
/**
*
@@ -27,8 +28,9 @@
String ROLE = Monitor.class.getName();
- void subscribe(final FilesystemAlterationListener listener);
- void unsubscribe(final FilesystemAlterationListener listener);
- void setSitemapNotifier(NotificationListener sitemapNotifier);
+// TODO rcl
+// void subscribe(final FilesystemAlterationListener listener);
+// void unsubscribe(final FilesystemAlterationListener listener);
+// void setSitemapNotifier(NotificationListener sitemapNotifier);
}
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/NotifyingResourceStore.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/NotifyingResourceStore.java?view=diff&rev=483453&r1=483452&r2=483453
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/NotifyingResourceStore.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/NotifyingResourceStore.java Thu Dec 7 05:37:33 2006
@@ -16,8 +16,9 @@
*/
package org.apache.cocoon.classloader.reloading;
-import org.apache.commons.jci.listeners.NotificationListener;
-import org.apache.commons.jci.stores.ResourceStore;
+// TODO rcl
+//import org.apache.commons.jci.listeners.NotificationListener;
+//import org.apache.commons.jci.stores.ResourceStore;
/**
* Wraps all the stores configured into the sitemap classloaders, in order to dispatch
@@ -26,22 +27,23 @@
*
* @version $Id$
*/
-public class NotifyingResourceStore implements ResourceStore {
+public class NotifyingResourceStore { // TODO rcl implements ResourceStore {
- private NotificationListener listener;
-
- public NotifyingResourceStore(NotificationListener l) {
- this.listener = l;
- }
-
- public byte[] read(String pResourceName) {
- return null;
- }
-
- public void remove(String pResourceName) {
- }
-
- public void write(String pResourceName, byte[] pResourceData) {
- this.listener.handleNotification();
- }
+// TODO rcl
+// private NotificationListener listener;
+//
+// public NotifyingResourceStore(NotificationListener l) {
+// this.listener = l;
+// }
+//
+// public byte[] read(String pResourceName) {
+// return null;
+// }
+//
+// public void remove(String pResourceName) {
+// }
+//
+// public void write(String pResourceName, byte[] pResourceData) {
+// this.listener.handleNotification();
+// }
}
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoader.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoader.java?view=diff&rev=483453&r1=483452&r2=483453
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoader.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoader.java Thu Dec 7 05:37:33 2006
@@ -16,67 +16,67 @@
*/
package org.apache.cocoon.classloader.reloading;
-import java.net.URL;
-import java.net.URLStreamHandlerFactory;
-import java.util.List;
-
-import org.apache.cocoon.classloader.DefaultClassLoader;
-import org.apache.commons.jci.stores.ResourceStore;
+//TODO rcl
+//import java.net.URL;
+//import java.net.URLStreamHandlerFactory;
+//import java.util.List;
+//import org.apache.cocoon.classloader.DefaultClassLoader;
+// import org.apache.commons.jci.stores.ResourceStore;
/**
* @version $Id$
* @since 2.2
*/
-public class ReloadingClassLoader extends DefaultClassLoader {
-
- private ResourceStore[] stores = new ResourceStore[0];
-
- /**
- * Alternate constructor to define a parent and initial <code>URL</code>
- * s.
- */
- public ReloadingClassLoader(URL[] urls, List includePatterns, List excludePatterns, final ClassLoader parent) {
- this(urls, includePatterns, excludePatterns, parent, null);
- }
-
- /**
- * Alternate constructor to define a parent, initial <code>URL</code>s,
- * and a default <code>URLStreamHandlerFactory</code>.
- */
- public ReloadingClassLoader(final URL[] urls, List includePatterns, List excludePatterns, ClassLoader parent, URLStreamHandlerFactory factory) {
- super(urls, includePatterns, excludePatterns, parent, factory);
- }
-
- public void addResourceStore(final ResourceStore pStore) {
- final int n = this.stores.length;
- final ResourceStore[] newStores = new ResourceStore[n + 1];
- System.arraycopy(this.stores, 0, newStores, 0, n);
- newStores[n] = pStore;
- this.stores = newStores;
- }
-
- private Class fastFindClass(final String name) {
-
- if (stores != null) {
- for (int i = 0; i < stores.length; i++) {
- final ResourceStore store = stores[i];
- final byte[] clazzBytes = store.read(name);
- if (clazzBytes != null) {
- return defineClass(name, clazzBytes, 0, clazzBytes.length);
- }
- }
- }
-
- return null;
- }
-
- protected Class getClass(String name) throws ClassNotFoundException {
- Class clazz = fastFindClass(name);
-
- if (clazz == null) {
- return super.getClass(name);
- }
- return clazz;
- }
+public class ReloadingClassLoader { // TODO rcl extends DefaultClassLoader {
+//
+// private ResourceStore[] stores = new ResourceStore[0];
+//
+// /**
+// * Alternate constructor to define a parent and initial <code>URL</code>
+// * s.
+// */
+// public ReloadingClassLoader(URL[] urls, List includePatterns, List excludePatterns, final ClassLoader parent) {
+// this(urls, includePatterns, excludePatterns, parent, null);
+// }
+//
+// /**
+// * Alternate constructor to define a parent, initial <code>URL</code>s,
+// * and a default <code>URLStreamHandlerFactory</code>.
+// */
+// public ReloadingClassLoader(final URL[] urls, List includePatterns, List excludePatterns, ClassLoader parent, URLStreamHandlerFactory factory) {
+// super(urls, includePatterns, excludePatterns, parent, factory);
+// }
+//
+// public void addResourceStore(final ResourceStore pStore) {
+// final int n = this.stores.length;
+// final ResourceStore[] newStores = new ResourceStore[n + 1];
+// System.arraycopy(this.stores, 0, newStores, 0, n);
+// newStores[n] = pStore;
+// this.stores = newStores;
+// }
+//
+// private Class fastFindClass(final String name) {
+//
+// if (stores != null) {
+// for (int i = 0; i < stores.length; i++) {
+// final ResourceStore store = stores[i];
+// final byte[] clazzBytes = store.read(name);
+// if (clazzBytes != null) {
+// return defineClass(name, clazzBytes, 0, clazzBytes.length);
+// }
+// }
+// }
+//
+// return null;
+// }
+//
+// protected Class getClass(String name) throws ClassNotFoundException {
+// Class clazz = fastFindClass(name);
+//
+// if (clazz == null) {
+// return super.getClass(name);
+// }
+// return clazz;
+// }
}
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoaderConfiguration.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoaderConfiguration.java?view=diff&rev=483453&r1=483452&r2=483453
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoaderConfiguration.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoaderConfiguration.java Thu Dec 7 05:37:33 2006
@@ -16,46 +16,48 @@
*/
package org.apache.cocoon.classloader.reloading;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.cocoon.classloader.ClassLoaderConfiguration;
-import org.apache.cocoon.classloader.reloading.Monitor;
-import org.apache.commons.jci.listeners.NotificationListener;
-import org.apache.commons.jci.stores.ResourceStore;
+// TODO rcl
+//import java.util.HashMap;
+//import java.util.Map;
+//
+//import org.apache.cocoon.classloader.ClassLoaderConfiguration;
+//import org.apache.cocoon.classloader.reloading.Monitor;
+//import org.apache.commons.jci.listeners.NotificationListener;
+//import org.apache.commons.jci.stores.ResourceStore;
/**
* @version $Id$
* @since 2.2
*/
-public class ReloadingClassLoaderConfiguration extends ClassLoaderConfiguration {
-
- protected final Map storeDirectories = new HashMap();
- protected Monitor monitor;
- protected NotificationListener notificationListener;
-
- public void addStore(String dir, ResourceStore store) {
- this.storeDirectories.put(dir, store);
- }
-
- public ResourceStore getStore(String dir) {
- return (ResourceStore)this.storeDirectories.get(dir);
- }
-
- public void setMonitor(Monitor monitor) {
- this.monitor = monitor;
-
- }
-
- public Monitor getMonitor() {
- return monitor;
- }
-
- public void setNotificationListener(NotificationListener notificationListener) {
- this.notificationListener = notificationListener;
- }
+public class ReloadingClassLoaderConfiguration { // extends ClassLoaderConfiguration {
- public NotificationListener getNotificationListener() {
- return this.notificationListener;
- }
+// TODO rcl
+// protected final Map storeDirectories = new HashMap();
+// protected Monitor monitor;
+// protected NotificationListener notificationListener;
+//
+// public void addStore(String dir, ResourceStore store) {
+// this.storeDirectories.put(dir, store);
+// }
+//
+// public ResourceStore getStore(String dir) {
+// return (ResourceStore)this.storeDirectories.get(dir);
+// }
+//
+// public void setMonitor(Monitor monitor) {
+// this.monitor = monitor;
+//
+// }
+//
+// public Monitor getMonitor() {
+// return monitor;
+// }
+//
+// public void setNotificationListener(NotificationListener notificationListener) {
+// this.notificationListener = notificationListener;
+// }
+//
+// public NotificationListener getNotificationListener() {
+// return this.notificationListener;
+// }
}
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoaderFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoaderFactory.java?view=diff&rev=483453&r1=483452&r2=483453
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoaderFactory.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/classloader/reloading/ReloadingClassLoaderFactory.java Thu Dec 7 05:37:33 2006
@@ -16,86 +16,86 @@
*/
package org.apache.cocoon.classloader.reloading;
-import java.io.File;
-import java.net.URL;
-import java.util.List;
-
-import javax.servlet.ServletContext;
-
-import org.apache.cocoon.classloader.AbstractClassLoaderFactory;
-import org.apache.cocoon.classloader.ClassLoaderConfiguration;
-import org.apache.cocoon.classloader.DefaultClassLoader;
-import org.apache.commons.jci.listeners.ReloadingListener;
-import org.apache.commons.jci.stores.ResourceStore;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+//import java.io.File;
+//import java.net.URL;
+//import java.util.List;
+//
+//import javax.servlet.ServletContext;
+//
+//import org.apache.cocoon.classloader.AbstractClassLoaderFactory;
+//import org.apache.cocoon.classloader.ClassLoaderConfiguration;
+//import org.apache.cocoon.classloader.DefaultClassLoader;
+//import org.apache.commons.jci.listeners.ReloadingListener;
+//import org.apache.commons.jci.stores.ResourceStore;
+//import org.apache.commons.logging.Log;
+//import org.apache.commons.logging.LogFactory;
/**
* @see AbstractClassLoaderFactory
* @version $Id$
* @since 2.2
*/
-public class ReloadingClassLoaderFactory extends AbstractClassLoaderFactory {
-
- protected ClassLoaderConfiguration config;
- private final static Log log = LogFactory.getLog(ReloadingListener.class);
-
- /**
- * @see org.apache.cocoon.classloader.AbstractClassLoaderFactory#createClassLoader(java.lang.ClassLoader, org.apache.cocoon.classloader.ClassLoaderConfiguration, javax.servlet.ServletContext)
- */
- public ClassLoader createClassLoader(ClassLoader parent,
- ClassLoaderConfiguration configuration,
- ServletContext servletContext)
- throws Exception {
- this.config = configuration;
- return super.createClassLoader(parent, config, servletContext);
- }
-
- protected ClassLoader createClassLoader(URL[] urls,
- List includePatterns,
- List excludePatterns,
- ClassLoader parent) {
-
- org.apache.commons.jci.ReloadingClassLoader jciClassLoader = new org.apache.commons.jci.ReloadingClassLoader(
- new DefaultClassLoader(urls, includePatterns,
- excludePatterns, Thread.currentThread()
- .getContextClassLoader()));
- Monitor fam = null;
- if ( this.config instanceof ReloadingClassLoaderConfiguration ) {
- fam = ((ReloadingClassLoaderConfiguration)this.config).getMonitor();
- }
- if ( fam != null ) {
- for (int i = 0; i < urls.length; i++) {
- URL url = urls[i];
- final ResourceStore store = ((ReloadingClassLoaderConfiguration)this.config).getStore(url.getFile());
-
- final ReloadingListener listener = createReloadingListener(url,
- store, this.config);
- jciClassLoader.addListener(listener);
- fam.subscribe(listener);
- try {
- listener.waitForFirstCheck();
- } catch (Exception e) {
- log.error("Timeout error configuring JCI Listener for url "
- + url + " having store " + store);
- }
- log.debug("ReloadingClassLoaderFactory - Subscriber SitemapMonitor listener for url "
- + url + " having store " + store);
- }
- }
- return jciClassLoader;
- }
-
-
- private ReloadingListener createReloadingListener(final URL dir,
- final ResourceStore store, ClassLoaderConfiguration configuration) {
- final File repository = new File(dir.getFile());
-
- if (store instanceof PatternMatcherResourceStore) {
- PatternMatcherResourceStore mstore = (PatternMatcherResourceStore) store;
- mstore.setExcludes(configuration.getExcludes());
- mstore.setIncludes(configuration.getIncludes());
- }
- return new ReloadingListener(repository, store);
- }
+public class ReloadingClassLoaderFactory { // extends AbstractClassLoaderFactory {
+// TODO rcl
+// protected ClassLoaderConfiguration config;
+// private final static Log log = LogFactory.getLog(ReloadingListener.class);
+//
+// /**
+// * @see org.apache.cocoon.classloader.AbstractClassLoaderFactory#createClassLoader(java.lang.ClassLoader, org.apache.cocoon.classloader.ClassLoaderConfiguration, javax.servlet.ServletContext)
+// */
+// public ClassLoader createClassLoader(ClassLoader parent,
+// ClassLoaderConfiguration configuration,
+// ServletContext servletContext)
+// throws Exception {
+// this.config = configuration;
+// return super.createClassLoader(parent, config, servletContext);
+// }
+//
+// protected ClassLoader createClassLoader(URL[] urls,
+// List includePatterns,
+// List excludePatterns,
+// ClassLoader parent) {
+//
+// org.apache.commons.jci.ReloadingClassLoader jciClassLoader = new org.apache.commons.jci.ReloadingClassLoader(
+// new DefaultClassLoader(urls, includePatterns,
+// excludePatterns, Thread.currentThread()
+// .getContextClassLoader()));
+// Monitor fam = null;
+// if ( this.config instanceof ReloadingClassLoaderConfiguration ) {
+// fam = ((ReloadingClassLoaderConfiguration)this.config).getMonitor();
+// }
+// if ( fam != null ) {
+// for (int i = 0; i < urls.length; i++) {
+// URL url = urls[i];
+// final ResourceStore store = ((ReloadingClassLoaderConfiguration)this.config).getStore(url.getFile());
+//
+// final ReloadingListener listener = createReloadingListener(url,
+// store, this.config);
+// jciClassLoader.addListener(listener);
+// fam.subscribe(listener);
+// try {
+// listener.waitForFirstCheck();
+// } catch (Exception e) {
+// log.error("Timeout error configuring JCI Listener for url "
+// + url + " having store " + store);
+// }
+// log.debug("ReloadingClassLoaderFactory - Subscriber SitemapMonitor listener for url "
+// + url + " having store " + store);
+// }
+// }
+// return jciClassLoader;
+// }
+//
+//
+// private ReloadingListener createReloadingListener(final URL dir,
+// final ResourceStore store, ClassLoaderConfiguration configuration) {
+// final File repository = new File(dir.getFile());
+//
+// if (store instanceof PatternMatcherResourceStore) {
+// PatternMatcherResourceStore mstore = (PatternMatcherResourceStore) store;
+// mstore.setExcludes(configuration.getExcludes());
+// mstore.setIncludes(configuration.getIncludes());
+// }
+// return new ReloadingListener(repository, store);
+// }
}
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/MonitorImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/MonitorImpl.java?view=diff&rev=483453&r1=483452&r2=483453
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/MonitorImpl.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/MonitorImpl.java Thu Dec 7 05:37:33 2006
@@ -18,65 +18,67 @@
*/
package org.apache.cocoon.components.fam;
-import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.activity.Initializable;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.avalon.framework.thread.ThreadSafe;
-import org.apache.cocoon.classloader.reloading.Monitor;
-import org.apache.cocoon.classloader.reloading.NotifyingResourceStore;
-import org.apache.commons.jci.listeners.NotificationListener;
-import org.apache.commons.jci.listeners.ReloadingListener;
-import org.apache.commons.jci.monitor.FilesystemAlterationListener;
-import org.apache.commons.jci.monitor.FilesystemAlterationMonitor;
+// TODO rcl
+//import org.apache.avalon.framework.activity.Disposable;
+//import org.apache.avalon.framework.activity.Initializable;
+//import org.apache.avalon.framework.logger.AbstractLogEnabled;
+//import org.apache.avalon.framework.thread.ThreadSafe;
+//import org.apache.cocoon.classloader.reloading.Monitor;
+//import org.apache.cocoon.classloader.reloading.NotifyingResourceStore;
+//import org.apache.commons.jci.listeners.NotificationListener;
+//import org.apache.commons.jci.listeners.ReloadingListener;
+//import org.apache.commons.jci.monitor.FilesystemAlterationListener;
+//import org.apache.commons.jci.monitor.FilesystemAlterationMonitor;
/**
* @version $Id$
*/
-public final class MonitorImpl
- extends AbstractLogEnabled
- implements Monitor, ThreadSafe, Initializable, Disposable {
-
- private FilesystemAlterationMonitor monitor;
- private NotificationListener sitemapNotifier;
-
- /**
- * @see org.apache.avalon.framework.activity.Initializable#initialize()
- */
- public void initialize() throws Exception {
- this.monitor = new FilesystemAlterationMonitor();
- this.monitor.start();
- }
-
- /**
- * @see org.apache.avalon.framework.activity.Disposable#dispose()
- */
- public void dispose() {
- if ( this.monitor != null ) {
- this.monitor.stop();
- this.monitor = null;
- }
- }
-
- /**
- * @see org.apache.cocoon.classloader.reloading.Monitor#subscribe(org.apache.commons.jci.monitor.FilesystemAlterationListener)
- */
- public void subscribe(final FilesystemAlterationListener listener) {
- this.monitor.addListener(listener);
- this.monitor.addListener(new ReloadingListener(listener.getRepository(),new NotifyingResourceStore(this.sitemapNotifier)));
- }
-
- /**
- * @see org.apache.cocoon.classloader.reloading.Monitor#unsubscribe(org.apache.commons.jci.monitor.FilesystemAlterationListener)
- */
- public void unsubscribe(final FilesystemAlterationListener listener) {
- this.monitor.removeListener(listener);
- this.monitor.removeListener(new ReloadingListener(listener.getRepository(),new NotifyingResourceStore(this.sitemapNotifier)));
- }
-
- /**
- * @see org.apache.cocoon.classloader.reloading.Monitor#setSitemapNotifier(org.apache.commons.jci.listeners.NotificationListener)
- */
- public void setSitemapNotifier(NotificationListener sitemapNotifier) {
- this.sitemapNotifier = sitemapNotifier;
- }
+public final class MonitorImpl {
+// TODO rcl
+// extends AbstractLogEnabled
+// implements Monitor, ThreadSafe, Initializable, Disposable {
+//
+// private FilesystemAlterationMonitor monitor;
+// private NotificationListener sitemapNotifier;
+//
+// /**
+// * @see org.apache.avalon.framework.activity.Initializable#initialize()
+// */
+// public void initialize() throws Exception {
+// this.monitor = new FilesystemAlterationMonitor();
+// this.monitor.start();
+// }
+//
+// /**
+// * @see org.apache.avalon.framework.activity.Disposable#dispose()
+// */
+// public void dispose() {
+// if ( this.monitor != null ) {
+// this.monitor.stop();
+// this.monitor = null;
+// }
+// }
+//
+// /**
+// * @see org.apache.cocoon.classloader.reloading.Monitor#subscribe(org.apache.commons.jci.monitor.FilesystemAlterationListener)
+// */
+// public void subscribe(final FilesystemAlterationListener listener) {
+// this.monitor.addListener(listener);
+// this.monitor.addListener(new ReloadingListener(listener.getRepository(),new NotifyingResourceStore(this.sitemapNotifier)));
+// }
+//
+// /**
+// * @see org.apache.cocoon.classloader.reloading.Monitor#unsubscribe(org.apache.commons.jci.monitor.FilesystemAlterationListener)
+// */
+// public void unsubscribe(final FilesystemAlterationListener listener) {
+// this.monitor.removeListener(listener);
+// this.monitor.removeListener(new ReloadingListener(listener.getRepository(),new NotifyingResourceStore(this.sitemapNotifier)));
+// }
+//
+// /**
+// * @see org.apache.cocoon.classloader.reloading.Monitor#setSitemapNotifier(org.apache.commons.jci.listeners.NotificationListener)
+// */
+// public void setSitemapNotifier(NotificationListener sitemapNotifier) {
+// this.sitemapNotifier = sitemapNotifier;
+// }
}
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java?view=diff&rev=483453&r1=483452&r2=483453
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java Thu Dec 7 05:37:33 2006
@@ -42,7 +42,8 @@
import org.apache.cocoon.environment.internal.EnvironmentHelper;
import org.apache.cocoon.sitemap.SitemapExecutor;
import org.apache.cocoon.sitemap.impl.DefaultExecutor;
-import org.apache.commons.jci.listeners.NotificationListener;
+//TODO rcl
+//import org.apache.commons.jci.listeners.NotificationListener;
import org.apache.excalibur.source.Source;
import org.apache.excalibur.source.SourceResolver;
import org.apache.regexp.RE;
@@ -56,7 +57,7 @@
public class TreeProcessor extends AbstractLogEnabled
implements ThreadSafe, Processor, Serviceable,
Configurable,
- Disposable, Initializable,NotificationListener {
+ Disposable, Initializable { // TODO rcl ,NotificationListener {
/** The parent TreeProcessor, if any */
protected TreeProcessor parent;
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java?view=diff&rev=483453&r1=483452&r2=483453
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java Thu Dec 7 05:37:33 2006
@@ -335,8 +335,10 @@
* Build a processing tree from a <code>Configuration</code>.
*/
public ProcessingNode build(Configuration tree, String location) throws Exception {
- final Monitor fam = (Monitor) this.manager.lookup(Monitor.ROLE);
- fam.setSitemapNotifier(this.processor.getWrappingProcessor());
+// TODO rcl
+// final Monitor fam = (Monitor) this.manager.lookup(Monitor.ROLE);
+// fam.setSitemapNotifier(this.processor.getWrappingProcessor());
+ final Monitor fam = null;
this.itsContainer = SitemapHelper.createContainer(
tree,
location,
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java?view=diff&rev=483453&r1=483452&r2=483453
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java Thu Dec 7 05:37:33 2006
@@ -25,7 +25,8 @@
import org.apache.cocoon.classloader.reloading.ReloadingClassLoaderConfiguration;
import org.apache.cocoon.configuration.Settings;
import org.apache.cocoon.configuration.impl.PropertyHelper;
-import org.apache.commons.jci.stores.ResourceStore;
+//TODO rcl
+// import org.apache.commons.jci.stores.ResourceStore;
import org.apache.excalibur.source.Source;
import org.apache.excalibur.source.SourceResolver;
import org.apache.excalibur.source.TraversableSource;
@@ -78,82 +79,84 @@
}
}
- /**
- * Read the configuration for a class loader from an Avalon configuration.
- * This method is used by the sitemap to determine the classpath for the sitemap.
- * If a lib-directory is configured this method scans the directory and adds
- * all found jar/zip files to the classpath.
- * @param resolver The source resolver for the current sitemap.
- * @param config The configuration for the class loader
- * @return A class loader configuration object.
- * @throws Exception
- */
- public static ReloadingClassLoaderConfiguration createConfiguration(SourceResolver resolver,
- Configuration config)
- throws Exception {
- final ReloadingClassLoaderConfiguration configBean = new ReloadingClassLoaderConfiguration();
- final Configuration[] children = config.getChildren();
- for (int i = 0; i < children.length; i++) {
- final Configuration child = children[i];
- final String name = child.getName();
- if ("class-dir".equals(name)) {
- Source src = null;
- try {
- src = resolver.resolveURI(child.getAttribute("src"));
- if (!src.exists()) {
- throw new ConfigurationException(src.getURI() + " doesn't exist");
- }
- configBean.addClassDirectory(src.getURI());
- configureStore(configBean,src.getURI(),child.getChild("store",false));
- } finally {
- resolver.release(src);
- }
- } else if ("lib-dir".equals(name)) {
- Source src = null;
- try {
- src = resolver.resolveURI(child.getAttribute("src"));
- if (!src.exists()) {
- throw new Exception(src.getURI() + " doesn't exist");
- } else if (!(src instanceof TraversableSource) || !((TraversableSource)src).isCollection()) {
- throw new Exception(src.getURI() + " is not a directory");
- }
- Iterator iter = ((TraversableSource)src).getChildren().iterator();
- while (iter.hasNext()) {
- final Source childSrc = (Source)iter.next();
- String childURI = childSrc.getURI();
- resolver.release(childSrc);
- if (childURI.endsWith(".jar") || childURI.endsWith(".zip")) {
- configBean.addClassDirectory(childURI);
- }
- }
- } finally {
- resolver.release(src);
- }
- } else if ("include-classes".equals(name)) {
- configBean.addInclude(child.getAttribute("pattern"));
- } else if ("exclude-classes".equals(name)) {
- configBean.addExclude(child.getAttribute("pattern"));
- } else {
- throw new ConfigurationException("Unexpected element " + name + " at " + child.getLocation());
- }
- }
- return configBean;
- }
-
- /**
- * If a store node is configured in the class-dir/src-dir configuration,
- * let's configure the store; if no store node is configured add a default;
- * the default one is the JCI MemoryStore
- */
- private static void configureStore(ReloadingClassLoaderConfiguration configBean,
- String dirUri,
- Configuration storeConfig)
- throws Exception {
- final String storeClassName = (storeConfig != null
- ? storeConfig.getAttribute("class","org.apache.commons.jci.stores.MemoryResourceStore")
- : "org.apache.commons.jci.stores.MemoryResourceStore");
- final ResourceStore store = (ResourceStore)Class.forName(storeClassName).newInstance();
- final URL url = new URL(dirUri);
- configBean.addStore(url.getFile(),store);
- }
+// TODO rcl
+// /**
+// * Read the configuration for a class loader from an Avalon configuration.
+// * This method is used by the sitemap to determine the classpath for the sitemap.
+// * If a lib-directory is configured this method scans the directory and adds
+// * all found jar/zip files to the classpath.
+// * @param resolver The source resolver for the current sitemap.
+// * @param config The configuration for the class loader
+// * @return A class loader configuration object.
+// * @throws Exception
+// */
+
+// public static ReloadingClassLoaderConfiguration createConfiguration(SourceResolver resolver,
+// Configuration config)
+// throws Exception {
+// final ReloadingClassLoaderConfiguration configBean = new ReloadingClassLoaderConfiguration();
+// final Configuration[] children = config.getChildren();
+// for (int i = 0; i < children.length; i++) {
+// final Configuration child = children[i];
+// final String name = child.getName();
+// if ("class-dir".equals(name)) {
+// Source src = null;
+// try {
+// src = resolver.resolveURI(child.getAttribute("src"));
+// if (!src.exists()) {
+// throw new ConfigurationException(src.getURI() + " doesn't exist");
+// }
+// configBean.addClassDirectory(src.getURI());
+// configureStore(configBean,src.getURI(),child.getChild("store",false));
+// } finally {
+// resolver.release(src);
+// }
+// } else if ("lib-dir".equals(name)) {
+// Source src = null;
+// try {
+// src = resolver.resolveURI(child.getAttribute("src"));
+// if (!src.exists()) {
+// throw new Exception(src.getURI() + " doesn't exist");
+// } else if (!(src instanceof TraversableSource) || !((TraversableSource)src).isCollection()) {
+// throw new Exception(src.getURI() + " is not a directory");
+// }
+// Iterator iter = ((TraversableSource)src).getChildren().iterator();
+// while (iter.hasNext()) {
+// final Source childSrc = (Source)iter.next();
+// String childURI = childSrc.getURI();
+// resolver.release(childSrc);
+// if (childURI.endsWith(".jar") || childURI.endsWith(".zip")) {
+// configBean.addClassDirectory(childURI);
+// }
+// }
+// } finally {
+// resolver.release(src);
+// }
+// } else if ("include-classes".equals(name)) {
+// configBean.addInclude(child.getAttribute("pattern"));
+// } else if ("exclude-classes".equals(name)) {
+// configBean.addExclude(child.getAttribute("pattern"));
+// } else {
+// throw new ConfigurationException("Unexpected element " + name + " at " + child.getLocation());
+// }
+// }
+// return configBean;
+// }
+//
+// /**
+// * If a store node is configured in the class-dir/src-dir configuration,
+// * let's configure the store; if no store node is configured add a default;
+// * the default one is the JCI MemoryStore
+// */
+// private static void configureStore(ReloadingClassLoaderConfiguration configBean,
+// String dirUri,
+// Configuration storeConfig)
+// throws Exception {
+// final String storeClassName = (storeConfig != null
+// ? storeConfig.getAttribute("class","org.apache.commons.jci.stores.MemoryResourceStore")
+// : "org.apache.commons.jci.stores.MemoryResourceStore");
+// final ResourceStore store = (ResourceStore)Class.forName(storeClassName).newInstance();
+// final URL url = new URL(dirUri);
+// configBean.addStore(url.getFile(),store);
+// }
}
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java?view=diff&rev=483453&r1=483452&r2=483453
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java Thu Dec 7 05:37:33 2006
@@ -170,7 +170,10 @@
final WebApplicationContext parentContext = (WebApplicationContext)container.getBeanFactory();
// get classloader
- final ClassLoader classloader = createClassLoader(parentContext, config, fam, servletContext, sitemapResolver);
+// TODO rcl
+// final ClassLoader classloader = createClassLoader(parentContext, config, fam, servletContext, sitemapResolver);
+ final ClassLoader classloader = Thread.currentThread().getContextClassLoader();
+
// create root bean definition
final String definition = createDefinition(request.getSitemapURIPrefix(),
sitemapLocation.substring(pos+1),
@@ -187,36 +190,37 @@
}
}
- /**
- * Build a processing tree from a <code>Configuration</code>.
- * @param processor
- */
- protected static ClassLoader createClassLoader(BeanFactory parentFactory,
- Configuration config,
- Monitor fam,
- ServletContext servletContext,
- SourceResolver sitemapResolver)
- throws Exception {
- final Configuration componentConfig = config.getChild("components", false);
- Configuration classPathConfig = null;
-
- if ( componentConfig != null ) {
- classPathConfig = componentConfig.getChild(CLASSLOADER_CONFIG_NAME, false);
- }
- // Create class loader
- // we don't create a new class loader if there is no new configuration
- if ( classPathConfig == null ) {
- return Thread.currentThread().getContextClassLoader();
- }
- final String factoryRole = classPathConfig.getAttribute("factory-role", ClassLoaderFactory.ROLE);
-
- // Create a new classloader
- ReloadingClassLoaderConfiguration configBean = AvalonUtils.createConfiguration(sitemapResolver, classPathConfig);
- configBean.setMonitor(fam);
- ClassLoaderFactory clFactory = (ClassLoaderFactory)parentFactory.getBean(factoryRole);
- return clFactory.createClassLoader(Thread.currentThread().getContextClassLoader(),
- configBean,
- servletContext);
- }
+// TODO rcl
+// /**
+// * Build a processing tree from a <code>Configuration</code>.
+// * @param processor
+// */
+// protected static ClassLoader createClassLoader(BeanFactory parentFactory,
+// Configuration config,
+// Monitor fam,
+// ServletContext servletContext,
+// SourceResolver sitemapResolver)
+// throws Exception {
+// final Configuration componentConfig = config.getChild("components", false);
+// Configuration classPathConfig = null;
+//
+// if ( componentConfig != null ) {
+// classPathConfig = componentConfig.getChild(CLASSLOADER_CONFIG_NAME, false);
+// }
+// // Create class loader
+// // we don't create a new class loader if there is no new configuration
+// if ( classPathConfig == null ) {
+// return Thread.currentThread().getContextClassLoader();
+// }
+// final String factoryRole = classPathConfig.getAttribute("factory-role", ClassLoaderFactory.ROLE);
+//
+// // Create a new classloader
+// ReloadingClassLoaderConfiguration configBean = AvalonUtils.createConfiguration(sitemapResolver, classPathConfig);
+// configBean.setMonitor(fam);
+// ClassLoaderFactory clFactory = (ClassLoaderFactory)parentFactory.getBean(factoryRole);
+// return clFactory.createClassLoader(Thread.currentThread().getContextClassLoader(),
+// configBean,
+// servletContext);
+// }
}