Interface SessionListener
- All Known Implementing Classes:
SessionListenerAdapter
public interface SessionListener
Interface to be implemented by components that wish to be notified of events that occur during a
Session's life cycle.- Since:
- 0.9
-
Method Summary
Modifier and TypeMethodDescriptionvoidonExpiration(Session session) Notification callback that occurs when the corresponding Session has expired.voidNotification callback that occurs when the corresponding Session has started.voidNotification callback that occurs when the corresponding Session has stopped, either programmatically viaSession.stop()or automatically upon a subject logging out.
-
Method Details
-
onStart
-
onStop
Notification callback that occurs when the corresponding Session has stopped, either programmatically viaSession.stop()or automatically upon a subject logging out.- Parameters:
session- the session that has stopped.
-
onExpiration
Notification callback that occurs when the corresponding Session has expired. Note: this method is almost never called at the exact instant that theSessionexpires. Almost all session management systems, including Shiro's implementations, lazily validate sessions - either when they are accessed or during a regular validation interval. It would be too resource intensive to monitor every single session instance to know the exact instant it expires. If you need to perform time-based logic when a session expires, it is best to write it based on the session'slastAccessTimeand not the time when this method is called.- Parameters:
session- the session that has expired.
-