WebEnvironments Class

WebEnvironments Creation

The Carapace Hub uses a WebEnvironments object to hold information about HTTP sessions. This information is available for access by scripts processed within the HTML Templates. Within a template, the environments are held as a property of the incoming HttpRequest as follows:

    req.environments
This returns an object of type WebEnvironments.

Once available, this object is accessed via its methods.

WebEnvironments Methods

The WebEnvironments object supports the following methods:

method name description
createId create a new connection id for an environment
create create a new environment
get get a particular environment as identified by its connection id
remove remove a given environment
cleanup remove out-of-date environments -- ie. ones which were last accessed before the supplied threshold


createId

Create a new connection id for an environment.

Arguments: none

Return type: String


create

Create a new environment for the supplied connection id.

Arguments:

connectionIdString

Return type: WebEnvironment


get

Get a particular environment as identified by its connection id.

The return value is a List of two items:

  1. a LifetimeLock object which holds the lock on the environment until it is destroyed
  2. the desired environment

Arguments:

connectionIdString

Return type: List


remove

Remove the identified environment.

Arguments:

connectionIdString

Return type: Object


cleanup

Remove out-of-date environments -- ie. ones which were last accessed before the supplied threshold.

Arguments:

thresholdInteger

Return type: the empty List


Contents Index Current topic: Carapace Hub Related topics: objects