You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ovidiu Hurducas <ov...@gmail.com> on 2009/01/08 13:29:50 UTC

[T5] How to get a list of the current instances of an ASO?

Greetings!

I want to access the list of currently logged in users in my application and
display it (along with user name, log in time, etc).
The user at log in time initialize an ASO and stores all the required data
in it.

There is a way to access all those ASOs for all the users that exists at a
time in the application?

Thank you!

Re: [T5] How to get a list of the current instances of an ASO?

Posted by Ovidiu Hurducas <ov...@gmail.com>.
Thanks!
I was thinking on a list too. Because the application runs in a clustered
environment this list must be sync-ed on all nodes. I think I will try to
use this with a caching technique like JBoss cache.

I was lazy and I thought there is a ready made tapestrish solution for this
:)


On Thu, Jan 8, 2009 at 3:22 PM, Ulrich Stärk <ul...@spielviel.de> wrote:

> Ovidiu Hurducas schrieb:
>
>  Greetings!
>>
>> I want to access the list of currently logged in users in my application
>> and
>> display it (along with user name, log in time, etc).
>> The user at log in time initialize an ASO and stores all the required data
>> in it.
>>
>> There is a way to access all those ASOs for all the users that exists at a
>> time in the application?
>>
>> Thank you!
>>
>>
> I don't think that this is possible as the ASO is per-thread and stored in
> the user's session.
> Two approaches to solve your problem come to my mind. The first is to write
> a HttpSessionListener and listen to session creation and destruction and
> update some kind of internal list of sessions. But this is outside of
> tapestry's control and integration with your app might be difficult (you'd
> have to store this list in the servlet context or do some other tricks).
> Also, this is a list of sessions and not a list of logged in users. You'd
> have to extract that information from the sessions.
> The second approach would be to administer a list of logged in users inside
> a singleton tapestry service. You could tell that service that a user logged
> in from inside your login logic. You'd have to think about the logout
> though. Not every user will use a logout functionality but merely will let
> his session expire.
>
> Uli
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: [T5] How to get a list of the current instances of an ASO?

Posted by Ulrich Stärk <ul...@spielviel.de>.
Ovidiu Hurducas schrieb:
> Greetings!
> 
> I want to access the list of currently logged in users in my application and
> display it (along with user name, log in time, etc).
> The user at log in time initialize an ASO and stores all the required data
> in it.
> 
> There is a way to access all those ASOs for all the users that exists at a
> time in the application?
> 
> Thank you!
> 

I don't think that this is possible as the ASO is per-thread and stored 
in the user's session.
Two approaches to solve your problem come to my mind. The first is to 
write a HttpSessionListener and listen to session creation and 
destruction and update some kind of internal list of sessions. But this 
is outside of tapestry's control and integration with your app might be 
difficult (you'd have to store this list in the servlet context or do 
some other tricks). Also, this is a list of sessions and not a list of 
logged in users. You'd have to extract that information from the sessions.
The second approach would be to administer a list of logged in users 
inside a singleton tapestry service. You could tell that service that a 
user logged in from inside your login logic. You'd have to think about 
the logout though. Not every user will use a logout functionality but 
merely will let his session expire.

Uli

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org