|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.rad.server.SessionContext
public abstract class SessionContext
A SessionContext
contains all of the per-request state information related to the processing
of a single server call. It is passed to, and potentially modified by, each phase of the request processing
lifecycle.
A SessionContext instance remains active until its release() method is called. It's possible to have more
than one SessionContexts, but only the last SessionContext is accessible as current instance.
While a SessionContext instance is active, it must not be referenced from any thread other than the one
upon which the server executing this application utilizes for the processing of this call.
Constructor Summary | |
---|---|
SessionContext()
|
Method Summary | |
---|---|
abstract ICloseableSession |
createSubSession(java.lang.String pLifeCycleName,
java.util.Map<java.lang.String,java.lang.Object> pProperties)
Creates a new sub session from the current master session. |
protected abstract void |
destroy()
Destroyes any resources associated with this SessionContext instance. |
abstract ICallBackBroker |
getCallBackBroker()
Gets the ICallBackBroker . |
abstract ICallHandler |
getCallHandler()
Gets the ICallHandler for the current context. |
static SessionContext |
getCurrentInstance()
Gets the current/last instance of SessionContext . |
static IConfiguration |
getCurrentServerConfig()
Gets the IConfiguration from the current instance of SessionContext . |
static ISession |
getCurrentSession()
Gets the ISession from the current instance of SessionContext . |
static IConfiguration |
getCurrentSessionConfig()
Gets the IConfiguration from the current instance of SessionContext . |
abstract ISession |
getMasterSession()
Gets the master ISession instance for this context. |
abstract java.lang.String |
getMethodName()
Gets the name of the method which will be called. |
SessionContext |
getNextContext()
Gets the next SessionContext, if available. |
abstract InjectObject |
getObject(java.lang.String pName)
Gets an already added inject object. |
abstract java.lang.String |
getObjectName()
Gets the name of the object from which a method will be called. |
SessionContext |
getPreviousContext()
Gets the previous SessionContext, if available. |
abstract IConfiguration |
getServerConfig()
Gets the server IConfiguration . |
abstract IConnection |
getServerConnection()
Gets a connection to the server. |
abstract ISession |
getSession()
Gets the ISession instance for this context. |
abstract IConfiguration |
getSessionConfig()
Gets the IConfiguration for the session. |
boolean |
isReleased()
Gets the release state of this SessionContext . |
static ICallBackBroker.PublishState |
publishCallBackResult(java.lang.String pInstruction,
java.lang.Object pObject)
Publishs an object as callback result. |
abstract InjectObject |
putObject(InjectObject pObject)
Puts an object to this SessionContext . |
InjectObject |
putObject(java.lang.String pName,
java.lang.Object pObject)
Puts an object with a specific name to this SessionContext . |
void |
release()
Release any resources associated with this SessionContext instance. |
abstract InjectObject |
removeObject(InjectObject pObject)
Removes an inject object from this SessionContext . |
InjectObject |
removeObject(java.lang.String pName)
Removes an inject object from this SessionContext . |
protected void |
setCurrentInstance(SessionContext pContext)
Sets the current SessionContext instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SessionContext()
Method Detail |
---|
protected abstract void destroy()
public abstract ISession getSession()
ISession
instance for this context.
ISession
instancepublic abstract ISession getMasterSession()
ISession
instance for this context.
ISession
public abstract IConfiguration getSessionConfig()
IConfiguration
for the session.
IConfiguration
public abstract IConfiguration getServerConfig()
IConfiguration
.
IConfiguration
public abstract IConnection getServerConnection()
public abstract java.lang.String getObjectName()
SessionContext
will be initialized through a method call with or without object name. The method call without
object name is known as action call.
null
if an action will be calledgetMethodName()
public abstract java.lang.String getMethodName()
public abstract InjectObject putObject(InjectObject pObject)
SessionContext
.
pObject
- the inject object
null
if the object was not knownpublic abstract InjectObject removeObject(InjectObject pObject)
SessionContext
.
pObject
- the inject object
null
if the object was not putpublic abstract InjectObject getObject(java.lang.String pName)
pName
- the object name
null
if there is no object with the pName
public abstract ICallHandler getCallHandler()
ICallHandler
for the current context. The handler depends on the
current session.
public abstract ICallBackBroker getCallBackBroker()
ICallBackBroker
.
public abstract ICloseableSession createSubSession(java.lang.String pLifeCycleName, java.util.Map<java.lang.String,java.lang.Object> pProperties) throws java.lang.Throwable
ICloseable.close()
the session.
pLifeCycleName
- the name of the life-cycle objectpProperties
- the additional session properties
java.lang.Throwable
- if sub session creation failspublic final void release()
isReleased()
public static SessionContext getCurrentInstance()
SessionContext
.
public static ISession getCurrentSession()
ISession
from the current instance of SessionContext
.
ISession
public static IConfiguration getCurrentSessionConfig()
IConfiguration
from the current instance of SessionContext
.
IConfiguration
public static IConfiguration getCurrentServerConfig()
IConfiguration
from the current instance of SessionContext
.
IConfiguration
public static ICallBackBroker.PublishState publishCallBackResult(java.lang.String pInstruction, java.lang.Object pObject)
pInstruction
- the instruction identifierpObject
- the object to send
true
if publishing was successful, false
otherwisepublic boolean isReleased()
SessionContext
.
true
if there is no current instance of SessionContext
(means
that the SessionContext
is released); otherwise false
protected void setCurrentInstance(SessionContext pContext)
null
as parameter for the current instance.
pContext
- the current SessionContext
or null
to unset the current
instancepublic InjectObject putObject(java.lang.String pName, java.lang.Object pObject)
SessionContext
.
pName
- the object namepObject
- the object or null
to remove the object with pName
null
if the object was not putpublic InjectObject removeObject(java.lang.String pName)
SessionContext
.
pName
- the name of the inject object
null
if the object was not putpublic SessionContext getPreviousContext()
null
if there is no previous created contextpublic SessionContext getNextContext()
null
if this context is the current context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |