2011-08-03 Meeting
by Jason Porter
Agenda
- Action Item Follow up (5 minutes)
- Seam Render (George 15 minutes)
- Module report (quick "Where are you, How close to a next release
(alpha/beta/cr/final) is your module, What's blocking you?" 15 minutes)
I don't have a lot to discuss, but I'm hoping there are some good things
that come from the last topic and things we can do to help move modules
along.
--
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp
Software Engineer
Open Source Advocate
Author of Seam Catch - Next Generation Java Exception Handling
PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu
13 years, 3 months
Introducing Hanneli Tavante
by Jason Porter
Everyone, I'd like to introduce you all to Hanneli Tavante. She's been
following us on twitter for awhile. She's an avid Seam 3 user and advocate
down in Brazil (yep, we keep getting more people interested down there :) ).
She's also expressed some interest in helping us with some documentation and
examples / tutorials! so when you get some documentation pull requests
you'll know who they're from! Thank you Hanneli for helping us out!
--
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp
Software Engineer
Open Source Advocate
Author of Seam Catch - Next Generation Java Exception Handling
PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu
13 years, 3 months
Postconstruct issue when registering a Bean in an extension
by Antoine Sabot-Durand
Hi All,
In Seam Social, in order to support polymorphism I need the service beans to be qualified with the name of the service. For instance :
@RelatedTo("LinkedIn")
public class LinkedInJackson extends OAuthServiceBase implements LinkedIn
It allows users to inject a service bean like that
@Inject @RelatedTo("LinkedIn")
OAuthService service;
As I want to ease user life I also need to support this kind of injection (same results as above)
@Inject
LinkedIn service;
As LinkedIn interface has only one implementation, using a qualifier when I use its specific type is useless and could be confusing.
Until now I registered the second version of the bean (without a qualifier) thru a producer, but as each service bean will have both registration (with and without qualifier) I decided to simplify this bi-registration with an extension (it will also ease the writing of new service bean for third party developers).
My extension works in 2 steps :
First it collects in a Map all the annotated type which are OAuthService children and have a @RelatedTo qualifier :
public void processServicesBeans(@Observes ProcessManagedBean<OAuthService> pbean) {
Annotated annotated = pbean.getAnnotated();
if (annotated.isAnnotationPresent(RelatedTo.class)) {
RelatedTo related = annotated.getAnnotation(RelatedTo.class);
String name = related.value();
servicesBean.put(name, pbean.getAnnotatedBeanClass());
}
}
Then, after the bean discovery, it register a new version of each Qualified bean without the qualifier (thanks to solder !).
public void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager bm) {
for (String type : servicesBean.keySet()) {
AnnotatedType<? extends OAuthService> annotatedType = servicesBean.get(type);
AnnotatedTypeBuilder annoBuilder = new AnnotatedTypeBuilder().readFromType(annotatedType).removeFromClass(
RelatedTo.class);
AnnotatedType myAnnotatedType = annoBuilder.create();
BeanBuilder beanBuilder = new BeanBuilder(bm).readFromType(myAnnotatedType);
abd.addBean(beanBuilder.create());
}
}
This seems to work quite well except that my service Beans have a @Postconstruct method and at initialization Weld throws the following exception
org.jboss.weld.exceptions.DefinitionException: WELD-000805 Cannot have more than one post construct method annotated with @PostConstruct for public class org.jboss.seam.social.linkedin.LinkedInJackson
If I remove the @Postconstuct in the AnnotatedTypeBuilder by changing its declaration by :
AnnotatedTypeBuilder annoBuilder = new AnnotatedTypeBuilder().readFromType(annotatedType).removeFromClass(
RelatedTo.class).removeFromAll(PostConstruct.class);
Initialization works, I have my 2 beans, but the one I registered without qualifier won't execute the @PostConstruct method (since I had to remove it). I guess I'm missing something in the CDI meta-meta-maze :-). Any help or suggestion would be nice.
Thanks,
Antoine SABOT-DURAND
13 years, 3 months
Possible IRC Meeting topic
by George Gastaldi
Hello,
There was some discussion on IRC if Seam Render should be merged into
Seam Reports as they look very much alike.
Is this supposed to happen ? Or they are unrelated projects ?
I started an implementation of MVEL for Seam Reports in my branch so
that the funcionality of Seam Render would be the same as Seam
Reports.
Thoughs anyone ?
Regards,
George Gastaldi
13 years, 3 months