A system and method for providing message-based leasing of resources in a distributed
computing environment. Services may issue leases to clients and provide operations
on those leases. The lease functionality of a service may be defined in an XML
message schema. Gates may be used to perform lease operations. Leases may be granted
for a period that may be negotiated. Leasing messages for performing leasing operations
may be defined. The leasing messages may include messages to renew a lease and
to cancel a lease. Services may specify an address where leasing messages may be
sent. A lease renewal mechanism may be provided in which a gate may receive lease
renewal messages and automatically respond to them. A mechanism to detect stale
advertisements in a space may be provided. When a service publishes its advertisement
in a space, the service obtains a lease on the publishing of its advertisement.
Each advertisement may include a time by which the service may renew the advertisement.
When the lease is not renewed, the space service marks the service advertisement
as stale. Services renew advertisements by sending a renewal message to the space.
Stale service advertisements may be deleted after a period. A space service may
allow clients to lease service advertisements in the space to thus grant clients
access to the services. Messages are described for accessing the leasing services
provided by the space services.