You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2007/10/18 05:36:25 UTC
svn commit: r585828 - in /cocoon/trunk/core/cocoon-core/src/main:
java/org/apache/cocoon/components/source/impl/
java/org/apache/cocoon/matching/ java/org/apache/cocoon/servlet/
resources/org/apache/cocoon/
Author: vgritsenko
Date: Wed Oct 17 20:36:25 2007
New Revision: 585828
URL: http://svn.apache.org/viewvc?rev=585828&view=rev
Log:
cleanup components
add comment to xconf
Modified:
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/matching/LocaleMatcher.java
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/DebugFilter.java
cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java?rev=585828&r1=585827&r2=585828&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java Wed Oct 17 20:36:25 2007
@@ -25,9 +25,6 @@
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.cocoon.caching.Cache;
-import org.apache.cocoon.components.source.helpers.SourceRefresher;
-import org.apache.cocoon.util.avalon.CLLoggerWrapper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.excalibur.source.Source;
@@ -40,6 +37,9 @@
import org.apache.excalibur.source.URIAbsolutizer;
import org.springframework.beans.factory.BeanNameAware;
+import org.apache.cocoon.caching.Cache;
+import org.apache.cocoon.components.source.helpers.SourceRefresher;
+
/**
* This class implements a proxy like source caches the contents of the source
* it wraps. This implementation can cache the content either for a given period
@@ -143,7 +143,7 @@
* @param parameters This is optional.
*/
public Source getSource(final String location, final Map parameters)
- throws MalformedURLException, IOException {
+ throws IOException {
if (logger.isDebugEnabled() ) {
logger.debug("Creating source " + location);
@@ -202,18 +202,15 @@
boolean fail)
throws SourceException {
- CachingSource source = instantiateSource(
- uri,
- wrappedUri,
- wrappedSource,
- expires,
- cacheName,
- fail);
+ CachingSource source = instantiateSource(uri,
+ wrappedUri,
+ wrappedSource,
+ expires,
+ cacheName,
+ fail);
// set the required components directly for speed
source.cache = this.cache;
-
- ContainerUtil.enableLogging(source, new CLLoggerWrapper(logger));
try {
// call selected avalon lifecycle interfaces. Mmmh.
ContainerUtil.service(source, this.serviceManager);
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/matching/LocaleMatcher.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/matching/LocaleMatcher.java?rev=585828&r1=585827&r2=585828&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/matching/LocaleMatcher.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/matching/LocaleMatcher.java Wed Oct 17 20:36:25 2007
@@ -16,27 +16,26 @@
*/
package org.apache.cocoon.matching;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.Serviceable;
import org.apache.avalon.framework.thread.ThreadSafe;
-
-import org.apache.cocoon.i18n.I18nUtils;
-import org.apache.cocoon.sitemap.PatternException;
-
import org.apache.commons.lang.StringUtils;
import org.apache.excalibur.source.Source;
import org.apache.excalibur.source.SourceResolver;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
+import org.apache.cocoon.i18n.I18nUtils;
+import org.apache.cocoon.sitemap.PatternException;
+import org.apache.cocoon.util.AbstractLogEnabled;
/**
* @cocoon.sitemap.component.documentation
@@ -149,7 +148,8 @@
* @version $Id$
*/
public class LocaleMatcher extends AbstractLogEnabled
- implements Matcher, ThreadSafe, Serviceable, Configurable, Disposable {
+ implements Matcher, ThreadSafe, Serviceable, Configurable,
+ Disposable {
private static final String DEFAULT_LOCALE_ATTRIBUTE = "locale";
private static final String DEFAULT_DEFAULT_LANG = "en";
@@ -308,11 +308,8 @@
// Test "language" locale (or empty - if language is "")
testLocale = new Locale(locale.getLanguage(), "");
- if (isValidResource(pattern, locale, testLocale, map)) {
- return true;
- }
+ return isValidResource(pattern, locale, testLocale, map);
- return false;
}
private boolean isValidResource(String pattern, Locale locale, Locale testLocale, Map map) {
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/DebugFilter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/DebugFilter.java?rev=585828&r1=585827&r2=585828&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/DebugFilter.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/DebugFilter.java Wed Oct 17 20:36:25 2007
@@ -35,11 +35,11 @@
import org.springframework.web.context.support.WebApplicationContextUtils;
/**
- * Servlet filter for handling multi part MIME uploads
+ * Servlet filter for printing request debug information into log file.
*
* @version $Id$
*/
-public class DebugFilter implements Filter{
+public class DebugFilter implements Filter {
final static protected String lineSeparator = SystemUtils.LINE_SEPARATOR;
Modified: cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf?rev=585828&r1=585827&r2=585828&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf (original)
+++ cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf Wed Oct 17 20:36:25 2007
@@ -15,22 +15,25 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<!--+
- | This is the default cocoon.xconf which is used if no own configuration file is used.
- | $Id$
- +-->
+
+<!--
+ - This is the default cocoon.xconf which is used if no custom configuration file
+ - were provided in <avalon:bridge> element.
+ -
+ - $Id$
+ -->
<cocoon version="2.2">
- <!--+
- | Include the core roles definitions. This is for the sake of clarity,
- | as they are implicitely loaded at startup, but we may want to remove
- | this implicit behaviour in the future now that we have the include
- | mechanism.
- +-->
+ <!--
+ - Include the core roles definitions. This is for the sake of clarity,
+ - as they are implicitely loaded at startup, but we may want to remove
+ - this implicit behaviour in the future now that we have the include
+ - mechanism.
+ -->
<include src="resource://org/apache/cocoon/cocoon.roles"/>
- <!--+
- | Include all configuration files (for core and blocks) from within the classpath.
- +-->
+ <!--
+ - Include all configuration files (for core and blocks) from within the classpath.
+ -->
<include dir="classpath*:META-INF/cocoon/avalon" pattern="*.xconf"/>
</cocoon>