Version 8.3.4
 —  Special Development Topics  —

Saving Context Data

Sometimes it is useful to save context data centrally inside a session context and to use these data like a session-global variable. You should be very restrictive with this option - otherwise you may end up in a scenario in which any kind of data exchange is done by the context.

This document covers the following topics:


Different Levels of Context

The session management allows you to hold context information at two levels:

Top of page

Accessing the Context

You obtain the context(s) by calling methods which are inherited from the Adapter class:

Both methods return a com.softwareag.cis.context.ILookupContext interface. This interface offers the possibility to bind and look up any objects.

public interface ILookupContext
{
    public Object lookup(String s, boolean reactWithErrorIfNotExist);
    public void bind(String s, Object o);
    public void releaseAllReferences();
}

When binding objects to a context, use a naming convention that is similar to the naming of your Java classes to avoid naming conflicts. Example:

...
findSessionContext.bind("com/yourcompany/application/parameter");
...

The context can be cleaned up by the releaseAllReferences() method. It is integrated into Application Designer's session management.

Top of page

Typical Usage Scenarios

Examples of typical data that you save at the session context level:

Examples of typical data that you save at the subsession context level:

Top of page