Author: pete.muir(a)jboss.org
Date: 2010-01-26 18:36:10 -0500 (Tue, 26 Jan 2010)
New Revision: 5636
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractContainerEvent.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDefinitionContainerEvent.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDeploymentContainerEvent.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeShutdownImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java
Log:
WELD-402
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractContainerEvent.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractContainerEvent.java 2010-01-26
18:49:28 UTC (rev 5635)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractContainerEvent.java 2010-01-26
23:36:10 UTC (rev 5636)
@@ -27,7 +27,6 @@
import org.jboss.weld.bootstrap.BeanDeployment;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.weld.exceptions.DeploymentException;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.reflection.ParameterizedTypeImpl;
@@ -93,10 +92,6 @@
{
getErrors().add(e);
}
- if (!getErrors().isEmpty())
- {
- throw new DeploymentException(getErrors());
- }
}
protected Type getRawType()
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDefinitionContainerEvent.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDefinitionContainerEvent.java 2010-01-26
18:49:28 UTC (rev 5635)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDefinitionContainerEvent.java 2010-01-26
23:36:10 UTC (rev 5636)
@@ -17,7 +17,10 @@
package org.jboss.weld.bootstrap.events;
import java.lang.reflect.Type;
+import java.util.Map;
+import org.jboss.weld.bootstrap.BeanDeployment;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.manager.BeanManagerImpl;
@@ -43,4 +46,14 @@
}
}
+ @Override
+ protected void fire(Map<BeanDeploymentArchive, BeanDeployment> beanDeployments)
+ {
+ super.fire(beanDeployments);
+ if (!getErrors().isEmpty())
+ {
+ throw new DefinitionException(getErrors());
+ }
+ }
+
}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDeploymentContainerEvent.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDeploymentContainerEvent.java 2010-01-26
18:49:28 UTC (rev 5635)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDeploymentContainerEvent.java 2010-01-26
23:36:10 UTC (rev 5636)
@@ -17,7 +17,10 @@
package org.jboss.weld.bootstrap.events;
import java.lang.reflect.Type;
+import java.util.Map;
+import org.jboss.weld.bootstrap.BeanDeployment;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.exceptions.DeploymentException;
import org.jboss.weld.manager.BeanManagerImpl;
@@ -43,4 +46,14 @@
}
}
+ @Override
+ protected void fire(Map<BeanDeploymentArchive, BeanDeployment> beanDeployments)
+ {
+ super.fire(beanDeployments);
+ if (!getErrors().isEmpty())
+ {
+ throw new DeploymentException(getErrors());
+ }
+ }
+
}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeShutdownImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeShutdownImpl.java 2010-01-26
18:49:28 UTC (rev 5635)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeShutdownImpl.java 2010-01-26
23:36:10 UTC (rev 5636)
@@ -16,6 +16,8 @@
*/
package org.jboss.weld.bootstrap.events;
+import static org.jboss.weld.logging.Category.BOOTSTRAP;
+import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
import static org.jboss.weld.util.reflection.Reflections.EMPTY_TYPES;
import java.util.Map;
@@ -25,6 +27,8 @@
import org.jboss.weld.bootstrap.BeanDeployment;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.manager.BeanManagerImpl;
+import org.slf4j.Logger;
+import org.slf4j.ext.XLogger;
/**
* @author pmuir
@@ -33,6 +37,9 @@
public class BeforeShutdownImpl extends AbstractContainerEvent implements BeforeShutdown
{
+ private static final XLogger xLog = loggerFactory().getXLogger(BOOTSTRAP);
+ private static final Logger log = loggerFactory().getLogger(BOOTSTRAP);
+
public static void fire(BeanManagerImpl beanManager, Map<BeanDeploymentArchive,
BeanDeployment> beanDeployments)
{
if (beanDeployments == null)
@@ -50,5 +57,19 @@
{
super(beanManager, BeforeShutdown.class, EMPTY_TYPES);
}
+
+ @Override
+ protected void fire(Map<BeanDeploymentArchive, BeanDeployment> beanDeployments)
+ {
+ super.fire(beanDeployments);
+ if (!getErrors().isEmpty())
+ {
+ log.error("Exception(s) thrown during observer of BeforeShutdown");
+ for (Throwable t: getErrors())
+ {
+ log.error("", t);
+ }
+ }
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java 2010-01-26
18:49:28 UTC (rev 5635)
+++ core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java 2010-01-26
23:36:10 UTC (rev 5636)
@@ -243,15 +243,15 @@
protected boolean ignore(T event)
{
Class<?> eventType = event.getClass();
- if (AbstractContainerEvent.class.isAssignableFrom(eventType))
+ // This is a container lifeycle event, ensure we are firing to an extension
+ if (AbstractContainerEvent.class.isAssignableFrom(eventType) &&
!Extension.class.isAssignableFrom(getBeanClass()))
{
- // This is a container lifeycle event, ensure we are firing to an extension
- if (!Extension.class.isAssignableFrom(getBeanClass()))
- {
- return true;
- }
+ return true;
}
- return false;
+ else
+ {
+ return false;
+ }
}
@Override
Show replies by date