-
1. Re: Calling Seam components from a desktop app
swd847 Aug 2, 2009 12:57 AM (in response to phantasmo)The easiest way would be to use web services.
If this is not an option what protocol did you have in mind?
-
2. Re: Calling Seam components from a desktop app
phantasmo Aug 2, 2009 3:17 AM (in response to phantasmo)At first, I thought it might be possible to call Seam components in the same way you call EJBs from Java SE (is that JRMP?), but I guess that's not an option.
It was a hypothetical question though, I haven't started implementing anything yet.
Thanks for the advice though :)
-
3. Re: Calling Seam components from a desktop app
swd847 Aug 2, 2009 4:23 AM (in response to phantasmo)There are other ways to do it, but web services are by far the easiest. You could for example use RMI but you have to start the seam app before making any calls, something like:
Lifecycle.beginCall(); MyComponent c = (MyComponent)Component.getInstance("myComponent"); c.doStuff(); Lifecycle.endCall();
Doing it like this means you wont have access to the session and conversation scopes (although you probably could if you wrote some kind of manager that uses mock HttpSession objects to provide the session scope).
-
4. Re: Calling Seam components from a desktop app
fernando_jmt Aug 2, 2009 3:35 PM (in response to phantasmo)I have a Seam application working with a dual interface, one web (non-EJB) and one desktop (lunched from JWS). What I would suggest you is to use the RESTful webservices support Seam has bundled, it made the things so easy, you can reuse your components, you can use the same authentication and authorization mechanisn, conversations, and so on.
You just have to decide how to preserve your http session in the client if your application is session aware. In my case I asked the user for a login (before entering the application), then I preserved the session and invoked the services in that way. BTW, RESTEasy has a wonderful and easy way to consume your webservices.
HTH.
-
5. Re: Calling Seam components from a desktop app
phantasmo Aug 2, 2009 6:06 PM (in response to phantasmo)Ok, thanks guys, you've been very helpful!