In HFSJ, it says the HttpSessionActivationListener will be implemented usually by An attribute class and some other class. However it aslo says that you do not need to declare the listener class in DD. If it's implemented by some other class, how does the container find it?
My question is if HttpSesstionActivationListener is implemented by a non-attribute class (some other class in HFSJ, page 262), will it be notified when session migrates? I know it will be notified if it's implmeneted by seesion attribute class, but how about non-attribute class?
Joined: Aug 18, 2005
just look at what you're saying
the container or the compiler, neither know if a javabean class is an attribute class or non-attribute class, all they care is whether you have implemented the interface or not, if you implement the interface in a class, the class will be notified appropriately...but it wouldn't make much sense if a non-attribute class implemented the HttpSessionActivationListener, it also wouldn't make sense if a serializable attribute class implemented it...why? you tell me
of course there might be other not-so-obvious reasons where it would make sense for any class to implement this interface, but these I believe, are slightly out of the scope of the exam.