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
FieldsModifier and TypeFieldDescriptionprotected final ReadWriteLockprotected final List<WeakReference<com.vaadin.flow.server.VaadinSession>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetActiveSessionsForUsernames(Collection<String> usernames) Provides active (not collected by gc) vaadin sessions mapped on specified usernamesprotected StringgetUsernameFromVaadinSession(com.vaadin.flow.server.VaadinSession session) protected voidonSessionInit(com.vaadin.flow.server.SessionInitEvent event) voidserviceInit(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) -
serviceInit
public void serviceInit(com.vaadin.flow.server.ServiceInitEvent event) - Specified by:
serviceInitin interfacecom.vaadin.flow.server.VaadinServiceInitListener
-
onSessionInit
protected void onSessionInit(com.vaadin.flow.server.SessionInitEvent event)
-