Package io.jmix.flowui.sys
Class SessionHolder
java.lang.Object
io.jmix.flowui.sys.SessionHolder
- All Implemented Interfaces:
com.vaadin.flow.server.VaadinServiceInitListener
,Serializable
,EventListener
@Component("flowui_SessionHolder")
public class SessionHolder
extends Object
implements com.vaadin.flow.server.VaadinServiceInitListener
Holds vaadin sessions for all users
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ReadWriteLock
protected final List<WeakReference<com.vaadin.flow.server.VaadinSession>>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetActiveSessionsForUsernames
(Collection<String> usernames) Provides active (not collected by gc) vaadin sessions mapped on specified usernamesprotected String
getUsernameFromVaadinSession
(com.vaadin.flow.server.VaadinSession session) protected com.vaadin.flow.server.VaadinSessionState
getVaadinSessionState
(com.vaadin.flow.server.VaadinSession session) protected void
onSessionInit
(com.vaadin.flow.server.SessionInitEvent event) void
serviceInit
(com.vaadin.flow.server.ServiceInitEvent event)
-
Field Details
-
lock
-
sessions
-
-
Constructor Details
-
SessionHolder
public SessionHolder()
-
-
Method Details
-
getActiveSessionsForUsernames
public Map<String,List<com.vaadin.flow.server.VaadinSession>> getActiveSessionsForUsernames(@Nullable Collection<String> usernames) Provides active (not collected by gc) vaadin sessions mapped on specified usernames- Parameters:
usernames
- usernames of users which sessions should be provided. Null means that sessions for all users will be returned.- Returns:
- active user vaadin sessions
-
getUsernameFromVaadinSession
@Nullable protected String getUsernameFromVaadinSession(com.vaadin.flow.server.VaadinSession session) -
getVaadinSessionState
protected com.vaadin.flow.server.VaadinSessionState getVaadinSessionState(com.vaadin.flow.server.VaadinSession session) -
serviceInit
public void serviceInit(com.vaadin.flow.server.ServiceInitEvent event) - Specified by:
serviceInit
in interfacecom.vaadin.flow.server.VaadinServiceInitListener
-
onSessionInit
protected void onSessionInit(com.vaadin.flow.server.SessionInitEvent event)
-