Author: dallen6
Date: 2010-01-08 09:20:58 -0500 (Fri, 08 Jan 2010)
New Revision: 5399
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWeldELResolver.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/Category.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ElMessage.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ServletMessage.java
core/trunk/impl/src/main/java/org/jboss/weld/servlet/WeldListener.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/el_en.properties
core/trunk/impl/src/main/resources/org/jboss/weld/messages/servlet_en.properties
Log:
Added trace messages in a few places and the category for EL
Modified: core/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWeldELResolver.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWeldELResolver.java 2010-01-08
13:59:36 UTC (rev 5398)
+++ core/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWeldELResolver.java 2010-01-08
14:20:58 UTC (rev 5399)
@@ -17,6 +17,10 @@
package org.jboss.weld.el;
import static org.jboss.weld.el.ELCreationalContextStack.getCreationalContextStore;
+import static org.jboss.weld.logging.Category.EL;
+import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
+import static org.jboss.weld.logging.messages.ElMessage.PROPERTY_LOOKUP;
+import static org.jboss.weld.logging.messages.ElMessage.PROPERTY_RESOLVED;
import static org.jboss.weld.logging.messages.ElMessage.RESOLUTION_ERROR;
import java.beans.FeatureDescriptor;
@@ -29,6 +33,7 @@
import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.manager.BeanManagerImpl;
+import org.slf4j.cal10n.LocLogger;
/**
* An EL-resolver against the named beans
@@ -37,6 +42,7 @@
*/
public abstract class AbstractWeldELResolver extends ELResolver
{
+ private static final LocLogger log = loggerFactory().getLogger(EL);
protected abstract BeanManagerImpl getManager(ELContext context);
@@ -64,13 +70,16 @@
if (property != null)
{
String propertyString = property.toString();
+ log.trace(PROPERTY_LOOKUP, propertyString);
Namespace namespace = null;
- if (base == null)
+ if (base == null)
{
if (getManager(context).getRootNamespace().contains(propertyString))
{
+ Object value =
getManager(context).getRootNamespace().get(propertyString);
context.setPropertyResolved(true);
- return getManager(context).getRootNamespace().get(propertyString);
+ log.trace(PROPERTY_RESOLVED, propertyString, value);
+ return value;
}
}
else if (base instanceof Namespace)
@@ -81,7 +90,9 @@
if (namespace.contains(propertyString))
{
// There is a child namespace
- return namespace.get(propertyString);
+ Object value = namespace.get(propertyString);
+ log.trace(PROPERTY_RESOLVED, propertyString, value);
+ return value;
}
}
else
@@ -108,12 +119,12 @@
{
value = creationalContext.putIfAbsent(bean, new Callable<Object>()
{
-
+
public Object call() throws Exception
{
return getManager(context).getReference(bean, creationalContext,
false);
}
-
+
});
}
}
@@ -124,6 +135,7 @@
if (value != null)
{
context.setPropertyResolved(true);
+ log.trace(PROPERTY_RESOLVED, propertyString, value);
return value;
}
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/logging/Category.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/logging/Category.java 2010-01-08 13:59:36
UTC (rev 5398)
+++ core/trunk/impl/src/main/java/org/jboss/weld/logging/Category.java 2010-01-08 14:20:58
UTC (rev 5399)
@@ -12,7 +12,8 @@
JSF("JSF"),
EVENT("Event"),
CONVERSATION("Conversation"),
- CONTEXT("Context");
+ CONTEXT("Context"),
+ EL("El");
private static final String LOG_PREFIX = "org.jboss.weld.";
Modified: core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ElMessage.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ElMessage.java 2010-01-08
13:59:36 UTC (rev 5398)
+++
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ElMessage.java 2010-01-08
14:20:58 UTC (rev 5399)
@@ -38,5 +38,7 @@
public enum ElMessage
{
@MessageId("001000") RESOLUTION_ERROR,
- @MessageId("001001") NULL_EXPRESSION_FACTORY;
+ @MessageId("001001") NULL_EXPRESSION_FACTORY,
+ @MessageId("001002") PROPERTY_LOOKUP,
+ @MessageId("001003") PROPERTY_RESOLVED;
}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ServletMessage.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ServletMessage.java 2010-01-08
13:59:36 UTC (rev 5398)
+++
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ServletMessage.java 2010-01-08
14:20:58 UTC (rev 5399)
@@ -25,6 +25,8 @@
@MessageId("000704") BEAN_DEPLOYMENT_ARCHIVE_MISSING,
@MessageId("000705") BEAN_MANAGER_FOR_ARCHIVE_NOT_FOUND,
@MessageId("000706") ILLEGAL_USE_OF_WELD_LISTENER,
- @MessageId("000707") ONLY_HTTP_SERVLET_LIFECYCLE_DEFINED;
+ @MessageId("000707") ONLY_HTTP_SERVLET_LIFECYCLE_DEFINED,
+ @MessageId("000708") REQUEST_INITIALIZED,
+ @MessageId("000709") REQUEST_DESTROYED;
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/servlet/WeldListener.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/servlet/WeldListener.java 2010-01-08
13:59:36 UTC (rev 5398)
+++ core/trunk/impl/src/main/java/org/jboss/weld/servlet/WeldListener.java 2010-01-08
14:20:58 UTC (rev 5399)
@@ -29,6 +29,8 @@
import static
org.jboss.weld.logging.messages.ServletMessage.ILLEGAL_USE_OF_WELD_LISTENER;
import static org.jboss.weld.logging.messages.ServletMessage.NOT_STARTING;
import static
org.jboss.weld.logging.messages.ServletMessage.ONLY_HTTP_SERVLET_LIFECYCLE_DEFINED;
+import static org.jboss.weld.logging.messages.ServletMessage.REQUEST_DESTROYED;
+import static org.jboss.weld.logging.messages.ServletMessage.REQUEST_INITIALIZED;
import javax.enterprise.inject.spi.BeanManager;
import javax.servlet.ServletContext;
@@ -148,6 +150,7 @@
@Override
public void requestDestroyed(ServletRequestEvent event)
{
+ log.trace(REQUEST_DESTROYED, event.getServletRequest());
// JBoss AS will still start the deployment even if WB fails
if (Container.available())
{
@@ -170,6 +173,7 @@
@Override
public void requestInitialized(ServletRequestEvent event)
{
+ log.trace(REQUEST_INITIALIZED, event.getServletRequest());
// JBoss AS will still start the deployment even if WB fails
if (Container.available())
{
Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/el_en.properties
===================================================================
--- core/trunk/impl/src/main/resources/org/jboss/weld/messages/el_en.properties 2010-01-08
13:59:36 UTC (rev 5398)
+++ core/trunk/impl/src/main/resources/org/jboss/weld/messages/el_en.properties 2010-01-08
14:20:58 UTC (rev 5399)
@@ -1,2 +1,4 @@
RESOLUTION_ERROR=Error resolving property {0} against base {1}
NULL_EXPRESSION_FACTORY=Cannot pass null expressionFactory
+PROPERTY_LOOKUP=Looking for EL property {0}
+PROPERTY_RESOLVED=EL property {0} resolved to {1}
Modified:
core/trunk/impl/src/main/resources/org/jboss/weld/messages/servlet_en.properties
===================================================================
---
core/trunk/impl/src/main/resources/org/jboss/weld/messages/servlet_en.properties 2010-01-08
13:59:36 UTC (rev 5398)
+++
core/trunk/impl/src/main/resources/org/jboss/weld/messages/servlet_en.properties 2010-01-08
14:20:58 UTC (rev 5399)
@@ -6,3 +6,5 @@
BEAN_MANAGER_FOR_ARCHIVE_NOT_FOUND=Unable to locate bean manager for {0} in {1}
ILLEGAL_USE_OF_WELD_LISTENER=Cannot use WeldListener without ServletServices
ONLY_HTTP_SERVLET_LIFECYCLE_DEFINED=Non Http-Servlet lifecycle not defined
+REQUEST_INITIALIZED=Initializing request {0}
+REQUEST_DESTROYED=Destroying request {0}