This content has been marked as final.
Show 4 replies
-
1. Re: Events on Tomcat
gavin.king Oct 21, 2009 3:12 PM (in response to fabiowg)Sounds like a possible bug to me. Are you sure that @Special is annotated @Qualifier, and that SpecialQualifier implements Special?
If so, please submit this test code to JIRA,
Why are you using BeanManager directly, instead of @Inject Event<Object> objectEvent?
-
2. Re: Events on Tomcat
fabiowg Oct 21, 2009 7:51 PM (in response to fabiowg)Why are you using BeanManager directly, instead of @Inject Event<Object> objectEvent?
Well, I'm just testing the weld features, and I was trying something similar to the first example of the PFD2:
public void login() { final User user = ...; manager.fireEvent( new LoggedInEvent(user), new RoleQualifier() { public String value() { return user.getRole(); } ); }
However, trying what you've said:
@Inject Event<Object> objectEvent; public void mantain() { objectEvent.select(new SpecialQualifier() {}).fire(new Object()); }
And it does work! Is this something that should be corrected in the documentation, though?
-
3. Re: Events on Tomcat
fabiowg Oct 21, 2009 8:09 PM (in response to fabiowg)(Hehe, just tried this:
manager.fireEvent(new Object(), new DefaultLiteral(), new SpecialQualifier() {});
and it works too :-D)
-
4. Re: Events on Tomcat
gavin.king Oct 22, 2009 2:35 AM (in response to fabiowg)Well, that definitely looks like a bug. @Default has nothing to do with observer methods. Please report this in JIRA. Thanks.