nerdexam
GIAC

GSNA · Question #174

Which of the following functions are performed by methods of the HttpSessionActivationListener interface?

The correct answer is A. Notifying an attribute that a session has just migrated from one JVM to another. D. Notifying an attribute that a session is about to migrate from one JVM to another. The HttpSessionActivationListener interface notifies an attribute that the session is about to be activated or passivated. Methods of this interface are as follows: public void sessionDidActivate(HttpSessionEvent session): It notifies the attribute that the session has just…

Database & Application Auditing

Question

Which of the following functions are performed by methods of the HttpSessionActivationListener interface?

Options

  • ANotifying an attribute that a session has just migrated from one JVM to another.
  • BNotifying the object when it is unbound from a session.
  • CNotifying the object when it is bound to a session.
  • DNotifying an attribute that a session is about to migrate from one JVM to another.

How the community answered

(36 responses)
  • A
    72% (26)
  • B
    19% (7)
  • C
    8% (3)

Explanation

The HttpSessionActivationListener interface notifies an attribute that the session is about to be activated or passivated. Methods of this interface are as follows: public void sessionDidActivate(HttpSessionEvent session): It notifies the attribute that the session has just been moved to a different JVM. public void sessionWillPassivate(HttpSessionEvent se): It notifies the attribute that the session is about to move to a different JVM. Answer: B, C are incorrect. These functions are performed by the HttpSessionBindingListener interface. The HttpSessionBindingListener interface causes an object of the implementing class to be notified when it is added to or removed from a session. The HttpSessionBindingListener interface has the following methods: public void valueBound(event): This method takes an object of type HttpSessionBindingEvent as an argument. It notifies the object when it is bound to a session. public void valueUnbound(HttpSessionBindingEvent event): This method takes an object of type HttpSessionBindingEvent as an argument. It notifies the object when it is unbound from a

Topics

#HttpSessionActivationListener#JVM migration#Java servlet#session lifecycle

Community Discussion

No community discussion yet for this question.

Full GSNA Practice