Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.axis2.context
Class SessionContext

    java.lang.Object
      org.apache.axis2.context.AbstractContext
          org.apache.axis2.context.SessionContext

All Implemented Interfaces:
  Externalizable, Serializable, SafeSerializable

    public class SessionContext

extends AbstractContext
implements Externalizable, SafeSerializable

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.

See Also:
  Serialized Form

Field Summary
`long` | `sessionContextTimeoutInterval`

Fields inherited from class org.apache.axis2.context.AbstractContext
`COPY_PROPERTIES, lastTouchedTime, parent, properties`

Constructor Summary
`SessionContext()`
`SessionContext(AbstractContext parent)`

Method Summary
`void` | `addServiceContext(ServiceContext serviceContext)`
`void` | `addServiceGroupContext(ServiceGroupContext serviceGroupContext)`
`protected void` | `finalize()`
`String` | `getCookieID()`
`long` | `getLastTouchedTime()`
`ConfigurationContext` | `getRootContext()`
`ServiceContext` | `getServiceContext(AxisService axisService)`
`Iterator<ServiceGroupContext>` | `getServiceGroupContext()`
`ServiceGroupContext` | `getServiceGroupContext(String serviceGroupID)`
`void` | `init(AxisConfiguration axisConfiguration)`
`void` | `readExternal(ObjectInput inObject)` Restore the contents of the MessageContext that was previously saved.
`void` | `setCookieID(String cookieID)`
`void` | `touch()` ServiceContext and ServiceGroupContext are not getting automatically garbage collectible.
`void` | `writeExternal(ObjectOutput o)` Save the contents of this object.

Methods inherited from class org.apache.axis2.context.AbstractContext
`clearPropertyDifferences, flush, getLocalProperty, getParent, getProperties, getProperty, getPropertyDifferences, getPropertyNames, getPropertyNonReplicable, isAncestor, mergeProperties, removeProperty, removePropertyNonReplicable, setLastTouchedTime, setNonReplicableProperty, setParent, setProperties, setProperty`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### sessionContextTimeoutInterval

    public long sessionContextTimeoutInterval

Constructor Detail

### SessionContext

    public SessionContext(AbstractContext parent)

Parameters:
  `parent` -

### SessionContext

    public SessionContext()

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)

### 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 collectible. 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`

### getServiceGroupContext

    public Iterator<ServiceGroupContext> getServiceGroupContext()

### finalize

    protected void finalize()
                     throws Throwable

  Overrides:
    `finalize` in class `Object`
  Throws:
    `Throwable`

### writeExternal

    public void writeExternal(ObjectOutput o)
                       throws IOException

  Save the contents of this object.

  NOTE: Transient fields and static fields are not saved.

  Specified by:
    `writeExternal` in interface `Externalizable`
  Parameters:
    `out` - The stream to write the object contents to
  Throws:
    `IOException`

### readExternal

    public void readExternal(ObjectInput inObject)
                      throws IOException,
                             ClassNotFoundException

  Restore the contents of the MessageContext that was previously saved.

  NOTE: The field data must read back in the same order and type as it was written. Some data will need to be validated when resurrected.

  Specified by:
    `readExternal` in interface `Externalizable`
  Parameters:
    `in` - The stream to read the object contents from
  Throws:
    `IOException`
    `ClassNotFoundException`

### getRootContext

    public ConfigurationContext getRootContext()

  Specified by:
    `getRootContext` in class `AbstractContext`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.