Author: pete.muir(a)jboss.org
Date: 2009-10-09 11:14:14 -0400 (Fri, 09 Oct 2009)
New Revision: 3912
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/javax.enterprise.inject.spi.Extension
Removed:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/DogBone.java
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeEventThrowsExceptionTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeObserver.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/Dog.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/InjectionTargetProcessor.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/ProcessInjectionTargetEventThrowsExceptionTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/broken/injectionTargetError/EventProcessor.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/broken/injectionTargetError/InjectionTargetDefinitionErrorTest.java
core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java
Log:
Fix various tests
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeEventThrowsExceptionTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeEventThrowsExceptionTest.java 2009-10-09
14:52:45 UTC (rev 3911)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeEventThrowsExceptionTest.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -43,7 +43,7 @@
@SpecVersion(spec="cdi", version="PFD2")
public class ProcessAnnotatedTypeEventThrowsExceptionTest extends AbstractJSR299Test
{
- @Test(groups="ri-broken")
+ @Test(groups="jboss-as-broken")
@SpecAssertion(section = "11.5.5", id = "e")
public void testProcessAnnotatedTypeEventThrowsExceptionNotOk()
{
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeObserver.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeObserver.java 2009-10-09
14:52:45 UTC (rev 3911)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeObserver.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -6,7 +6,7 @@
public class ProcessAnnotatedTypeObserver implements Extension
{
- public void observeAnnotatedType1(@Observes ProcessAnnotatedType<Dog> event)
+ public void observeAnnotatedType(@Observes ProcessAnnotatedType<Dog> event)
{
throw new RuntimeException();
}
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/Dog.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/Dog.java 2009-10-09
14:52:45 UTC (rev 3911)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/Dog.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -1,9 +1,7 @@
package
org.jboss.jsr299.tck.tests.extensions.annotated.broken.processInjectionTargetThrowsException;
-import javax.inject.Inject;
class Dog
{
- @Inject
- private DogBone dogBone;
+
}
Deleted:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/DogBone.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/DogBone.java 2009-10-09
14:52:45 UTC (rev 3911)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/DogBone.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -1,6 +0,0 @@
-package
org.jboss.jsr299.tck.tests.extensions.annotated.broken.processInjectionTargetThrowsException;
-
-class DogBone
-{
-
-}
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/InjectionTargetProcessor.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/InjectionTargetProcessor.java 2009-10-09
14:52:45 UTC (rev 3911)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/InjectionTargetProcessor.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -4,10 +4,12 @@
import javax.enterprise.inject.spi.Extension;
import javax.enterprise.inject.spi.ProcessInjectionTarget;
-class InjectionTargetProcessor implements Extension
+public class InjectionTargetProcessor implements Extension
{
+
public void processDogInjectionTarget(@Observes ProcessInjectionTarget<Dog>
injectionTargetEvent)
{
throw new RuntimeException();
}
+
}
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/ProcessInjectionTargetEventThrowsExceptionTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/ProcessInjectionTargetEventThrowsExceptionTest.java 2009-10-09
14:52:45 UTC (rev 3911)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/ProcessInjectionTargetEventThrowsExceptionTest.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -24,6 +24,8 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
import org.testng.annotations.Test;
/**
@@ -34,11 +36,14 @@
*/
@Artifact
@ExpectedDeploymentException(DeploymentError.class)
+@Resources({
+ @Resource(source="javax.enterprise.inject.spi.Extension",
destination="WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
+})
@IntegrationTest
@SpecVersion(spec="cdi", version="PFD2")
public class ProcessInjectionTargetEventThrowsExceptionTest extends AbstractJSR299Test
{
- @Test(groups="ri-broken")
+ @Test(groups="jboss-as-broken")
@SpecAssertion(section = "11.5.6", id = "f")
public void testProcessInjectionTargetEventThrowsExceptionNotOk()
{
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java 2009-10-09
14:52:45 UTC (rev 3911)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -65,14 +65,14 @@
@SpecVersion(spec="cdi", version="PFD2")
public class BeanManagerTest extends AbstractJSR299Test
{
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertion(section = "11.3.6", id = "a")
- //WBRI-328
public void testGetPassivationCapableBeanById()
{
- Bean<?> bean = getCurrentManager().getBeans(Cat.class).iterator().next();
+ Bean<?> bean = getCurrentManager().getBeans(Cow.class).iterator().next();
assert PassivationCapable.class.isAssignableFrom(bean.getClass());
- Bean<?> passivatingBean =
getCurrentManager().getPassivationCapableBean(CatBean.bean.getId());
+ PassivationCapable passivationCapable = (PassivationCapable) bean;
+ Bean<?> passivatingBean =
getCurrentManager().getPassivationCapableBean(passivationCapable.getId());
assert bean == passivatingBean;
}
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.beanManager;
+
+public class Cow
+{
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/broken/injectionTargetError/EventProcessor.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/broken/injectionTargetError/EventProcessor.java 2009-10-09
14:52:45 UTC (rev 3911)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/broken/injectionTargetError/EventProcessor.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -4,7 +4,7 @@
import javax.enterprise.inject.spi.Extension;
import javax.enterprise.inject.spi.ProcessInjectionTarget;
-class EventProcessor implements Extension
+public class EventProcessor implements Extension
{
public void processDogInjectionTarget(@Observes ProcessInjectionTarget<Dog>
injectionTargetEvent)
{
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/broken/injectionTargetError/InjectionTargetDefinitionErrorTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/broken/injectionTargetError/InjectionTargetDefinitionErrorTest.java 2009-10-09
14:52:45 UTC (rev 3911)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/broken/injectionTargetError/InjectionTargetDefinitionErrorTest.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -29,7 +29,7 @@
public class InjectionTargetDefinitionErrorTest extends AbstractJSR299Test
{
- @Test(groups = "ri-broken")
+ @Test(groups = "jboss-as-broken")
@SpecAssertions({
@SpecAssertion(section = "11.5.6", id = "da")
})
Added:
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/javax.enterprise.inject.spi.Extension
===================================================================
---
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/javax.enterprise.inject.spi.Extension
(rev 0)
+++
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processInjectionTargetThrowsException/javax.enterprise.inject.spi.Extension 2009-10-09
15:14:14 UTC (rev 3912)
@@ -0,0 +1 @@
+org.jboss.jsr299.tck.tests.extensions.annotated.broken.processInjectionTargetThrowsException.InjectionTargetProcessor
\ No newline at end of file
Modified: core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java 2009-10-09 14:52:45
UTC (rev 3911)
+++ core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java 2009-10-09 15:14:14
UTC (rev 3912)
@@ -185,9 +185,6 @@
private transient final ClientProxyProvider clientProxyProvider;
// TODO review this structure
- private transient final Map<String, Bean<?>> passivationCapableBeans;
-
- // TODO review this structure
private transient final Map<EjbDescriptor<?>, SessionBean<?>>
enterpriseBeans;
// TODO This isn't right, specialization should follow accessibility rules, but I
think we can enforce these in resolve()
@@ -293,7 +290,6 @@
new CopyOnWriteArrayList<ObserverMethod<?,?>>(),
new CopyOnWriteArrayList<String>(),
new ConcurrentHashMap<EjbDescriptor<?>, SessionBean<?>>(),
- new ConcurrentHashMap<String, Bean<?>>(),
new ClientProxyProvider(),
contexts,
new CopyOnWriteArraySet<CurrentActivity>(),
@@ -322,7 +318,6 @@
new CopyOnWriteArrayList<ObserverMethod<?,?>>(),
new CopyOnWriteArrayList<String>(),
rootManager.getEnterpriseBeans(),
- new ConcurrentHashMap<String, Bean<?>>(),
rootManager.getClientProxyProvider(),
rootManager.getContexts(),
new CopyOnWriteArraySet<CurrentActivity>(),
@@ -358,8 +353,7 @@
parentManager.getInterceptors(),
registeredObservers,
namespaces,
- parentManager.getEnterpriseBeans(),
- parentManager.getPassivationCapableBeans(),
+ parentManager.getEnterpriseBeans(),
parentManager.getClientProxyProvider(),
parentManager.getContexts(),
parentManager.getCurrentActivities(),
@@ -386,7 +380,6 @@
List<ObserverMethod<?,?>> observers,
List<String> namespaces,
Map<EjbDescriptor<?>, SessionBean<?>> enterpriseBeans,
- Map<String, Bean<?>> riBeans,
ClientProxyProvider clientProxyProvider,
ListMultimap<Class<? extends Annotation>, Context> contexts,
Set<CurrentActivity> currentActivities,
@@ -403,7 +396,6 @@
this.decorators = decorators;
this.interceptors = interceptors;
this.enterpriseBeans = enterpriseBeans;
- this.passivationCapableBeans = riBeans;
this.clientProxyProvider = clientProxyProvider;
this.contexts = contexts;
this.currentActivities = currentActivities;
@@ -569,7 +561,7 @@
}
if (bean instanceof PassivationCapable)
{
- passivationCapableBeans.put(((PassivationCapable) bean).getId(), bean);
+
Container.instance().deploymentServices().get(ContextualStore.class).putIfAbsent(bean);
}
registerBeanNamespace(bean);
for (BeanManagerImpl childActivity : childActivities)
@@ -583,7 +575,7 @@
public void addDecorator(DecoratorImpl<?> bean)
{
decorators.add(bean);
- passivationCapableBeans.put(bean.getId(), bean);
+ getServices().get(ContextualStore.class).putIfAbsent(bean);
decoratorResolver.clear();
}
@@ -803,23 +795,6 @@
return createDynamicAccessibleIterable(Transform.BEAN);
}
- /**
- * Get all the spec defined beans, including interceptor beans and decorator
- * beans. This is behavior is different to getBeans() which returns only
- * resolvable beans.
- *
- * TODO Rename method, merge into whatever we use for passivation capable or
- * split out decorators
- *
- * WARNING, method will go away!
- *
- * @return
- */
- public Map<String, Bean<?>> getPassivationCapableBeans()
- {
- return Collections.unmodifiableMap(passivationCapableBeans);
- }
-
public void addContext(Context context)
{
contexts.put(context.getScope(), context);
@@ -1314,7 +1289,7 @@
public Bean<?> getPassivationCapableBean(String id)
{
- throw new UnsupportedOperationException("Not yet implemented");
+ return getServices().get(ContextualStore.class).<Bean<Object>,
Object>getContextual(id);
}
public Set<Annotation> getStereotypeDefinition(Class<? extends Annotation>
stereotype)
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2009-10-09
14:52:45 UTC (rev 3911)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -23,6 +23,7 @@
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
import javax.enterprise.inject.spi.ProcessInjectionTarget;
import javax.enterprise.inject.spi.ProcessManagedBean;
import javax.enterprise.inject.spi.ProcessObserverMethod;
@@ -47,6 +48,7 @@
import org.jboss.weld.bean.SessionBean;
import org.jboss.weld.bean.ee.EEResourceProducerField;
import org.jboss.weld.bean.ee.PersistenceContextProducerField;
+import org.jboss.weld.bootstrap.events.ProcessAnnotatedTypeImpl;
import org.jboss.weld.bootstrap.events.ProcessInjectionTargetImpl;
import org.jboss.weld.bootstrap.events.ProcessManagedBeanImpl;
import org.jboss.weld.bootstrap.events.ProcessObserverMethodImpl;
@@ -133,7 +135,7 @@
{
log.debug("Observer : " + observer);
observer.initialize();
- createAndFireProcessObserverMethodEvent(observer);
+ fireProcessObserverMethodEvent(observer);
manager.addObserver(observer);
}
@@ -223,6 +225,13 @@
}
}
+ protected <X> ProcessAnnotatedTypeImpl<X>
fireProcessAnnotatedTypeEvent(WeldClass<X> clazz)
+ {
+ ProcessAnnotatedTypeImpl<X> payload = new
ProcessAnnotatedTypeImpl<X>(clazz) {};
+ fireEvent(payload, ProcessAnnotatedType.class, clazz.getBaseType());
+ return payload;
+ }
+
private <X> void fireProcessManagedBeanEvent(ManagedBean<X> bean)
{
ProcessManagedBeanImpl<X> payload = new ProcessManagedBeanImpl<X>(bean)
{};
@@ -245,7 +254,7 @@
}
}
- private void fireEvent(Object payload, Type rawType, Type... actualTypeArguments)
+ protected void fireEvent(Object payload, Type rawType, Type... actualTypeArguments)
{
Type eventType = new ParameterizedTypeImpl(rawType, actualTypeArguments, null);
manager.fireEvent(eventType, payload);
@@ -273,7 +282,7 @@
getEnvironment().addObserver(observer);
}
- private <X, T> void
createAndFireProcessObserverMethodEvent(ObserverMethodImpl<X, T> observer)
+ private <X, T> void fireProcessObserverMethodEvent(ObserverMethodImpl<X,
T> observer)
{
ProcessObserverMethodImpl<X, T> payload = new ProcessObserverMethodImpl<X,
T>(observer.getMethod(), observer) {};
fireEvent(payload, ProcessObserverMethod.class,
observer.getMethod().getDeclaringType().getBaseType(), observer.getObservedType());
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java 2009-10-09
14:52:45 UTC (rev 3911)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -58,8 +58,7 @@
ClassTransformer classTransformer =
Container.instance().deploymentServices().get(ClassTransformer.class);
if (!clazz.isAnnotation() && !clazz.isEnum())
{
- ProcessAnnotatedTypeImpl<?> event = createProcessAnnotatedTypeEvent(clazz,
classTransformer);
- deploymentManager.fireEvent(event);
+ ProcessAnnotatedTypeImpl<?> event =
fireProcessAnnotatedTypeEvent(classTransformer.loadClass(clazz));
if (!event.isVeto())
{
if (event.getAnnotatedType() instanceof WeldClass<?>)
@@ -75,12 +74,6 @@
return this;
}
- private static <X> ProcessAnnotatedTypeImpl<X>
createProcessAnnotatedTypeEvent(Class<X> clazz, ClassTransformer classTransformer)
- {
- WeldClass<X> annotatedType = classTransformer.loadClass(clazz);
- return new ProcessAnnotatedTypeImpl<X>(annotatedType) {};
- }
-
// TODO Do we need to fire PAT for annotated types added via BBD? Probably not PLM.
public BeanDeployer addClass(AnnotatedType<?> clazz)
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java 2009-10-09
14:52:45 UTC (rev 3911)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java 2009-10-09
15:14:14 UTC (rev 3912)
@@ -130,6 +130,20 @@
public void deployBeans(Environment environment)
{
+ for (ExtensionBean bean : extensionBeanDeployerEnvironment.getBeans())
+ {
+ if
(deployment.loadBeanDeploymentArchive(bean.getBeanClass()).equals(beanDeploymentArchive))
+ {
+ beanDeployer.getManager().addBean(bean);
+ }
+ }
+ for (ObserverMethodImpl<?, ?> observerMethod :
extensionBeanDeployerEnvironment.getObservers())
+ {
+ if
(deployment.loadBeanDeploymentArchive(observerMethod.getBean().getBeanClass()).equals(beanDeploymentArchive))
+ {
+ beanDeployer.getManager().addObserver(observerMethod);
+ }
+ }
beanDeployer.addClasses(beanDeploymentArchive.getBeanClasses());
beanDeployer.getEnvironment().addBean(new ManagerBean(beanManager));
beanDeployer.getEnvironment().addBean(new InjectionPointBean(beanManager));
@@ -156,20 +170,6 @@
beanDeployer.getEnvironment().addBean(new DefaultValidatorBean(beanManager));
beanDeployer.getEnvironment().addBean(new
DefaultValidatorFactoryBean(beanManager));
}
- for (ExtensionBean bean : extensionBeanDeployerEnvironment.getBeans())
- {
- if
(deployment.loadBeanDeploymentArchive(bean.getBeanClass()).equals(beanDeploymentArchive))
- {
- beanDeployer.getManager().addBean(bean);
- }
- }
- for (ObserverMethodImpl<?, ?> observerMethod :
extensionBeanDeployerEnvironment.getObservers())
- {
- if
(deployment.loadBeanDeploymentArchive(observerMethod.getBean().getBeanClass()).equals(beanDeploymentArchive))
- {
- beanDeployer.getManager().addObserver(observerMethod);
- }
- }
beanDeployer.createBeans().deploy();
}