com.sibvisions.rad.server
Class AbstractSessionContext

java.lang.Object
  extended by javax.rad.server.SessionContext
      extended by com.sibvisions.rad.server.AbstractSessionContext

public abstract class AbstractSessionContext
extends SessionContext

The AbstractSessionContext is a general SessionContext implementation.


Constructor Summary
protected AbstractSessionContext(ISession pSession)
          Creates a new instance of SessionContextImpl for a specific ISession.
 
Method Summary
 ICloseableSession createSubSession(String pLifeCycleName, Map<String,Object> pProperties)
          Creates a new sub session from the current master session.
 void destroy()
          Destroyes any resources associated with this SessionContext instance.
 IAccessChecker getAccessChecker()
          Gets the access checker of the current session, if available.
 ISession getMasterSession()
          Gets the master ISession instance for this context.
 String getMethodName()
          Gets the name of the method which will be called.
 InjectObject getObject(String pName)
          Gets an already added inject object.
 String getObjectName()
          Gets the name of the object from which a method will be called.
 IConfiguration getServerConfig()
          Gets the server IConfiguration.
 IConnection getServerConnection()
          Gets a connection to the server.
 ISession getSession()
          Gets the ISession instance for this context.
 IConfiguration getSessionConfig()
          Gets the IConfiguration for the session.
 InjectObject putObject(InjectObject pObject)
          Puts an object to this SessionContext.
 InjectObject removeObject(InjectObject pObject)
          Removes an inject object from this SessionContext.
protected  void setMethodName(String pMethodName)
          Sets the name of the method which will be called.
protected  void setObjectName(String pObjectName)
          Sets the name of the current object from which the method will be called.
 
Methods inherited from class javax.rad.server.SessionContext
getCallBackBroker, getCallHandler, getCurrentInstance, getCurrentServerConfig, getCurrentSession, getCurrentSessionConfig, getNextContext, getPreviousContext, isReleased, publishCallBackResult, putObject, release, removeObject, setCurrentInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSessionContext

protected AbstractSessionContext(ISession pSession)
Creates a new instance of SessionContextImpl for a specific ISession.

Parameters:
pSession - the associated session for this SessionContext
Method Detail

destroy

public void destroy()
Destroyes any resources associated with this SessionContext instance.

Specified by:
destroy in class SessionContext

getSession

public ISession getSession()
Gets the ISession instance for this context.

Specified by:
getSession in class SessionContext
Returns:
the ISession instance

getMasterSession

public ISession getMasterSession()
Gets the master ISession instance for this context.

Specified by:
getMasterSession in class SessionContext
Returns:
the master ISession

getSessionConfig

public IConfiguration getSessionConfig()
Gets the IConfiguration for the session.

Specified by:
getSessionConfig in class SessionContext
Returns:
the IConfiguration

getServerConfig

public IConfiguration getServerConfig()
Gets the server IConfiguration.

Specified by:
getServerConfig in class SessionContext
Returns:
the IConfiguration

getServerConnection

public IConnection getServerConnection()
Gets a connection to the server.

Specified by:
getServerConnection in class SessionContext
Returns:
a "direct" server connection

getObjectName

public String getObjectName()
Gets the name of the object from which a method will be called. A SessionContext will be initialized through a method call with or without object name. The method call without object name is known as action call.

Specified by:
getObjectName in class SessionContext
Returns:
the name of the object which will be used or null if an action will be called
See Also:
SessionContext.getMethodName()

getMethodName

public String getMethodName()
Gets the name of the method which will be called.

Specified by:
getMethodName in class SessionContext
Returns:
the method name

putObject

public InjectObject putObject(InjectObject pObject)
Puts an object to this SessionContext.

Specified by:
putObject in class SessionContext
Parameters:
pObject - the inject object
Returns:
the old object or null if the object was not known

removeObject

public InjectObject removeObject(InjectObject pObject)
Removes an inject object from this SessionContext.

Specified by:
removeObject in class SessionContext
Parameters:
pObject - the inject object
Returns:
the removed object or null if the object was not put

getObject

public InjectObject getObject(String pName)
Gets an already added inject object.

Specified by:
getObject in class SessionContext
Parameters:
pName - the object name
Returns:
the object or null if there is no object with the pName

createSubSession

public ICloseableSession createSubSession(String pLifeCycleName,
                                          Map<String,Object> pProperties)
                                   throws Throwable
Creates a new sub session from the current master session. Don't forget to ICloseable.close() the session.

Specified by:
createSubSession in class SessionContext
Parameters:
pLifeCycleName - the name of the life-cycle object
pProperties - the additional session properties
Returns:
the new sub session instance
Throws:
Throwable - if sub session creation fails

getAccessChecker

public IAccessChecker getAccessChecker()
Gets the access checker of the current session, if available.

Specified by:
getAccessChecker in class SessionContext
Returns:
the access checker or null if no access checker is available

setObjectName

protected void setObjectName(String pObjectName)
Sets the name of the current object from which the method will be called.

Parameters:
pObjectName - the object name or null if the object is unknown
See Also:
getObjectName()

setMethodName

protected void setMethodName(String pMethodName)
Sets the name of the method which will be called.

Parameters:
pMethodName - the method name or null if the method is unknown
See Also:
getMethodName()


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.