tag:blogger.com,1999:blog-8492059842142356488.post7201317147993501203..comments2023-09-23T16:46:57.616+02:00Comments on Thoughts on software development: Event-based communication in JSF. New-school approach.Oleg Varaksinhttp://www.blogger.com/profile/13872270134068047346noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-8492059842142356488.post-86105568336231762922015-02-26T10:33:02.669+01:002015-02-26T10:33:02.669+01:00I am trying to integrate CDI event on Spring / JSF...I am trying to integrate CDI event on Spring / JSF application with cdisource api to link CDI beans and Spring bean. The integration is not trivial. There are many errors that i cannot detail here. Now i am going to integrate Guava in place of CDI event.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-82729551997118221442015-02-26T10:29:49.668+01:002015-02-26T10:29:49.668+01:00I'm trying to integrate CDI event on spring /J...I'm trying to integrate CDI event on spring /JSF application with cdisource api to make the link between CDI and spring bean... The integration is not trivial... there are many differents errors that i cannot detail here. Now i am going to integrate guada in place of CDI event.jperfhttps://www.blogger.com/profile/18105249827227703375noreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-1442216292040133332014-04-23T16:01:24.131+02:002014-04-23T16:01:24.131+02:00EventBus doesn't implement Serializable, there...EventBus doesn't implement Serializable, therefore you'll get a NotSerializableException if you try to serialize the EventBusProvider classAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-86417088365187314892012-08-07T09:49:50.583+02:002012-08-07T09:49:50.583+02:00I use CODI and know about DeltaSpike. But as I sai...I use CODI and know about DeltaSpike. But as I said here http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1087, CODI's @ViewScoped has a small issue with Weld and @Inject in a super class. Actually Weld issue, I think not a CODI one because it works with OpenWebBeans.Oleg Varaksinhttps://www.blogger.com/profile/13872270134068047346noreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-88463286428548090412012-08-07T07:57:15.678+02:002012-08-07T07:57:15.678+02:00You can convert @ViewScoped JSF scope to CDI by us...You can convert @ViewScoped JSF scope to CDI by using CODI. There are a lot of other goodies in CODI as well.<br />At this moment, CODI is merged with Seam 3 into DeltaSpike. So we will have one great CDI extension library with everything we need.Rudyhttps://www.blogger.com/profile/02063576761910580068noreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-17427533203366860242012-08-02T21:27:26.350+02:002012-08-02T21:27:26.350+02:00Hi Arjan. Do you read my thoughts :-) You will not...Hi Arjan. Do you read my thoughts :-) You will not believe, but I voted for this issue today. After your post I've also commented one thing what makes me headache currently. Maybe we should really think about an external small project with a clean CDI impl. for the view scope? What do you think?<br /><br />And yes, I agree totally - The omission of @ViewScoped in CDI is indeed severe!!Oleg Varaksinhttps://www.blogger.com/profile/13872270134068047346noreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-20212840113709451812012-08-02T20:49:22.126+02:002012-08-02T20:49:22.126+02:00As usual, great article Oleg! :)
The omission of ...As usual, great article Oleg! :)<br /><br />The omission of @ViewScoped in CDI is indeed severe. Or more technically; JSF 2 not providing a CDI compatible @ViewScoped is severe. CDI should not have knowledge about JSF, but JSF definitely should know about CDI.<br /><br />For Java EE 6, the popular explanation is that CDI was really late to the game and the other specs (like JSF and JAX-RS) had already finished and could thus not include CDI dependencies.<br /><br />JSF 2.2 however already has a CDI dependency for the new @FlowScoped, so it should absolutely be possible now to add this. I proposed to add this feature here: http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1087 If you or anyone else thinks this is important too, please vote for it or participate in the discussion.Arjan Tijmshttps://www.blogger.com/profile/08548593340781885396noreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-57946905981497018612012-07-29T11:00:21.651+02:002012-07-29T11:00:21.651+02:00Myfaces CODI @ViewAccessScoped != JSF @ViewScoped....Myfaces CODI @ViewAccessScoped != JSF @ViewScoped. @ViewAccessScoped is broader, you can use it across pages when a ViewAccessScoped bean is accessed across several pages. But if not, it's the same.Oleg Varaksinhttps://www.blogger.com/profile/13872270134068047346noreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-55322768522524837102012-07-29T10:19:53.124+02:002012-07-29T10:19:53.124+02:00@Arturo SerranoJuly, Consider that CDI does not wo...@Arturo SerranoJuly, Consider that CDI does not work with @ViewScoped, if you want to have an equivalent scope use Myfaces CODI @ViewAccessScoped or Seam3-faces module.Heidarzadehhttps://www.blogger.com/profile/16276389986655915283noreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-3659559530876233192012-07-23T15:24:44.873+02:002012-07-23T15:24:44.873+02:00yes, it should be view scoped to avoid troublesyes, it should be view scoped to avoid troublesOleg Varaksinhttps://www.blogger.com/profile/13872270134068047346noreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-39777503945827901972012-07-23T15:23:22.168+02:002012-07-23T15:23:22.168+02:00Thanks for the response. Then I will try the Guava...Thanks for the response. Then I will try the Guava event bus.<br /><br />So given your explanation, if I want to communicate view scoped jsf beans, the "EventBusProvider" should be view scoped too, right?Arturo Serranohttps://www.blogger.com/profile/00296148959479664703noreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-37717466161311199392012-07-23T14:51:43.063+02:002012-07-23T14:51:43.063+02:00I think this is by reason of @Dependent scope. CDI...I think this is by reason of @Dependent scope. CDI events can't be used with @Dependent according to the specification.<br /><br />I didn't test CDI events with non CDI scoped beans. I think it will not work because CDI container (and not JSF) should manage beans with annotated methods (@Observes, etc.).Oleg Varaksinhttps://www.blogger.com/profile/13872270134068047346noreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-14389381669087054372012-07-23T14:46:53.632+02:002012-07-23T14:46:53.632+02:00Nice article!
I like a lot the CDI approach, howe...Nice article!<br /><br />I like a lot the CDI approach, however I have a problem: I want to use it to communicate two View-scoped JSF managed beans (both the observer and the producer), but when I deploy the app I got an exception:<br /> <br />WELD-000404 Conditional observer method [[method] public cups.view.controllers.NewColoniaDialog.onDialogRequest(Colonia)] cannot be declared by a @Dependent scoped bean<br /><br />Have you tried this scenario? Or CDI events can only be used with CDI scoped beans?<br />ThanksArturo Serranohttps://www.blogger.com/profile/00296148959479664703noreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-45968825923392307532012-07-23T09:50:25.201+02:002012-07-23T09:50:25.201+02:00Heidarzadeh, thanks for your reply and reading my ...Heidarzadeh, thanks for your reply and reading my posts. Yes, Guava EventBus is not bad, especially for Java desktop clients. CDI is the best in my opinion. I've tested it, it works smoothly and leaves nothing to be desired. Now, I have to port my web apps to CDI completely and remove old manual event listeners registrations :-).Oleg Varaksinhttps://www.blogger.com/profile/13872270134068047346noreply@blogger.comtag:blogger.com,1999:blog-8492059842142356488.post-73717529009007053702012-07-22T21:47:48.328+02:002012-07-22T21:47:48.328+02:00Excellent post Oleg!
When I was reading first para...Excellent post Oleg!<br />When I was reading first paragraph of your old-school pattern post, I was thinking about CDI Event/Observer pattern that can fill best for this gap. and in this post you covered it as the best solution ;)<br />in fact, I think CDI is the best DI container to develop applications. it's easy to learn and makes developers life much better.<br />Guava event bus is good too and I was reading about that for the first time!<br />Continue writing such great stuff!Heidarzadehhttps://www.blogger.com/profile/16276389986655915283noreply@blogger.com