This content has been marked as final.
Show 1 reply
-
1. Re: Change the scope of beans coming from external archive
jharting May 30, 2011 10:22 AM (in response to gvagenas)How do you register the beans from the external archive? I believe that you implemented a portable extension with a similar method:
public void registerBeans(@Observes BeforeBeanDiscovery event, BeanManager manager)
{
event.addAnnotatedType(manager.createAnnotatedType(Foo.class));
...
}If so, you can easily implement a delegating implementation of the AnnotatedType interface which delegate every method call to the instance created by manager.createAnnotatedType(Foo.class) but will override the getAnnotation() and isAnnotationPresent() methods and return @ApplicationScoped instead of @Singleton.