You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by rg...@apache.org on 2008/01/06 10:35:50 UTC
svn commit: r609282 [2/2] - in /cocoon/trunk:
blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/modules/
blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/modules/a/
blocks/cocoon-core-sample/cocoon...
Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/test/java/org/apache/cocoon/environment/mock/MockRequest.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/test/java/org/apache/cocoon/environment/mock/MockRequest.java?rev=609282&r1=609281&r2=609282&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/test/java/org/apache/cocoon/environment/mock/MockRequest.java (original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/test/java/org/apache/cocoon/environment/mock/MockRequest.java Sun Jan 6 01:35:48 2008
@@ -37,7 +37,6 @@
import org.apache.cocoon.environment.Cookie;
import org.apache.cocoon.environment.Environment;
-import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.environment.impl.AbstractRequest;
@@ -168,8 +167,9 @@
}
/**
- * @param name
- * @param value
+ * Add a parameter.
+ * @param name The name of the parameter.
+ * @param value The value of the parameter.
*/
public void addParameter(String name, String value) {
parameters.put(name, value);
@@ -225,7 +225,7 @@
}
/**
- * @param locale
+ * @param locale The Locale to set to.
*/
public void setLocale(Locale locale) {
this.locale = locale;
@@ -541,70 +541,56 @@
* @see org.apache.cocoon.environment.Request#getAttribute(java.lang.String)
*/
public Object getAttribute(String name) {
- return this.getAttribute(name, Request.GLOBAL_SCOPE);
+ return this.globalAttributes.get(name);
}
/**
* @see org.apache.cocoon.environment.Request#getAttributeNames()
*/
public Enumeration getAttributeNames() {
- return this.getAttributeNames(Request.GLOBAL_SCOPE);
+ return this.globalAttributes.keys();
}
/**
* @see org.apache.cocoon.environment.Request#setAttribute(java.lang.String, java.lang.Object)
*/
public void setAttribute(String name, Object value) {
- this.setAttribute(name, value, Request.GLOBAL_SCOPE);
+ this.globalAttributes.put(name, value);
}
/**
* @see org.apache.cocoon.environment.Request#removeAttribute(java.lang.String)
*/
public void removeAttribute(String name) {
- this.removeAttribute(name, Request.GLOBAL_SCOPE);
+ this.globalAttributes.remove(name);
}
/**
- * @see org.apache.cocoon.environment.Request#getAttribute(java.lang.String, int)
+ * @see org.apache.cocoon.environment.Request#getLocalAttribute(java.lang.String)
*/
- public Object getAttribute(String name, int scope) {
- if ( scope == Request.REQUEST_SCOPE ) {
- return this.attributes.get(name);
- }
- return this.globalAttributes.get(name);
+ public Object getLocalAttribute(String name) {
+ return this.attributes.get(name);
}
/**
- * @see org.apache.cocoon.environment.Request#getAttributeNames(int)
+ * @see org.apache.cocoon.environment.Request#getLocalAttributeNames()
*/
- public Enumeration getAttributeNames(int scope) {
- if ( scope == Request.REQUEST_SCOPE ) {
- return this.attributes.keys();
- }
- return this.globalAttributes.keys();
+ public Enumeration getLocalAttributeNames() {
+ return this.attributes.keys();
}
/**
- * @see org.apache.cocoon.environment.Request#setAttribute(java.lang.String, java.lang.Object, int)
+ * @see org.apache.cocoon.environment.Request#setLocalAttribute(java.lang.String, java.lang.Object)
*/
- public void setAttribute(String name, Object value, int scope) {
- if ( scope == Request.REQUEST_SCOPE ) {
- this.attributes.put(name, value);
- } else {
- this.globalAttributes.put(name, value);
- }
+ public void setLocalAttribute(String name, Object value) {
+ this.attributes.put(name, value);
}
/**
- * @see org.apache.cocoon.environment.Request#removeAttribute(java.lang.String, int)
+ * @see org.apache.cocoon.environment.Request#removeLocalAttribute(java.lang.String)
*/
- public void removeAttribute(String name, int scope) {
- if ( scope == Request.REQUEST_SCOPE ) {
- this.attributes.remove(name);
- } else {
- this.globalAttributes.remove(name);
- }
+ public void removeLocalAttribute(String name) {
+ this.attributes.remove(name);
}
/**
@@ -626,9 +612,9 @@
* @see org.apache.cocoon.environment.Request#searchAttribute(java.lang.String)
*/
public Object searchAttribute(String name) {
- Object result = this.getAttribute(name, REQUEST_SCOPE);
+ Object result = this.getLocalAttribute(name);
if ( result == null ) {
- result = this.getAttribute(name, GLOBAL_SCOPE);
+ result = this.getAttribute(name);
}
return result;
}
Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/test/java/org/apache/cocoon/environment/mock/MockRequestAttributes.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/test/java/org/apache/cocoon/environment/mock/MockRequestAttributes.java?rev=609282&r1=609281&r2=609282&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/test/java/org/apache/cocoon/environment/mock/MockRequestAttributes.java (original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/test/java/org/apache/cocoon/environment/mock/MockRequestAttributes.java Sun Jan 6 01:35:48 2008
@@ -54,10 +54,10 @@
*/
public Object getAttribute(String key, int scope) {
if ( scope == RequestAttributes.SCOPE_REQUEST ) {
- return this.request.getAttribute(key, Request.REQUEST_SCOPE);
+ return this.request.getLocalAttribute(key);
}
if ( scope == RequestAttributes.SCOPE_SESSION ) {
- return this.request.getAttribute(key, Request.GLOBAL_SCOPE);
+ return this.request.getAttribute(key);
}
final HttpSession session = this.request.getSession(false);
if ( session != null ) {
@@ -78,10 +78,10 @@
*/
public void removeAttribute(String key, int scope) {
if ( scope == RequestAttributes.SCOPE_REQUEST ) {
- this.request.removeAttribute(key, Request.REQUEST_SCOPE);
+ this.request.removeLocalAttribute(key);
}
if ( scope == RequestAttributes.SCOPE_SESSION ) {
- this.request.removeAttribute(key, Request.GLOBAL_SCOPE);
+ this.request.removeAttribute(key);
}
if ( scope == RequestAttributes.SCOPE_GLOBAL_SESSION ) {
final HttpSession session = this.request.getSession(false);
@@ -96,10 +96,10 @@
*/
public void setAttribute(String key, Object value, int scope) {
if ( scope == RequestAttributes.SCOPE_REQUEST ) {
- this.request.setAttribute(key, value, Request.REQUEST_SCOPE);
+ this.request.setLocalAttribute(key, value);
}
if ( scope == RequestAttributes.SCOPE_SESSION ) {
- this.request.setAttribute(key, value, Request.GLOBAL_SCOPE);
+ this.request.setAttribute(key, value);
}
if ( scope == RequestAttributes.SCOPE_GLOBAL_SESSION ) {
final HttpSession session = this.request.getSession(true);
Modified: cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/changes/changes.xml?rev=609282&r1=609281&r2=609282&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/changes/changes.xml (original)
+++ cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/changes/changes.xml Sun Jan 6 01:35:48 2008
@@ -24,7 +24,10 @@
+-->
<document>
<body>
- <release version="1.0.0-RC1" date="2007-??-??" description="unreleased">
+ <release version="1.0.0-RC1" date="2007-??-??" description="unreleased">
+ <action dev="rgoers" type="add">
+ Add cache for XPathXMLFileModule.
+ </action>
<action dev="reinhard" type="fix">
Move all Spring configuration files into the "cocoon-store-impl" namespace.
</action>
Modified: cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/properties/cocoon-store-impl.properties
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/properties/cocoon-store-impl.properties?rev=609282&r1=609281&r2=609282&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/properties/cocoon-store-impl.properties (original)
+++ cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/properties/cocoon-store-impl.properties Sun Jan 6 01:35:48 2008
@@ -17,3 +17,4 @@
org.apache.cocoon.store.use-cache-directory=true
org.apache.cocoon.store.transient.maxobjects=1000
+org.apache.cocoon.store.xmlfile.maxobjects=100
\ No newline at end of file
Added: cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-xmlfile.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-xmlfile.xml?rev=609282&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-xmlfile.xml (added)
+++ cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-xmlfile.xml Sun Jan 6 01:35:48 2008
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id: cocoon-store-impl-transient.xml 525824 2007-04-05 13:33:39Z reinhard $ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+ <!--+
+ | Transient Store: holds objects that don't have to survive shutdown
+ |
+ | Common configuration parameters:
+ | maxobjects: Indicates how many objects will be held in the cache.
+ | When the number of maxobjects has been reached. The last object
+ | in the cache will be thrown out.
+ +-->
+ <bean name="org.apache.excalibur.store.Store/XPathXMLFileTransientStore"
+ class="org.apache.cocoon.components.store.impl.DefaultTransientStore"
+ init-method="init" destroy-method="destroy">
+ <property name="maxObjects" value="${org.apache.cocoon.store.xmlfile.maxobjects}"/>
+ <property name="storeJanitor" ref="org.apache.excalibur.store.StoreJanitor"/>
+ </bean>
+</beans>
\ No newline at end of file