You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Michael Gustav Simon <mg...@gmail.com> on 2006/01/24 19:55:07 UTC

Portlets and stateful protocol

Hallo j2-Users,
a portlet is presented in the vm once (singleton).
HTTP is stateless, singleton is a good idea, but ...
How do I can realize a portlet, if i need a stateful protocol like for a
chat?

mgsimon

Re: Portlets and stateful protocol

Posted by Michael Gustav Simon <mg...@gmail.com>.
aaron,
many thanks for this great hint!

Re: Portlets and stateful protocol

Posted by Aaron Evans <aa...@yahoo.ca>.
Michael Gustav Simon <mgsimon <at> gmail.com> writes:

> 
> Have anyone an ideo to get a portletinstance per user?
> 

Michael,
you *really* would not want this.  This approach would never scale and this is
exactly why there is only one portlet instance per VM (actually, this isn't 
quite correct, as you can configure multiple instances, but the point is that
it is not on a per-user basis).

However, there is the portlet session, and this is one-to-one with portlet users.

I think what you really want to do is create a singleton service that would 
manage the mapping of user sessions to "chat connections" or what ever.  The
portlet would then use this service to determine what traffic belongs to the 
logged in user.

Just remember to make your service thread-safe!

HTH,
aaron



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Portlets and stateful protocol

Posted by Michael Gustav Simon <mg...@gmail.com>.
Have anyone an ideo to get a portletinstance per user?

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Portlets and stateful protocol

Posted by Michael Gustav Simon <mg...@gmail.com>.
But if this portlet needs a peer to peer connection to the backend for this
service,
i have one portlet instance in the vm only?

Re: Portlets and stateful protocol

Posted by Philip Mark Donaghy <ph...@gmail.com>.
On 1/24/06, Michael Gustav Simon <mg...@gmail.com> wrote:
> Hallo j2-Users,
> a portlet is presented in the vm once (singleton).
> HTTP is stateless, singleton is a good idea, but ...
> How do I can realize a portlet, if i need a stateful protocol like for a
> chat?

Hi, I guess that you might need a good rich client library so that
your chat could be developed using AJAX. Where your browser requests
conversations from the server and the browser does not change pages.
This may work but chat usually uses a peer to peer mechanism.
Otherwise the Portlet itself is like a servlet. They are thread safe
if programmed correctly. As with servlets, portlets can maintain state
using session attributes.

>
> mgsimon
>
>


--
Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy/philip
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org