public class Sessions extends Object implements org.springframework.beans.factory.config.BeanPostProcessor
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(ISessionLifecycle listener)
Registers a lifecycle listener.
|
protected Session |
createSession(javax.servlet.ServletContext servletContext,
org.springframework.web.socket.WebSocketSession socket)
Creates and registers a new session.
|
protected void |
destroySession(org.springframework.web.socket.WebSocketSession socket,
org.springframework.web.socket.CloseStatus status)
Destroys and unregisters the session associated with the specified web socket.
|
Collection<Session> |
getActiveSessions()
Returns a read-only list of all active sessions.
|
static Sessions |
getInstance() |
Session |
getSession(String id)
Looks up a session by its unique id.
|
protected void |
notifyLifecycleListeners(Session session,
boolean created)
Notify lifecycle listeners of a lifecycle event.
|
Object |
postProcessAfterInitialization(Object bean,
String beanName)
Detects and registers lifecycle listeners.
|
Object |
postProcessBeforeInitialization(Object bean,
String beanName)
NOP
|
void |
removeLifecycleListener(ISessionLifecycle listener)
Unregisters a lifecycle listener.
|
public static Sessions getInstance()
public Collection<Session> getActiveSessions()
public void addLifecycleListener(ISessionLifecycle listener)
listener - A lifecycle listener.public void removeLifecycleListener(ISessionLifecycle listener)
listener - A lifecycle listener.protected void notifyLifecycleListeners(Session session, boolean created)
session - Session triggering the event.created - If true, it is a create event; if false, a destroy event.public Session getSession(String id)
id - The session id.protected Session createSession(javax.servlet.ServletContext servletContext, org.springframework.web.socket.WebSocketSession socket)
servletContext - The servlet context.socket - The web socket session.protected void destroySession(org.springframework.web.socket.WebSocketSession socket,
org.springframework.web.socket.CloseStatus status)
socket - The web socket session.status - The close status.public Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansExceptionpublic Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansExceptionCopyright © 2017 Regenstrief Center for Biomedical Informatics. All rights reserved.