|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sap.conn.jco.ext.DefaultSessionReferenceProvider
public class DefaultSessionReferenceProvider
DefaultSessionReferenceProvider is a sample implementation of the SessionReferenceProvider supporting client sessions running in
separate threads (all operation in a thread belongs to the same client session) and server sessions.
JCo API allows stateful communication using JCoContext.begin() and JCoContext.end() API. At runtime the registered
instance of a session reference provider is responsible to provide a unique ID for the current session,
i.e. the session running in the current thread. It is expected that
each environment provide a suitable session reference provider that able to identify the session.
In most standalone scenarios different threads means different client sessions. Especially applications running in a
single thread works mostly within a single client session. In such scenarios the DefaultSessionReferenceProvider used
by the JCo runtime is sufficient.
Note: it is strongly recommended to register an own instance of the DefaultSessionReferenceProvider
in environments that allow to deploy and to run various applications in order to prevent possible session hijacking.
If no session reference provider is registered, JCo runtime uses internally an instance of DefaultSessionReferenceProvider.
But it is still possible for a malicious application to register its own instance.
Constructor Summary | |
---|---|
DefaultSessionReferenceProvider()
Creates an instance of session reference provider supporting scope types |
|
DefaultSessionReferenceProvider(boolean supportScopes)
Creates an instance of session reference provider |
Method Summary | |
---|---|
JCoSessionReference |
getCurrentSessionReference(java.lang.String scopeType)
Return the session for the current thread. |
boolean |
isSessionAlive(java.lang.String sessionId)
Returns true if the session with the given session ID is still alive |
void |
jcoServerSessionContinued(java.lang.String sessionID)
Server session event when session is being continued |
void |
jcoServerSessionFinished(java.lang.String sessionID)
Implementation for the JCoSessionReference interface used by the DefaultSessionReference |
void |
jcoServerSessionPassivated(java.lang.String sessionID)
Server session event when session is being passivated |
JCoSessionReference |
jcoServerSessionStarted()
Server session event on session start |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultSessionReferenceProvider()
public DefaultSessionReferenceProvider(boolean supportScopes)
supportScopes
- flag indicating if scope types should be supported or notMethod Detail |
---|
public JCoSessionReference getCurrentSessionReference(java.lang.String scopeType)
getCurrentSessionReference
in interface SessionReferenceProvider
scopeType
- scope type
public boolean isSessionAlive(java.lang.String sessionId)
isSessionAlive
in interface SessionReferenceProvider
sessionId
- the session ID to be check
public JCoSessionReference jcoServerSessionStarted()
jcoServerSessionStarted
in interface SessionReferenceProvider
public void jcoServerSessionPassivated(java.lang.String sessionID)
jcoServerSessionPassivated
in interface SessionReferenceProvider
sessionID
- of the session being passivatedpublic void jcoServerSessionContinued(java.lang.String sessionID)
jcoServerSessionContinued
in interface SessionReferenceProvider
sessionID
- of the session being continuedJCoServerContext.setStateful(boolean)
public void jcoServerSessionFinished(java.lang.String sessionID)
jcoServerSessionFinished
in interface SessionReferenceProvider
sessionID
- sessionID of the finished JCoServer
session
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |