myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r823577 - /myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/startup/AbstractStartupListener.java
Date Fri, 09 Oct 2009 15:09:22 GMT
Author: gpetracek
Date: Fri Oct  9 15:09:22 2009
New Revision: 823577

URL: http://svn.apache.org/viewvc?rev=823577&view=rev
Log:
EXTVAL-62 naming convention to deactivate listener

Modified:
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/startup/AbstractStartupListener.java

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/startup/AbstractStartupListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/startup/AbstractStartupListener.java?rev=823577&r1=823576&r2=823577&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/startup/AbstractStartupListener.java
(original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/startup/AbstractStartupListener.java
Fri Oct  9 15:09:22 2009
@@ -19,6 +19,7 @@
 package org.apache.myfaces.extensions.validator.core.startup;
 
 import org.apache.myfaces.extensions.validator.util.JsfUtils;
+import org.apache.myfaces.extensions.validator.util.WebXmlUtils;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
 import org.apache.commons.logging.LogFactory;
@@ -73,7 +74,17 @@
 
                     try
                     {
-                        init();
+                        if(!isStartupListenerDeactivated())
+                        {
+                            init();
+                        }
+                        else
+                        {
+                            if(logger.isInfoEnabled())
+                            {
+                                logger.info("init of " + getClass().getName() + " deactivated");
+                            }
+                        }
 
                         if(logger.isInfoEnabled())
                         {
@@ -109,5 +120,10 @@
         return PhaseId.RESTORE_VIEW;
     }
 
+    protected boolean isStartupListenerDeactivated()
+    {
+        return "true".equalsIgnoreCase(WebXmlUtils.getInitParameter(getClass().getName()
+ ":DEACTIVATED"));
+    }
+
     protected abstract void init();
 }
\ No newline at end of file



Mime
View raw message