Author: dan.j.allen
Date: 2009-06-19 00:36:43 -0400 (Fri, 19 Jun 2009)
New Revision: 2855
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterDeploymentValidationImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
Log:
queue definition and deployment errors and throw after observers have been notified
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java 2009-06-19
03:46:23 UTC (rev 2854)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java 2009-06-19
04:36:43 UTC (rev 2855)
@@ -1,16 +1,22 @@
package org.jboss.webbeans.bootstrap;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import org.jboss.webbeans.DefinitionException;
-
public class AfterBeanDiscoveryImpl implements AfterBeanDiscovery
{
+ private List<Throwable> definitionErrors = new ArrayList<Throwable>();
+
public void addDefinitionError(Throwable t)
{
- //XXX spec says need to delay abort until all observers
- //have been notified
- throw new DefinitionException(t);
+ definitionErrors.add(t);
}
+
+ public List<Throwable> getDefinitionErrors()
+ {
+ return definitionErrors;
+ }
}
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterDeploymentValidationImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterDeploymentValidationImpl.java 2009-06-19
03:46:23 UTC (rev 2854)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterDeploymentValidationImpl.java 2009-06-19
04:36:43 UTC (rev 2855)
@@ -1,16 +1,21 @@
package org.jboss.webbeans.bootstrap;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.enterprise.inject.spi.AfterDeploymentValidation;
-import org.jboss.webbeans.DeploymentException;
-
public class AfterDeploymentValidationImpl implements AfterDeploymentValidation
{
+ private List<Throwable> deploymentProblems = new ArrayList<Throwable>();
+
public void addDeploymentProblem(Throwable t)
{
- //XXX spec says need to delay abort until all observers
- //have been notified
- throw new DeploymentException(t);
+ deploymentProblems.add(t);
}
+ public List<Throwable> getDeploymentProblems()
+ {
+ return deploymentProblems;
+ }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-06-19
03:46:23 UTC (rev 2854)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-06-19
04:36:43 UTC (rev 2855)
@@ -240,7 +240,11 @@
throw new DefinitionException(e);
}
- // TODO handle registered definition errors
+ if (event.getDefinitionErrors().size() > 0)
+ {
+ // FIXME communicate all the captured definition errors in this exception
+ throw new DefinitionException(event.getDefinitionErrors().get(0));
+ }
}
protected void fireAfterDeploymentValidationEvent()
@@ -256,7 +260,11 @@
throw new DeploymentException(e);
}
- // TODO handle registered deployment errors
+ if (event.getDeploymentProblems().size() > 0)
+ {
+ // FIXME communicate all the captured deployment problems in this exception
+ throw new DeploymentException(event.getDeploymentProblems().get(0));
+ }
}
/**
Show replies by date