-
1. Re: communication between Seam web apps (single EAR)
tom_goring Apr 23, 2008 11:32 PM (in response to kapitanpetko)sounds to me they should be one app.....
-
2. Re: communication between Seam web apps (single EAR)
kapitanpetko Apr 24, 2008 7:24 AM (in response to kapitanpetko)
Tom Goring wrote on Apr 23, 2008 11:32 PM:
sounds to me they should be one app.....They used to be :) However, both apps needs independent session/auth management:
- for app1, session timeout should be one-two days. Authentication is simple: store client ID in session; control access with a filter. (no views, hence no need for pages.xml, etc.)
- for app2 (administration app), session timeout should be 10-20 minutes. Lots of views, role-based access control, uses Seam for authentication/authorization.
-
3. Re: communication between Seam web apps (single EAR)
tom_goring Apr 24, 2008 11:03 AM (in response to kapitanpetko)For the changes to your user name and password these will be picked up as the database and your entity EJB's would be shared.
My understanding is that all the seam context's are managed in the scope of the WAR so you won't be able to share them. You'd have to put your own thing together to handle that....
-
4. Re: communication between Seam web apps (single EAR)
kapitanpetko Apr 25, 2008 4:30 AM (in response to kapitanpetko)
Tom Goring wrote on Apr 24, 2008 11:03 AM:
For the changes to your user name and password these will be picked up as the database and your entity EJB's would be shared.Yes, that's what I have now. I have a couple of stateless beans at application scope to handle authentication and such. Those are used form both web apps.
My understanding is that all the seam context's are managed in the scope of the WAR so you won't be able to share them. You'd have to put your own thing together to handle that....That's what I was afraid of :) Thanks for the confirmation. I guess it will have to wait till the next release...
-
5. Re: communication between Seam web apps (single EAR)
dhlbrk Apr 25, 2008 6:28 AM (in response to kapitanpetko)I'm pretty sure you can do what you want with JMS.
The documentation is a bit sparse, but it says it can be done:
Reference Doc: Messaging in Seam
On the invalidating web app you would publish to a topic a message about ending all sessions for a user.
On the other web app you would have a Message Driven Bean that was also a Seam component, the Message Driven Beam could then invalidate the session (or raise a seam event for some other component to take care of the invalidation)
There are other ways: timer service that polls the db, web service that calls an invalidate method, you could probably hack something together with a shared cache and a filter. I think JMS is the cleanest.
-
6. Re: communication between Seam web apps (single EAR)
kapitanpetko May 23, 2008 8:17 PM (in response to kapitanpetko)I didn't want to get JMS in the mix, but that's what I eventually did. It turned out there are other cases where I need one webapp to notify the other, so it was worth the effort.
Here's what I have:
- a notifcation Queue
- a listener component (a POJO thath implements MessageListener; not an MDB, since it needs to live in the webapp)
- a startup component that is called after Seam initializations (via an Observer)
- an HttpAttributeListener that stores sessions of interests in a Map
The startup component registers the listener for the Queue (webapp2) and onMessages (sent from webapp1) it searches for the relevant HttpSession and invalidates it.
Now I just have to make sure no one else can send messages to that Queue...