JoobContexts, Sessions, and JoobConnections
Each client node has a pool of Jade sessions, providing an interface to the Jade Object Manager and Jade database.
A process thread attaches to an available Jade session by creating a JoobContext object. The thread is detached from the Jade session when the JoobContext object is disposed.
A JoobContext object interacts with a Jade session using a JoobConnection object. JoobConnection objects are typically created and disposed of automatically with their owning JoobContext object. In many scenarios, users will not have to explicitly interact with JoobConnection objects.
The C# JoobSession, JoobNode, and JoobSystem classes are the wrappers for the Jade Object Manager Process, Node, and System classes, respectively. When a JoobContext or a JoobConnection class is created for first time, the Jade Object Manager initialize process occurs and a pool of Jade Object Manager process agents is created (the default value is 10).
When your code gets a new JoobContext (depending on overload), a new JoobConnection is created, which obtains a Jade Object Manager process agent from the pool.
The JoobContext is the primary way of interacting with a process agent; for example, for retrieval of a specific instance, locking, notifications, and so on.
When the JoobContext is disposed of (explicitly or by a using block), the Jade Object Manager process agent is put back in the pool. A JoobContext provides access to the JoobSession object, if needed. It can be obtained with JoobContext.GetSystemVariables().Process to make the ObjectId available, which JoobContext.FindInstance<JoobSession>(ObjectId); can then retrieve. The grace period is the amount of time given to the process running on the node to complete and dispose of any JoobContexts before the node is terminated and the Jade Object Manager starts terminating the process agents. (The TimeSpan wait time is usually in the range 5 through 30 seconds, depending on the size and structure of your system.) For an example, see "Locking", in Chapter 7.
The C# JoobObject class (and all of its subclasses) has an ObjectId property, which is equivalent to the Jade Object Manager objects oid.