Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ Page 262

 
Vinod Subramaniyam
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone please explain the Usually implemented column on this page for all the scenario. Iam probably missing something and getting Confused.

1) Why is HttpSessionListener an Attribute Class?

2) Is not the HttpSessionActivationListener implemented by Attribute Class?

3) Is not HttpSessionBindingListener is implemented by Attribute Class?

4) HttpSessionAttributeListener is implemented by Attribute Class.

Thanks in advance for your Help.

Regards,
Vinod S
 
khushhal yadav
Ranch Hand
Posts: 242
Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vinod,

You seem to have taken all these things in the other way round.

Actaully except HttpSessionBindingListener and HttpSessionActivationListener, every other listeners are usually implimented by any other(non attribute) classes not the attribute class.

Please give stress on the word usually.
Means it's not imperative.

See HttpSessionBindingListener and HttpSessionActivationListener, these two listeners have to do all the stuff with the attributes, as events trigger these Listeners only when something happens with attributes. So there is no significance in making a non-attribute class to extend these interfaces.

But for other listeners, you can have any class (attribute or non-attribute) implementing them because they are not attribute specific. But you have to provide proper implementation for all the methods defined in these interfaces.

Regards,
Khushhal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic