Applications use static methods to manipulate context data on the server
side. The static methods are factories that return a Context instance to the
caller. For example, when a service or business process needs to create a
remote context, the following happens:
- The constructor for client side context creates the CHASession EJB for
the server side.
- The constructor calls the CHASession to get the server side context.
- The CHASession calls the CHAMetaData to read the external definition of
the server side context.
- The CHASession uses the definition to create the CHAInstance EJB. The
CHAInstance wraps the server side context.
- The CHAInstance adds its information to the database of CHAInstances.
- The CHASession receives the instance ID of the newly created context and
passes it back to the client side context.
The following sequence diagram shows this process:

Once the client side context has the CHAInstance remote interface, the
service or business process can manipulate the context information on the
server side using Context instance methods. From the service or business process'
point of view, the remote context is indistinguishable from a local context.
For example, when a service or business process sets a value in a remote context,
the following happens:
- The application calls the setValueAt instance method in the context and
passes the new value.
- The context passes the new value to the remote interface of the CHAInstance
EJB. This EJB contains the server side of the context.
- If the corresponding CHAInstance is not active, the remote interface will
activate it, which then retrieves the CHAInstance (and server
side context) from the CHA database.
- The home interface updates the specified value in the server side context.