Author: lincolnthree
Date: 2010-09-14 09:11:13 -0400 (Tue, 14 Sep 2010)
New Revision: 13750
Modified:
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/event/AbstractServletEventBridge.java
modules/servlet/trunk/pom.xml
Log:
Downgraded weldx version for compatibility with Faces - eventually this needs to be
re-upgraded, but there are blocking API differences.
Modified:
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/event/AbstractServletEventBridge.java
===================================================================
---
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/event/AbstractServletEventBridge.java 2010-09-14
11:43:07 UTC (rev 13749)
+++
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/event/AbstractServletEventBridge.java 2010-09-14
13:11:13 UTC (rev 13750)
@@ -3,6 +3,8 @@
import java.lang.annotation.Annotation;
import java.util.Arrays;
+import javax.enterprise.inject.spi.BeanManager;
+
import org.jboss.weld.extensions.beanManager.BeanManagerAware;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -14,19 +16,30 @@
protected void fireEvent(final Object payload, final Annotation... qualifiers)
{
- if (isBeanManagerAvailable())
+ // TODO - this should probably be replaced with an isBeanManagerAvailable()
method.
+ BeanManager beanManager;
+ try
{
+ beanManager = getBeanManager();
+ }
+ catch (Exception e)
+ {
+ beanManager = null;
+ }
+
+ if (beanManager != null)
+ {
/*
- * We can't always guarantee the BeanManager will be available,
- * especially in environemnts where we don't control bootstrap order
- * that well (e.g. Servlet containers)
+ * We can't always guarantee the BeanManager will be available, especially
in environments where we don't
+ * control bootstrap order that well (e.g. Servlet containers)
*/
log.trace("Firing event #0 with qualifiers #1", payload,
Arrays.asList(qualifiers));
- getBeanManager().fireEvent(payload, qualifiers);
+ beanManager.fireEvent(payload, qualifiers);
}
else
{
- log.debug("BeanManager can't be found so not sending event " +
payload + " with qualifiers " + Arrays.asList(qualifiers));
+ log.debug("BeanManager can't be found so not sending event " +
payload + " with qualifiers "
+ + Arrays.asList(qualifiers));
}
}
Modified: modules/servlet/trunk/pom.xml
===================================================================
--- modules/servlet/trunk/pom.xml 2010-09-14 11:43:07 UTC (rev 13749)
+++ modules/servlet/trunk/pom.xml 2010-09-14 13:11:13 UTC (rev 13750)
@@ -57,7 +57,7 @@
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-extensions</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0.Alpha2</version>
</dependency>
</dependencies>