myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r1072331 - /myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/config/view/ViewConfigExtension.java
Date Sat, 19 Feb 2011 14:15:54 GMT
Author: gpetracek
Date: Sat Feb 19 14:15:53 2011
New Revision: 1072331

URL: http://svn.apache.org/viewvc?rev=1072331&view=rev
Log:
basic logging for the bootstrapping process of EXTCDI-36, EXTCDI-68 and EXTCDI-125

Modified:
    myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/config/view/ViewConfigExtension.java

Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/config/view/ViewConfigExtension.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/config/view/ViewConfigExtension.java?rev=1072331&r1=1072330&r2=1072331&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/config/view/ViewConfigExtension.java
(original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/config/view/ViewConfigExtension.java
Sat Feb 19 14:15:53 2011
@@ -36,6 +36,8 @@ import javax.enterprise.inject.spi.Exten
 import javax.enterprise.inject.spi.ProcessAnnotatedType;
 import javax.enterprise.inject.spi.AnnotatedType;
 import java.lang.reflect.Modifier;
+import java.util.logging.Logger;
+import java.util.logging.Level;
 
 /**
  * @author Gerhard Petracek
@@ -43,6 +45,8 @@ import java.lang.reflect.Modifier;
 @SuppressWarnings({"UnusedDeclaration"})
 public class ViewConfigExtension implements Extension, Deactivatable
 {
+    private Logger logger = Logger.getLogger(ViewConfigExtension.class.getName());
+
     public void processPageDefinitions(@Observes ProcessAnnotatedType processAnnotatedType)
     {
         if(!isActivated())
@@ -54,8 +58,15 @@ public class ViewConfigExtension impleme
 
         if(processAnnotatedType.getAnnotatedType().isAnnotationPresent(InlineViewConfigRoot.class))
         {
+            if(this.logger.isLoggable(Level.INFO))
+            {
+                this.logger.info(InlineViewConfigRoot.class.getName() + " found at " +
+                        processAnnotatedType.getAnnotatedType().getJavaClass().getName());
+            }
+
             setInlineViewConfigRootMarker(processAnnotatedType.getAnnotatedType().getJavaClass());
-            processAnnotatedType.veto();
+            vetoBean(processAnnotatedType);
+
             return;
         }
 
@@ -76,7 +87,7 @@ public class ViewConfigExtension impleme
             else
             {
                 addPageDefinition(beanClass);
-                processAnnotatedType.veto();
+                vetoBean(processAnnotatedType);
             }
         }
 
@@ -110,6 +121,11 @@ public class ViewConfigExtension impleme
 
     protected void addPageDefinition(Class<? extends ViewConfig> pageDefinitionClass)
     {
+        if(this.logger.isLoggable(Level.INFO))
+        {
+            this.logger.info(pageDefinitionClass.getName() + " will be used as page-definition.");
+        }
+
         ViewConfigEntry newEntry = createViewConfigEntry(pageDefinitionClass);
 
         if(newEntry != null)
@@ -156,6 +172,11 @@ public class ViewConfigExtension impleme
 
     private void addInlinePageDefinition(ViewConfigExtractor viewConfigExtractor, Class<?
extends ViewConfig> beanClass)
     {
+        if(this.logger.isLoggable(Level.INFO))
+        {
+            this.logger.info(beanClass.getName() + " will be used as inline-page-definition.");
+        }
+
         ViewConfigCache.queueInlineViewConfig(viewConfigExtractor, beanClass);
     }
 
@@ -176,6 +197,11 @@ public class ViewConfigExtension impleme
                     " without a typesafe view config. Please don't use @View(inline=\"...\")
for this use-case!");
         }
 
+        if(this.logger.isLoggable(Level.INFO))
+        {
+            this.logger.info(annotatedType.getJavaClass().getName() + " will be used as page-bean.");
+        }
+
         String viewId;
         for(Class<? extends ViewConfig> viewConfigClass : view.value())
         {
@@ -238,6 +264,17 @@ public class ViewConfigExtension impleme
         return viewConfigExtractor;
     }
 
+    private void vetoBean(ProcessAnnotatedType processAnnotatedType)
+    {
+        if(this.logger.isLoggable(Level.FINER))
+        {
+            this.logger.finer(processAnnotatedType.getAnnotatedType().getJavaClass().getName()
+
+                    " won't be used as CDI bean");
+        }
+
+        processAnnotatedType.veto();
+    }
+
     public boolean isActivated()
     {
         return ClassDeactivation.isClassActivated(getClass());



Mime
View raw message