MemorySessionManager
Overview
This is a session manager implementation that uses memory storage for the session data. As such, access to session data is very efficient, but session data will not be persisted when the server is restarted, nor can it be shared between several instances of the server.
Location
- Reference: RemObjects.SDK.Server.dll
- Namespace: RemObjects.SDK.Server
- Ancestry: Component | SessionManager | MemorySessionManager
constructor
constructor
MemorySessionManager()
Sub New()
constructor (IContainer)
constructor(container: IContainer)
MemorySessionManager(IContainer container)
Sub New(container As IContainer)
Parameters:
- container:
constructor (Boolean) protected
constructor(register: Boolean)
MemorySessionManager(Boolean register)
Sub New(register As Boolean)
Parameters:
- register:
constructor (Boolean, Boolean) protected (declared in SessionManager)
constructor(register: Boolean; initializeSessionExpirationTimer: Boolean)
MemorySessionManager(Boolean register, Boolean initializeSessionExpirationTimer)
Sub New(register As Boolean, initializeSessionExpirationTimer As Boolean)
Parameters:
- register:
- initializeSessionExpirationTimer:
CreateNewSession protected
method CreateNewSession(sessionId: Guid): ISession
ISession CreateNewSession(Guid sessionId)
Function CreateNewSession(sessionId As Guid) As ISession
Parameters:
- sessionId:
DestroySession (ISession) (declared in SessionManager)
method DestroySession(session: ISession)
void DestroySession(ISession session)
Sub DestroySession(session As ISession)
Parameters:
- session:
DestroySession (Guid) (declared in SessionManager)
method DestroySession(sessionId: Guid)
void DestroySession(Guid sessionId)
Sub DestroySession(sessionId As Guid)
Parameters:
- sessionId:
Dispose protected (declared in SessionManager)
method Dispose(disposing: Boolean)
void Dispose(Boolean disposing)
Sub Dispose(disposing As Boolean)
Parameters:
- disposing:
ExpireSessions
This method will expire all sessions in the Session Manager that have exceeded the timeout.
Note
SessionManager will regularly check for expired sessions automatically, but you can use this method to trigger an expiration cycle manually.
method ExpireSessions
void ExpireSessions()
Sub ExpireSessions()
GetAllSessions
method GetAllSessions: IList<Guid>
IList<Guid> GetAllSessions()
Function GetAllSessions() As IList<Guid>
GetExistingSession (declared in SessionManager)
Returns existing session with provided Id or null in case the session cannot be found. Depending on the updateTime parameter value updates the session's LastaccessedTime attribute.
method GetExistingSession(sessionId: Guid; updateTime: Boolean): ISession
ISession GetExistingSession(Guid sessionId, Boolean updateTime)
Function GetExistingSession(sessionId As Guid, updateTime As Boolean) As ISession
Parameters:
- sessionId: Session Id
- updateTime: Flag indicating whether session's LastAccessedTime attribute should be updated
GetSession (declared in SessionManager)
Returns session with provided Id. If there is no session stored with the provided Id then new session is created.
method GetSession(sessionId: Guid): ISession
ISession GetSession(Guid sessionId)
Function GetSession(sessionId As Guid) As ISession
Parameters:
- sessionId: Session Id
IsOutOfProcess
property IsOutOfProcess: Boolean read;
Boolean IsOutOfProcess { get; }
ReadOnly Property IsOutOfProcess() As Boolean
LocateExistingSession protected
method LocateExistingSession(sessionId: Guid; updateTime: Boolean): ISession
ISession LocateExistingSession(Guid sessionId, Boolean updateTime)
Function LocateExistingSession(sessionId As Guid, updateTime As Boolean) As ISession
Parameters:
- sessionId:
- updateTime:
MaxSessions
property MaxSessions: Int32 read write;
Int32 MaxSessions { get; set; }
Property MaxSessions() As Int32
OnSessionCreated (declared in SessionManager)
Gets triggered after a new Session has been created. You can use it to perform initialization functions or fill the session with default values.
event OnSessionCreated: SessionEventHandler;
delegate: method OnSessionCreated(sender: Object; e: SessionEventArgs)
delegate SessionEventHandler OnSessionCreated()
delegate: void OnSessionCreated(Object sender, SessionEventArgs e)
Event OnSessionCreated As SessionEventHandler
delegate: Sub OnSessionCreated(sender As Object, e As SessionEventArgs)
OnSessionDestroyed (declared in SessionManager)
Gets triggered after a new Session has been manually destroyed. You can use it to perform cleanup for a specific session id.
Note: The session has already been Disposed when the OnSessionDestroyed event fires. This event will not fire for sessions that expire.
event OnSessionDestroyed: SessionIDEventHandler;
delegate: method OnSessionDestroyed(sender: Object; e: SessionIDEventArgs)
delegate SessionIDEventHandler OnSessionDestroyed()
delegate: void OnSessionDestroyed(Object sender, SessionIDEventArgs e)
Event OnSessionDestroyed As SessionIDEventHandler
delegate: Sub OnSessionDestroyed(sender As Object, e As SessionIDEventArgs)
OnSessionExpired (declared in SessionManager)
Gets triggered after a new Session has been expired. You can use it to perform cleanup and/or inspect the values of the expired session.
Note: The session has already been Disposed when the OnSessionExpired event fires. This event will not fire for sessions that are manually destroyed.
event OnSessionExpired: SessionEventHandler;
delegate: method OnSessionExpired(sender: Object; e: SessionEventArgs)
delegate SessionEventHandler OnSessionExpired()
delegate: void OnSessionExpired(Object sender, SessionEventArgs e)
Event OnSessionExpired As SessionEventHandler
delegate: Sub OnSessionExpired(sender As Object, e As SessionEventArgs)
ReleaseSession
method ReleaseSession(session: ISession)
void ReleaseSession(ISession session)
Sub ReleaseSession(session As ISession)
Parameters:
- session:
SessionCount protected
property SessionCount: Int32 read;
Int32 SessionCount { get; }
ReadOnly Property SessionCount() As Int32
Timeout (declared in SessionManager)
Determines the timeout (in seconds) after which sessions will be discarded if they have not been accessed. The default value is 600 seconds (10 minutes).
property Timeout: Int32 read write;
Int32 Timeout { get; set; }
Property Timeout() As Int32
TriggerOnSessionCreated protected (declared in SessionManager)
method TriggerOnSessionCreated(e: SessionEventArgs)
void TriggerOnSessionCreated(SessionEventArgs e)
Sub TriggerOnSessionCreated(e As SessionEventArgs)
Parameters:
- e:
TriggerOnSessionDestroyed protected (declared in SessionManager)
method TriggerOnSessionDestroyed(e: SessionIDEventArgs)
void TriggerOnSessionDestroyed(SessionIDEventArgs e)
Sub TriggerOnSessionDestroyed(e As SessionIDEventArgs)
Parameters:
- e:
TriggerOnSessionExpired protected (declared in SessionManager)
method TriggerOnSessionExpired(e: SessionEventArgs)
void TriggerOnSessionExpired(SessionEventArgs e)
Sub TriggerOnSessionExpired(e As SessionEventArgs)
Parameters:
- e:
IsOutOfProcess
property IsOutOfProcess: Boolean read;
Boolean IsOutOfProcess { get; }
ReadOnly Property IsOutOfProcess() As Boolean
MaxSessions
property MaxSessions: Int32 read write;
Int32 MaxSessions { get; set; }
Property MaxSessions() As Int32
SessionCount protected
property SessionCount: Int32 read;
Int32 SessionCount { get; }
ReadOnly Property SessionCount() As Int32
Timeout (declared in SessionManager)
Determines the timeout (in seconds) after which sessions will be discarded if they have not been accessed. The default value is 600 seconds (10 minutes).
property Timeout: Int32 read write;
Int32 Timeout { get; set; }
Property Timeout() As Int32
constructor
constructor
MemorySessionManager()
Sub New()
constructor (IContainer)
constructor(container: IContainer)
MemorySessionManager(IContainer container)
Sub New(container As IContainer)
Parameters:
- container:
constructor (Boolean) protected
constructor(register: Boolean)
MemorySessionManager(Boolean register)
Sub New(register As Boolean)
Parameters:
- register:
constructor (Boolean, Boolean) protected (declared in SessionManager)
constructor(register: Boolean; initializeSessionExpirationTimer: Boolean)
MemorySessionManager(Boolean register, Boolean initializeSessionExpirationTimer)
Sub New(register As Boolean, initializeSessionExpirationTimer As Boolean)
Parameters:
- register:
- initializeSessionExpirationTimer:
CreateNewSession protected
method CreateNewSession(sessionId: Guid): ISession
ISession CreateNewSession(Guid sessionId)
Function CreateNewSession(sessionId As Guid) As ISession
Parameters:
- sessionId:
DestroySession (ISession) (declared in SessionManager)
method DestroySession(session: ISession)
void DestroySession(ISession session)
Sub DestroySession(session As ISession)
Parameters:
- session:
DestroySession (Guid) (declared in SessionManager)
method DestroySession(sessionId: Guid)
void DestroySession(Guid sessionId)
Sub DestroySession(sessionId As Guid)
Parameters:
- sessionId:
Dispose protected (declared in SessionManager)
method Dispose(disposing: Boolean)
void Dispose(Boolean disposing)
Sub Dispose(disposing As Boolean)
Parameters:
- disposing:
ExpireSessions
This method will expire all sessions in the Session Manager that have exceeded the timeout.
Note
SessionManager will regularly check for expired sessions automatically, but you can use this method to trigger an expiration cycle manually.
method ExpireSessions
void ExpireSessions()
Sub ExpireSessions()
GetAllSessions
method GetAllSessions: IList<Guid>
IList<Guid> GetAllSessions()
Function GetAllSessions() As IList<Guid>
GetExistingSession (declared in SessionManager)
Returns existing session with provided Id or null in case the session cannot be found. Depending on the updateTime parameter value updates the session's LastaccessedTime attribute.
method GetExistingSession(sessionId: Guid; updateTime: Boolean): ISession
ISession GetExistingSession(Guid sessionId, Boolean updateTime)
Function GetExistingSession(sessionId As Guid, updateTime As Boolean) As ISession
Parameters:
- sessionId: Session Id
- updateTime: Flag indicating whether session's LastAccessedTime attribute should be updated
GetSession (declared in SessionManager)
Returns session with provided Id. If there is no session stored with the provided Id then new session is created.
method GetSession(sessionId: Guid): ISession
ISession GetSession(Guid sessionId)
Function GetSession(sessionId As Guid) As ISession
Parameters:
- sessionId: Session Id
LocateExistingSession protected
method LocateExistingSession(sessionId: Guid; updateTime: Boolean): ISession
ISession LocateExistingSession(Guid sessionId, Boolean updateTime)
Function LocateExistingSession(sessionId As Guid, updateTime As Boolean) As ISession
Parameters:
- sessionId:
- updateTime:
ReleaseSession
method ReleaseSession(session: ISession)
void ReleaseSession(ISession session)
Sub ReleaseSession(session As ISession)
Parameters:
- session:
TriggerOnSessionCreated protected (declared in SessionManager)
method TriggerOnSessionCreated(e: SessionEventArgs)
void TriggerOnSessionCreated(SessionEventArgs e)
Sub TriggerOnSessionCreated(e As SessionEventArgs)
Parameters:
- e:
TriggerOnSessionDestroyed protected (declared in SessionManager)
method TriggerOnSessionDestroyed(e: SessionIDEventArgs)
void TriggerOnSessionDestroyed(SessionIDEventArgs e)
Sub TriggerOnSessionDestroyed(e As SessionIDEventArgs)
Parameters:
- e:
TriggerOnSessionExpired protected (declared in SessionManager)
method TriggerOnSessionExpired(e: SessionEventArgs)
void TriggerOnSessionExpired(SessionEventArgs e)
Sub TriggerOnSessionExpired(e As SessionEventArgs)
Parameters:
- e:
OnSessionCreated (declared in SessionManager)
Gets triggered after a new Session has been created. You can use it to perform initialization functions or fill the session with default values.
event OnSessionCreated: SessionEventHandler;
delegate: method OnSessionCreated(sender: Object; e: SessionEventArgs)
delegate SessionEventHandler OnSessionCreated()
delegate: void OnSessionCreated(Object sender, SessionEventArgs e)
Event OnSessionCreated As SessionEventHandler
delegate: Sub OnSessionCreated(sender As Object, e As SessionEventArgs)
OnSessionDestroyed (declared in SessionManager)
Gets triggered after a new Session has been manually destroyed. You can use it to perform cleanup for a specific session id.
Note: The session has already been Disposed when the OnSessionDestroyed event fires. This event will not fire for sessions that expire.
event OnSessionDestroyed: SessionIDEventHandler;
delegate: method OnSessionDestroyed(sender: Object; e: SessionIDEventArgs)
delegate SessionIDEventHandler OnSessionDestroyed()
delegate: void OnSessionDestroyed(Object sender, SessionIDEventArgs e)
Event OnSessionDestroyed As SessionIDEventHandler
delegate: Sub OnSessionDestroyed(sender As Object, e As SessionIDEventArgs)
OnSessionExpired (declared in SessionManager)
Gets triggered after a new Session has been expired. You can use it to perform cleanup and/or inspect the values of the expired session.
Note: The session has already been Disposed when the OnSessionExpired event fires. This event will not fire for sessions that are manually destroyed.
event OnSessionExpired: SessionEventHandler;
delegate: method OnSessionExpired(sender: Object; e: SessionEventArgs)
delegate SessionEventHandler OnSessionExpired()
delegate: void OnSessionExpired(Object sender, SessionEventArgs e)
Event OnSessionExpired As SessionEventHandler
delegate: Sub OnSessionExpired(sender As Object, e As SessionEventArgs)