|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.rad.server.AbstractSessionManager
com.sibvisions.rad.server.DefaultSessionManager
public class DefaultSessionManager
The DefaultSessionManager
handles the access to all sessions
created through client connections.
Constructor Summary | |
---|---|
protected |
DefaultSessionManager(Server pServer)
Creates an instance of DefaultSessionManager for a special
communication server. |
Method Summary | |
---|---|
void |
addSessionListener(ISessionListener pListener)
Adds an ISessionListener session listener to the list of known listeners. |
protected ISecurityManager |
createSecurityManager(java.lang.ClassLoader pLoader,
ISession pSession)
Creates a new security manager instance for the given session and class loader. |
protected ISecurityManager |
createSecurityManager(ISession pSession)
Creates a new security manager instance for the given session. |
java.lang.Object |
createSession(IRequest pRequest,
ISerializer pSerializer,
ChangedHashtable<java.lang.String,java.lang.Object> pProperties)
Creates an authenticated session for an application. |
java.lang.Object |
createSubSession(IRequest pRequest,
AbstractSession pSession,
ChangedHashtable<java.lang.String,java.lang.Object> pProperties)
Creates a new SubSession for an already authenticated main session. |
void |
destroy(java.lang.Object pSessionOrId)
Destroyes a session and dependent sub sessions. |
AbstractSession |
get(java.lang.Object pSessionId)
Gets an existing session. |
static long |
getControllerInterval()
Gets the "validate session" controlleer check interval. |
ISessionListener[] |
getSessionListeners()
Gets the list of known listeners. |
boolean |
isAvailable(java.lang.Object pSessionOrId)
Gets whether a session is known from this session manager. |
boolean |
isInitializing(ISession pSession)
Gets whether the given session is initializing. |
boolean |
isValid(java.lang.Object pSessionOrId)
Gets whether a session is valid. |
protected void |
postCreateSession(ISession pSession)
Configures a session after it is created. |
protected void |
postCreateSubSession(ISession pMaster,
ISession pSession)
Configures a sub session after it is created. |
void |
push(PushMessage pMessage)
Pushes a message to the registered receiver. |
void |
registerPushReceiver(java.lang.Object pConnectionId,
IPushReceiver pReceiver)
Registers a push receiver. |
protected void |
releaseSecurityManager(ISecurityManager pManager)
Releases the given security manager and catch all exceptions. |
void |
removeSessionListener(ISessionListener pListener)
Removes an ISessionListener from the list of known listeners. |
protected void |
sessionCreationError(java.lang.Throwable pCause)
Handles a session creation error. |
static void |
setControllerInterval(long pMilliSeconds)
Sets the "validate session" controller check interval. |
protected void |
subSessionCreationError(java.lang.Throwable pCause)
Handles a sub session creation error. |
void |
unregisterPushReceiver(java.lang.Object pConnectionId)
Unregisters a push receiver. |
Methods inherited from class javax.rad.server.AbstractSessionManager |
---|
getServer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DefaultSessionManager(Server pServer)
DefaultSessionManager
for a special
communication server.
pServer
- communication serverMethod Detail |
---|
public final AbstractSession get(java.lang.Object pSessionId)
get
in class AbstractSessionManager
pSessionId
- session identifier
public final void addSessionListener(ISessionListener pListener)
ISessionListener
session listener to the list of known listeners.
addSessionListener
in class AbstractSessionManager
pListener
- te session listener to addpublic final void removeSessionListener(ISessionListener pListener)
ISessionListener
from the list of known listeners.
removeSessionListener
in class AbstractSessionManager
pListener
- the session listener to removepublic final ISessionListener[] getSessionListeners()
getSessionListeners
in class AbstractSessionManager
ISessionListener
or an empty listpublic boolean isAvailable(java.lang.Object pSessionOrId)
isAvailable
in class AbstractSessionManager
pSessionOrId
- session identifier or session instance
true
if the session is available, false
otherwisepublic void registerPushReceiver(java.lang.Object pConnectionId, IPushReceiver pReceiver)
registerPushReceiver
in interface IPushHandler
pConnectionId
- the connection identifierpReceiver
- the receiverpublic void unregisterPushReceiver(java.lang.Object pConnectionId)
unregisterPushReceiver
in interface IPushHandler
pConnectionId
- the connection identifierpublic void push(PushMessage pMessage)
push
in interface IPushHandler
pMessage
- the messagepublic final java.lang.Object createSession(IRequest pRequest, ISerializer pSerializer, ChangedHashtable<java.lang.String,java.lang.Object> pProperties) throws java.lang.Throwable
pRequest
- the request which creates the sessionpSerializer
- the serializer for the sessionpProperties
- the initial session properties
Session
java.lang.Throwable
- if the security manager detects a problem or the session properties can not be setpublic final java.lang.Object createSubSession(IRequest pRequest, AbstractSession pSession, ChangedHashtable<java.lang.String,java.lang.Object> pProperties) throws java.lang.Throwable
SubSession
for an already authenticated main session.
This method doesn't check if the session is valid.
pRequest
- the request which creates the sub sessionpSession
- a valid sessionpProperties
- the initial session properties
SubSession
java.lang.Throwable
- the session properties can not be setpublic final void destroy(java.lang.Object pSessionOrId)
pSessionOrId
- session identifier or session instance
java.lang.SecurityException
- if the session identifier is unknownprotected ISecurityManager createSecurityManager(ISession pSession) throws java.lang.Exception
pSession
- the session which needs a security manager
java.lang.Exception
- if the class or default constructor was not foundprotected ISecurityManager createSecurityManager(java.lang.ClassLoader pLoader, ISession pSession) throws java.lang.Exception
pLoader
- the class loader to load the security managerpSession
- the session which needs a security manager
java.lang.Exception
- if the class or default constructor was not foundprotected void releaseSecurityManager(ISecurityManager pManager)
pManager
- the security manager to releaseprotected void postCreateSession(ISession pSession)
pSession
- the sessionprotected void postCreateSubSession(ISession pMaster, ISession pSession)
pMaster
- the master sessionpSession
- the sessionprotected void sessionCreationError(java.lang.Throwable pCause)
pCause
- the causecreateSession(IRequest, ISerializer, ChangedHashtable)
protected void subSessionCreationError(java.lang.Throwable pCause)
pCause
- the causecreateSubSession(IRequest, AbstractSession, ChangedHashtable)
public boolean isInitializing(ISession pSession)
pSession
- the session
public boolean isValid(java.lang.Object pSessionOrId)
pSessionOrId
- session identifier or session instance
true
if the session is valid, false
otherwisepublic static void setControllerInterval(long pMilliSeconds)
pMilliSeconds
- the milliseconds between two checks. If the value is <= 0,
the default value will be used.public static long getControllerInterval()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |