|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sibvisions.rad.server.AbstractSession
public abstract class AbstractSession
A Session
is a server side session which will be started
when an IConnection
connects to a remote server.
The session persists for a specified time period, across more than one request
from the IConnection
.
ISession
Field Summary | |
---|---|
protected ChangedHashtable<String,Object> |
chtExternalProperties
the properties got via constructor. |
protected ChangedHashtable<String,Object> |
chtProperties
the client and server properties. |
protected ILogger |
log
the log instance. |
Method Summary | |
---|---|
protected void |
addCallBackResult(ResultObject pResult)
Adds the result of an asynchronous call to the cache. |
Object |
call(String pObjectName,
String pMethod,
Object... pParams)
Executes a method from an object in the life-cycle object. |
Object |
callAction(String pAction,
Object... pParams)
Executes an action from the life-cycle object. |
protected void |
checkAccess()
Checks if it is allowed to create the session. |
protected Object |
executeWithSessionContext(SessionContext pContext,
com.sibvisions.rad.server.Call pCall)
Executes a remote method call. |
Object |
get(String pObjectName)
Gets an object from the life-cycle object. |
abstract IAccessController |
getAccessController()
Gets the IAccessController for checking the access to server side objects
and calls. |
long |
getAliveInterval()
Gets the desired client-side communication interval for this session. |
String |
getApplicationName()
Gets the associated application name of the session. |
protected abstract ApplicationZone |
getApplicationZone()
Gets the application zone for which the session was created. |
Object |
getId()
Gets the session identifier. |
long |
getLastAccessTime()
Gets the time of the last session access. |
long |
getLastAliveTime()
Gets the time of the last communication of the session. |
String |
getLifeCycleName()
Gets the name of the life-cycle object. |
int |
getMaxInactiveInterval()
Returns the maximum time interval, in minutes, that this session will be active. |
InjectObject |
getObject(String pName)
Gets an object from the cache. |
String |
getPassword()
Gets the sessions password. |
ChangedHashtable<String,Object> |
getProperties()
Gets a reference to the internal properties. |
Object |
getProperty(String pName)
Gets the value of a property. |
protected DefaultSessionManager |
getSessionManager()
Gets the session manager for this session. |
long |
getStartTime()
Gets the session start/create time. |
String |
getUserName()
Gets the sessions user name. |
boolean |
isAlive(long pAccessTime)
Checks if the session is alive. |
protected boolean |
isExecuting()
Returns whether the session is execution at least one command. |
boolean |
isInactive(long pAccessTime)
Checks if the session is inactive. |
Object |
put(String pObjectName,
Object pObject)
Puts an object to the life-cycle object. |
InjectObject |
putObject(InjectObject pObject)
Puts an object to the cache. |
InjectObject |
removeObject(InjectObject pObject)
Removes an object from the cache. |
void |
setAliveInterval(long pAliveInterval)
Sets the desired client-side communication interval for this session. |
protected void |
setExecuting(boolean pExecuting)
Sets that the session is executiong a command. |
void |
setLastAccessTime(long pLastAccessTime)
Sets the time of the last session access. |
void |
setLastAliveTime(long pLastAliveTime)
Sets the time of the last communication of the session. |
void |
setMaxInactiveInterval(int pMaxInactiveInterval)
Specifies the time, in minutes, between access before the session will be inactive. |
void |
setPassword(String pPassword)
Sets the session password. |
void |
setProperty(String pName,
Object pValue)
Sets a property. |
protected void |
setPropertyIntern(String pName,
Object pValue)
Sets internal members with property values. |
void |
setUserName(String pUserName)
Sets the sessions user name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.rad.server.ISession |
---|
getConfig |
Field Detail |
---|
protected ILogger log
protected ChangedHashtable<String,Object> chtProperties
protected ChangedHashtable<String,Object> chtExternalProperties
Method Detail |
---|
protected abstract ApplicationZone getApplicationZone()
public abstract IAccessController getAccessController()
IAccessController
for checking the access to server side objects
and calls.
null
if no inspector is availablepublic Object getId()
getId
in interface ISession
public String getLifeCycleName()
getLifeCycleName
in interface ISession
public final String getApplicationName()
getApplicationName
in interface ISession
public final String getUserName()
getUserName
in interface ISession
public final String getPassword()
getPassword
in interface ISession
public Object getProperty(String pName)
getProperty
in interface ISession
pName
- the property name
null
if the property is not availablepublic long getStartTime()
getStartTime
in interface ISession
public long getLastAccessTime()
getLastAccessTime
in interface ISession
public void setMaxInactiveInterval(int pMaxInactiveInterval)
setMaxInactiveInterval
in interface ISession
pMaxInactiveInterval
- time in minutespublic int getMaxInactiveInterval()
setMaxInactiveInterval
method. A zero or negative time indicates the session should never be inactive.
getMaxInactiveInterval
in interface ISession
ISession.setMaxInactiveInterval(int)
public boolean isInactive(long pAccessTime)
isInactive
in interface ISession
pAccessTime
- current access time
true
if the session is inactiveISession.getMaxInactiveInterval()
,
ISession.getLastAccessTime()
public long getLastAliveTime()
getLastAliveTime
in interface ISession
public void setAliveInterval(long pAliveInterval)
setAliveInterval
in interface ISession
pAliveInterval
- the alive interval (client-side)public long getAliveInterval()
getAliveInterval
in interface ISession
public boolean isAlive(long pAccessTime)
isAlive
in interface ISession
pAccessTime
- current access time
true
if the session is aliveISession.getLastAliveTime()
,
ISession.getAliveInterval()
public Object call(String pObjectName, String pMethod, Object... pParams) throws Throwable
call
in interface ISession
pObjectName
- list of already mapped server object name/aliaspMethod
- method name which should be calledpParams
- parameters for the method call
Throwable
- if the object identified by pObjectName
was found but can not be created
SecurityException
- if the method call is not allowedpublic Object callAction(String pAction, Object... pParams) throws Throwable
callAction
in interface ISession
pAction
- action which should be calledpParams
- the parameters for the action call
Throwable
- communication error, security checks, invalid action, ...public Object get(String pObjectName) throws Throwable
get
in interface ISession
pObjectName
- the object name
Throwable
- if the object was not found or an error occured during object creationpublic Object put(String pObjectName, Object pObject) throws Throwable
put
in interface ISession
pObjectName
- the object namepObject
- the object
Throwable
- if an unknown error occurs while putting the objectpublic final void setUserName(String pUserName)
pUserName
- the user namepublic final void setPassword(String pPassword)
pPassword
- the passwordpublic void setLastAccessTime(long pLastAccessTime)
pLastAccessTime
- access time in millispublic void setLastAliveTime(long pLastAliveTime)
pLastAliveTime
- the last communication/alive timeprotected Object executeWithSessionContext(SessionContext pContext, com.sibvisions.rad.server.Call pCall) throws Throwable
pContext
- the current session contextpCall
- the call information
Throwable
- if an exception occurs during call
SecurityException
- if the call is not allowedprotected void addCallBackResult(ResultObject pResult)
pResult
- the result of an asynchronous callpublic void setProperty(String pName, Object pValue)
setProperty
in interface ISession
pName
- the property namepValue
- the value of the property or null
to delete the propertyprotected final void setPropertyIntern(String pName, Object pValue)
pName
- the property namepValue
- the property valuepublic ChangedHashtable<String,Object> getProperties()
getProperties
in interface ISession
protected DefaultSessionManager getSessionManager()
public InjectObject putObject(InjectObject pObject)
pObject
- the object to inject
null
if there was no object with the same object name addedpublic InjectObject removeObject(InjectObject pObject)
pObject
- the object to remove
null
if an object with the same object name was not foundpublic InjectObject getObject(String pName)
pName
- the name of the object
null
if an object with the given name was not foundprotected boolean isExecuting()
true
if the session is executing a command, otherwise false
protected void setExecuting(boolean pExecuting)
pExecuting
- true
to increase the execution counter; false
to
decrease the execution counterprotected void checkAccess()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |