• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

doubt on session listeners

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ranchers,

As per the specification-
On application shutdown, listeners are notified in reverse order to their declarations
with notifications to session listeners preceeding notifications to context listeners.
Session listeners must be notified of session invalidations prior to context listeners
being notified of application shutdown.


Does that mean, session listeners no matter the order in the DD with mixup of context listeners will be called prior to the context listeners, and if we have a couple of session listeners then their order would have to be taken care by the developer?

I am a bit confused


 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
IMHO first the session listeners are notified and then the context listeners.
Lets elaborate ,suppose we have two session listeners and two context listeners .
The SessionListener1 precedes SessionListener2 in dd ,similarly ContextListener1 precedes ContetListener2.
Now when shutdown occurs then the notification order is :
SessionListener2
SessionListener1
ContextListener2
ContextListener1

Cheers!
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Venkat Yerramsetty wrote:
Does that mean, session listeners no matter the order in the DD with mixup of context listeners will be called prior to the context listeners, and if we have a couple of session listeners then their order would have to be taken care by the developer?



Its not like the order of the session listeners doesn't matters. Just as Abhijit pointed out, the sessions listeners will be called in the reverse order of declaration of their own kind, but if a context listener precedes sessions listeners in the DD, only then the session listeners takes the precedence and it is perfectly suited.

Think about it, if a context is destroyed before the session listeners are called, what good it will be? That's why session listeners have precedence over context listeners but amongst themselves, they follow the order in which they were declared.
 
Venkat Yerramsetty
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Abhi and Sourin that clears my doubt.

But what is you have One which implements both Session and Context listener-->listener1, one that implements only Context listener-->listener2 and you want to call listener2 prior to listener1.javascript:emoticon('');


Thanks
Venkat

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic