org.apache.axis2.context
Class SessionContext

java.lang.Object
  extended byorg.apache.axis2.context.AbstractContext
      extended byorg.apache.axis2.context.SessionContext

public class SessionContext
extends AbstractContext

All the engine components are stateless across the executions and all the states should be kept in the Contexts, there are three context Global, Session and Message.


Field Summary
 long sessionContextTimeoutInterval
           
 
Fields inherited from class org.apache.axis2.context.AbstractContext
lastTouchedTime, parent, properties
 
Constructor Summary
SessionContext(AbstractContext parent)
           
 
Method Summary
 void addServiceContext(ServiceContext serviceContext)
           
 void addServiceGroupContext(ServiceGroupContext serviceGroupContext, String serviceGroupID)
           
 String getCookieID()
           
 long getLastTouchedTime()
           
 ServiceContext getServiceContext(AxisService axisService)
           
 ServiceGroupContext getServiceGroupContext(String serviceGroupID)
           
 void init(AxisConfiguration axisConfiguration)
           
 void setCookieID(String cookieID)
           
 void touch()
          ServiceContext and ServiceGroupContext are not getting automatically garbage collected.
 
Methods inherited from class org.apache.axis2.context.AbstractContext
getParent, getProperties, getProperty, setParent, setProperties, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sessionContextTimeoutInterval

public long sessionContextTimeoutInterval
Constructor Detail

SessionContext

public SessionContext(AbstractContext parent)
Parameters:
parent -
Method Detail

init

public void init(AxisConfiguration axisConfiguration)
          throws AxisFault
Throws:
AxisFault

getServiceContext

public ServiceContext getServiceContext(AxisService axisService)

addServiceContext

public void addServiceContext(ServiceContext serviceContext)

addServiceGroupContext

public void addServiceGroupContext(ServiceGroupContext serviceGroupContext,
                                   String serviceGroupID)

getServiceGroupContext

public ServiceGroupContext getServiceGroupContext(String serviceGroupID)

getCookieID

public String getCookieID()

setCookieID

public void setCookieID(String cookieID)

touch

public void touch()
ServiceContext and ServiceGroupContext are not getting automatically garbage collected. And there is no specific way for some one to go and make it garbage collectable. So the current solution is to make them time out. So the logic is that, there is a timer task in each and every service group which will check for the last touched time. And if it has not been touched for some time, the timer task will remove it from the memory. The touching logic happens like this. Whenever there is a call to addMessageContext in the operationContext it will go and update operationCOntext -> serviceContext -> serviceGroupContext.

Overrides:
touch in class AbstractContext

getLastTouchedTime

public long getLastTouchedTime()
Overrides:
getLastTouchedTime in class AbstractContext