svn commit: r741314 - in /lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya: cms/cocoon/components/modules/input/FallbackModule.java util/Assert.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Thu Feb  5 22:16:14 2009
New Revision: 741314

URL: http://svn.apache.org/viewvc?rev=741314&view=rev
Log:
Springify fallback module.

Modified:
    lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/FallbackModule.java
    lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/util/Assert.java

Modified: lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/FallbackModule.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/FallbackModule.java?rev=741314&r1=741313&r2=741314&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/FallbackModule.java (original)
+++ lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/FallbackModule.java Thu Feb  5 22:16:14 2009
@@ -24,9 +24,6 @@
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.parameters.ParameterException;
-import org.apache.avalon.framework.parameters.Parameterizable;
-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;
@@ -43,6 +40,7 @@
 import org.apache.lenya.cms.repository.RepositoryUtil;
 import org.apache.lenya.cms.repository.Session;
 import org.apache.lenya.util.ServletHelper;
+import org.springframework.util.Assert;
 
 /**
  * <p>
@@ -50,9 +48,8 @@
  * template-fallback, ...) is configurable via the <em>protocol</em> parameter.
  * </p>
  */
-public class FallbackModule extends AbstractInputModule implements Serviceable, Parameterizable {
+public class FallbackModule extends AbstractInputModule implements Serviceable {
 
-    protected static final String PARAM_PROTOCOL = "protocol";
     protected ServiceManager manager;
     private String protocol;
     protected static MRUMemoryStore store;
@@ -153,10 +150,10 @@
         this.manager = manager;
         
     }
-
-    public void parameterize(Parameters params) throws ParameterException {
-        this.protocol = params.getParameter(PARAM_PROTOCOL);
-        
+    
+    public void setProtocol(String protocol) {
+        Assert.notNull(protocol, "protocol");
+        this.protocol = protocol;
     }
 
 }
\ No newline at end of file

Modified: lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/util/Assert.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/util/Assert.java?rev=741314&r1=741313&r2=741314&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/util/Assert.java (original)
+++ lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/util/Assert.java Thu Feb  5 22:16:14 2009
@@ -19,6 +19,7 @@
 
 /**
  * Assertion utility.
+ * @deprecated Use {@link org.springframework.util.Assert}Êinstead.
  */
 public final class Assert {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.