Class NoopLogoutService
java.lang.Object
com.svenruppert.jsentinel.logout.NoopLogoutService
- All Implemented Interfaces:
LogoutService
Default
LogoutService — discards every call. Returned by
JSentinelServiceResolver.logoutService()
when no real implementation has been registered.
Production applications must register a concrete
SubjectClearingLogoutService (or an adapter-specific subclass)
during startup. The noop fallback exists so the resolver never
throws — logout is optional infrastructure, like audit.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(LogoutListener listener) Registers a listener that gets notified once per logged-out session id.voidlogout(SubjectId subjectId, LogoutScope scope) Performs the logout.voidremoveListener(LogoutListener listener) Removes a previously registered listener.
-
Field Details
-
INSTANCE
Singleton instance.
-
-
Constructor Details
-
NoopLogoutService
public NoopLogoutService()Public forServiceLoaderdiscovery. PreferINSTANCE.
-
-
Method Details
-
logout
Description copied from interface:LogoutServicePerforms the logout.- Specified by:
logoutin interfaceLogoutService- Parameters:
subjectId- subject to log out; non-nullscope- scope of the logout; non-null
-
addListener
Description copied from interface:LogoutServiceRegisters a listener that gets notified once per logged-out session id. Idempotent — registering the same listener twice is a no-op.- Specified by:
addListenerin interfaceLogoutService- Parameters:
listener- non-null
-
removeListener
Description copied from interface:LogoutServiceRemoves a previously registered listener. No-op when the listener was never registered.- Specified by:
removeListenerin interfaceLogoutService- Parameters:
listener- listener to remove
-