Loop through the Mbeans in Session Scope [message #475547] |
Tue, 04 March 2008 14:12 |
Eclipse User |
|
|
|
Originally posted by: reto.huber.alabus.com
Hi
I would like to loop through all registred MBeans (in session scope) in the
current session. Is there an easy way to do this? I don't have the name of
each Mbean to call them.
Regards,
Reto
|
|
|
|
|
|
|
|
Re: Loop through the Mbeans in Session Scope [message #475607 is a reply to message #475596] |
Thu, 13 March 2008 17:09 |
Eclipse User |
|
|
|
Originally posted by: reto.huber.alabus.com
Thank you for your hints. I'm looping now through my session objects and
search for this one I need.
Map sessionMap = context.getExternalContext().getSessionMap();
Iterator it = sessionMap.entrySet().iterator();
while (it.hasNext()) {
Object obj = ((Entry)it.next()).getValue();
if(obj instanceof AesWebBoBean) {
// do something
}
}
>> But I am not sure whether all registered MBeans with session scope are
>> created
>> at e.g. session start.
>
> None of them are created at session start. Managed beans are created when
> they
> are first referenced in an expression.
that's correct.
kindest regards,
Reto
|
|
|
|
|
|
|
|
Re: Loop through the Mbeans in Session Scope [message #617499 is a reply to message #475596] |
Thu, 13 March 2008 17:09 |
Eclipse User |
|
|
|
Originally posted by: reto.huber.alabus.com
Thank you for your hints. I'm looping now through my session objects and
search for this one I need.
Map sessionMap = context.getExternalContext().getSessionMap();
Iterator it = sessionMap.entrySet().iterator();
while (it.hasNext()) {
Object obj = ((Entry)it.next()).getValue();
if(obj instanceof AesWebBoBean) {
// do something
}
}
>> But I am not sure whether all registered MBeans with session scope are
>> created
>> at e.g. session start.
>
> None of them are created at session start. Managed beans are created when
> they
> are first referenced in an expression.
that's correct.
kindest regards,
Reto
|
|
|
Powered by
FUDForum. Page generated in 0.04184 seconds