2.5.4.2.4 Manage Server Object Lifetime by Using a Sponsor Object
Goal: A client application extends the lifetime of a Server Object by using a Sponsor Object.
Context of Use: A client application extends the lifetime of a Client-Activated Object (CAO) to avoid the unmarshaling of the object so that it can invoke a method of the Server Object efficiently at a later point.
Primary Actor: The primary actor is the client application.
Supporting Actors: The supporting actors are as follows:
Remoting Server: The server application where the remote object resides. The remoting server hosts the RemoteActivationService service, which is used to activate Client-Activated Objects. It also manages the Lease Object, which is associated with every Client-Activated Object.
Sponsor Object: A Sponsor object can specify whether the Server Object's Time-To-Live (TTL) has to be extended, and can specify the duration of the extension.
Preconditions:
The client system and remote system have negotiated the encoding to be used.
The client application has obtained the Server Object Reference of the Client-Activated Object.
Main Success Scenario:
The client application calls the Client-Activated Object's GetLifetimeService remote method.
The remoting server returns a Server Object Reference to the Lease Object for the Server Object.
The client application registers a Sponsor object by using the Register method of the returned Lease Object.
The client application makes no call to the Client-Activated Object, and the lease of Client-Activated Object expires.
When the Client-Activated Object's TTL is over, the Lease Object sends a Renewal request to the Sponsor object.
The Sponsor object returns a Renewal response to the Lease Object, and the lease is extended.
Minimal Guarantees: The Client-Activated Object's Time-To-Live (TTL) is not extended.
Success Guarantee: The TTL value of the Client-Activated Object is increased.