Policy for determining whether the servlet spec notifications related to session events are allowed to be emitted on the local cluster node.
Note: The use of the word allowed above is intentional; if a given policy implementation returns true
from one of the methods in this interface, that does not mean the listener will be invoked by the container, nor does the presence of a method in this interface imply that it will be invoked by the container in all cases. The only contract this interface creates is that before invoking a listener method, the container will invoke an implementation of this policy to get permission and will not invoke the listeners if this policy returns false
. If the container does not support emitting notifications in certain cases, it may not bother checking if the notification is allowed, and even if it checks, it still will not emit the notification.
An example of a case where the container may not support emitting a notification is for a session that has never been used locally.
@author Brian Stansberry