[webbeans-commits] Webbeans SVN: r2284 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: bootstrap and 1 other directory.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Tue Mar 31 05:40:48 EDT 2009
Author: danielc.roth
Date: 2009-03-31 05:40:48 -0400 (Tue, 31 Mar 2009)
New Revision: 2284
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
Log:
more fixes
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-03-31 09:40:24 UTC (rev 2283)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-03-31 09:40:48 UTC (rev 2284)
@@ -101,7 +101,7 @@
{
super.initialize(environment);
checkProducerMethod();
- // initDisposalMethod();
+ initDisposalMethod(environment);
initInjectionPoints();
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-03-31 09:40:24 UTC (rev 2283)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-03-31 09:40:48 UTC (rev 2284)
@@ -8,6 +8,7 @@
import javax.event.Observes;
import javax.inject.BindingType;
import javax.inject.DeploymentType;
+import javax.inject.Disposes;
import javax.inject.Initializer;
import javax.inject.Produces;
import javax.inject.Realizes;
@@ -126,8 +127,8 @@
private void checkDisposalMethods() {
Set<DisposalMethodBean<?>> all = new HashSet<DisposalMethodBean<?>>(beanDeployerEnvironment.getAllDisposalBeans());
- Set<DisposalMethodBean<?>> resolved = new HashSet<DisposalMethodBean<?>>(beanDeployerEnvironment.getResolvedDisposalBeans());
- if(resolved.containsAll(all)) {
+ Set<DisposalMethodBean<?>> resolved = new HashSet<DisposalMethodBean<?>>(beanDeployerEnvironment.getResolvedDisposalBeans());
+ if(all.size()>0 && !resolved.containsAll(all)) {
StringBuffer buff = new StringBuffer();
buff.append("The following Disposal methods where not resolved\n");
all.removeAll(resolved);
@@ -182,7 +183,13 @@
private void createDisposalMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
{
-
+ for (AnnotatedMethod<?> method : annotatedClass.getDeclaredMethodsWithAnnotatedParameters(Disposes.class))
+ {
+ DisposalMethodBean<?> disposalBean = DisposalMethodBean.of(manager, method, declaringBean);
+ beanDeployerEnvironment.addAllDisposalBean(disposalBean);
+ manager.getResolver().addInjectionPoints(disposalBean.getInjectionPoints());
+ manager.addBean(disposalBean);
+ }
}
private <T> void createProducerMethod(AbstractClassBean<?> declaringBean, AnnotatedMethod<T> annotatedMethod)
More information about the weld-commits
mailing list