cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r408906 - in /cocoon/trunk/core: cocoon-bootstrap/ cocoon-core/src/main/java/org/apache/cocoon/components/fam/ cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/ cocoon-core/src/main/java/org/apache/cocoon/components/pers...
Date Tue, 23 May 2006 14:27:17 GMT
Author: cziegeler
Date: Tue May 23 07:27:16 2006
New Revision: 408906

URL: http://svn.apache.org/viewvc?rev=408906&view=rev
Log:
Finish per sitemap settings
Cleanup

Added:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/SettingsInputModule.java
  (with props)
Removed:
    cocoon/trunk/core/cocoon-bootstrap/status.xml
Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/SitemapMonitor.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/SitemapMonitorImpl.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/persistence/RequestDataStore.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/persistence/RequestDataStoreImpl.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PoolableFactoryBean.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/XmlConfigCreator.java
    cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.roles

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/SitemapMonitor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/SitemapMonitor.java?rev=408906&r1=408905&r2=408906&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/SitemapMonitor.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/SitemapMonitor.java
Tue May 23 07:27:16 2006
@@ -3,14 +3,14 @@
  * Licensed  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.
  */
@@ -19,8 +19,9 @@
 import org.apache.commons.jci.monitor.FilesystemAlterationListener;
 
 public interface SitemapMonitor {
-	String ROLE = SitemapMonitor.class.getName();
-    
+
+    String ROLE = SitemapMonitor.class.getName();
+
     void subscribe(final FilesystemAlterationListener listener);    
     void unsubscribe(final FilesystemAlterationListener listener);
 }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/SitemapMonitorImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/SitemapMonitorImpl.java?rev=408906&r1=408905&r2=408906&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/SitemapMonitorImpl.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/fam/SitemapMonitorImpl.java
Tue May 23 07:27:16 2006
@@ -3,14 +3,14 @@
  * Licensed  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.
  */
@@ -23,26 +23,44 @@
 import org.apache.commons.jci.monitor.FilesystemAlterationListener;
 import org.apache.commons.jci.monitor.FilesystemAlterationMonitor;
 
+/**
+ * @version $Id$
+ */
 public final class SitemapMonitorImpl 
     extends AbstractLogEnabled 
     implements SitemapMonitor, ThreadSafe, Initializable, Disposable {
 
     private FilesystemAlterationMonitor monitor;
 
+    /**
+     * @see org.apache.avalon.framework.activity.Initializable#initialize()
+     */
     public void initialize() throws Exception {
-        monitor = new FilesystemAlterationMonitor();
-        monitor.start();
+        this.monitor = new FilesystemAlterationMonitor();
+        this.monitor.start();
     }
 
+    /**
+     * @see org.apache.avalon.framework.activity.Disposable#dispose()
+     */
     public void dispose() {
-        monitor.stop();
+        if ( this.monitor != null ) {
+            this.monitor.stop();
+            this.monitor = null;
+        }
     }
-    
+
+    /**
+     * @see org.apache.cocoon.components.fam.SitemapMonitor#subscribe(org.apache.commons.jci.monitor.FilesystemAlterationListener)
+     */
     public void subscribe(final FilesystemAlterationListener listener) {
-        monitor.addListener(listener);
+        this.monitor.addListener(listener);
     }
-    
+
+    /**
+     * @see org.apache.cocoon.components.fam.SitemapMonitor#unsubscribe(org.apache.commons.jci.monitor.FilesystemAlterationListener)
+     */
     public void unsubscribe(final FilesystemAlterationListener listener) {
-        monitor.removeListener(listener);
+        this.monitor.removeListener(listener);
     }
 }

Added: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/SettingsInputModule.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/SettingsInputModule.java?rev=408906&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/SettingsInputModule.java
(added)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/SettingsInputModule.java
Tue May 23 07:27:16 2006
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.components.modules.input;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.cocoon.ProcessingUtil;
+import org.apache.cocoon.core.Settings;
+import org.apache.cocoon.environment.internal.EnvironmentHelper;
+import org.apache.commons.collections.IteratorUtils;
+
+/**
+ * This module allows access to properties defined in the settings.
+ *
+ * @version $Id$
+ */
+public final class SettingsInputModule
+    extends AbstractLogEnabled
+    implements InputModule, ThreadSafe {
+
+    /**
+     * @see org.apache.cocoon.components.modules.input.InputModule#getAttribute(java.lang.String,
org.apache.avalon.framework.configuration.Configuration, java.util.Map)
+     */
+    /**
+     * @see org.apache.cocoon.components.modules.input.InputModule#getAttribute(java.lang.String,
org.apache.avalon.framework.configuration.Configuration, java.util.Map)
+     */
+    public Object getAttribute(String name, Configuration modeConf, Map objectModel)
+    throws ConfigurationException {
+        final Settings settings = (Settings)EnvironmentHelper.getCurrentProcessor().getBeanFactory().getBean(ProcessingUtil.SETTINGS_ROLE);
+        if ( settings != null ) {
+            return settings.getProperty(name);
+        }
+        return null;
+    }
+
+    /**
+     * @see org.apache.cocoon.components.modules.input.InputModule#getAttributeNames(org.apache.avalon.framework.configuration.Configuration,
java.util.Map)
+     */
+    public Iterator getAttributeNames(Configuration modeConf, Map objectModel)
+    throws ConfigurationException {
+        return IteratorUtils.EMPTY_ITERATOR;
+    }
+
+    /**
+     * @see org.apache.cocoon.components.modules.input.InputModule#getAttributeValues(java.lang.String,
org.apache.avalon.framework.configuration.Configuration, java.util.Map)
+     */
+    public Object[] getAttributeValues(String name, Configuration modeConf, Map objectModel)
+    throws ConfigurationException {
+        Object o = this.getAttribute(name, modeConf, objectModel);
+        if (o != null) {
+            return new Object[] {o};
+        }
+        return null;
+    }
+}

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/SettingsInputModule.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/SettingsInputModule.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/persistence/RequestDataStore.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/persistence/RequestDataStore.java?rev=408906&r1=408905&r2=408906&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/persistence/RequestDataStore.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/persistence/RequestDataStore.java
Tue May 23 07:27:16 2006
@@ -1,12 +1,12 @@
 /*
  * Copyright 1999-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
@@ -14,7 +14,6 @@
  * limitations under the License.
  */
 package org.apache.cocoon.components.persistence;
-
 
 /**
  * A request data store is a component that manages data that is

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/persistence/RequestDataStoreImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/persistence/RequestDataStoreImpl.java?rev=408906&r1=408905&r2=408906&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/persistence/RequestDataStoreImpl.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/persistence/RequestDataStoreImpl.java
Tue May 23 07:27:16 2006
@@ -1,12 +1,12 @@
 /*
  * Copyright 1999-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
@@ -28,7 +28,7 @@
 
 /**
  * The default implementation
- * 
+ *
  * @version $Id$
  * @since 2.1.1
  * @deprecated Use the scoped attributes on the Request object instead.

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java?rev=408906&r1=408905&r2=408906&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryUtil.java
Tue May 23 07:27:16 2006
@@ -159,7 +159,9 @@
             // add local resolver
             if ( resolver != null ) {
                 factory.registerSingleton(SourceResolver.ROLE + "/Local", resolver);
-            }            
+            }
+            // add local settings
+            factory.registerSingleton(ProcessingUtil.SETTINGS_ROLE, env.settings);
             prepareBeanFactory(factory, info);
             if (preInstantiateSingletons) {
                 factory.preInstantiateSingletons();

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PoolableFactoryBean.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PoolableFactoryBean.java?rev=408906&r1=408905&r2=408906&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PoolableFactoryBean.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PoolableFactoryBean.java
Tue May 23 07:27:16 2006
@@ -3,14 +3,14 @@
  * Licensed  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.
  */
@@ -40,7 +40,7 @@
  */
 public class PoolableFactoryBean
     implements FactoryBean, BeanFactoryAware {
-    
+
     /** The default max size of the pool. */
     public static final int DEFAULT_MAX_POOL_SIZE = 64;
 
@@ -105,7 +105,7 @@
     throws Exception {
         this(name, className, DEFAULT_MAX_POOL_SIZE);
     }
-    
+
     /**
      * Create a PoolableComponentHandler which manages a pool of Components
      * created by the specified factory object.
@@ -148,6 +148,7 @@
             this.poolOutMethod = null;
         }
     }
+
     /**
      * Dispose of associated Pools and Factories.
      */
@@ -163,7 +164,7 @@
             }
         }
     }
-    
+
     /**
      * Permanently removes a poolable from the pool's active list and
      *  destroys it so that it will not ever be reused.
@@ -315,14 +316,14 @@
     }
 
     protected static final class ProxyHandler implements InvocationHandler, ProcessingUtil.CleanupTask
{
-        
+
         private final ThreadLocal componentHolder = new ThreadLocal();
         private final PoolableFactoryBean handler;
 
         public ProxyHandler(PoolableFactoryBean handler) {
             this.handler = handler;
         }
-        
+
         /**
          * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method,
java.lang.Object[])
          */
@@ -341,8 +342,7 @@
                 throw ite.getTargetException();
             }
         }
-        
-        
+
         /**
          * @see ProcessingUtil.CleanupTask#invoke()
          */
@@ -356,6 +356,4 @@
             this.componentHolder.set(null);
         }
     }
-    
-    
 }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/XmlConfigCreator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/XmlConfigCreator.java?rev=408906&r1=408905&r2=408906&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/XmlConfigCreator.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/XmlConfigCreator.java
Tue May 23 07:27:16 2006
@@ -1,12 +1,12 @@
 /*
  * Copyright 2006 The Apache Software Foundation
- * 
+ *
  * Licensed 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.

Modified: cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.roles
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.roles?rev=408906&r1=408905&r2=408906&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.roles (original)
+++ cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.roles Tue May
23 07:27:16 2006
@@ -181,14 +181,11 @@
         model="non-thread-safe-pooled"/>
 	
   <!--=========================================================================-->
-  
+  <!--
   <role name="org.apache.cocoon.components.fam.SitemapMonitor"
         shorthand="fam"
         default-class="org.apache.cocoon.components.fam.SitemapMonitorImpl"/>
-        
-  <role name="org.apache.cocoon.components.image.ImageEncoderSelector"
-        shorthand="image-encoder"/>
-
+  -->      
   <role name="org.apache.excalibur.xmlizer.XMLizer"
         shorthand="xmlizer"
         default-class="org.apache.excalibur.xmlizer.DefaultXMLizer"/>



Mime
View raw message