at:tutorial:distribution
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
at:tutorial:distribution [2009/01/28 17:41] – elisag | at:tutorial:distribution [2009/01/28 17:52] – elisag | ||
---|---|---|---|
Line 116: | Line 116: | ||
A leased object reference is a remote far reference that grants access to a remote object for a limited period of time. When the time period has elapsed, the access to the remote object is terminated and the leased reference is said to //expire//. Similarly to remote far references, a leased reference abstracts client objects from the actual network connection state. Client objects can send a message to the remote object even if a leased references is disconnected at that time. Message are accumulated in order to be transmitted when the reference becomes reconnected. When the leased reference expires it, messages are discarded since an expired leased reference behaves as a // | A leased object reference is a remote far reference that grants access to a remote object for a limited period of time. When the time period has elapsed, the access to the remote object is terminated and the leased reference is said to //expire//. Similarly to remote far references, a leased reference abstracts client objects from the actual network connection state. Client objects can send a message to the remote object even if a leased references is disconnected at that time. Message are accumulated in order to be transmitted when the reference becomes reconnected. When the leased reference expires it, messages are discarded since an expired leased reference behaves as a // | ||
- | {{: | + | {{ : |
====Working with leased object references==== | ====Working with leased object references==== | ||
- | The code snippet below illustrates a leased far reference in the context of an online shopping application. In the example, a client object can ask a server to start a shopping session by sending it the openSession message. In response to this message, the server returns a new session object which implements methods that allow a client to place items in its shopping cart or to check out. The returned session gets leased by means of the lease:for: construct. | + | The code snippet below illustrates a leased far reference in the context of an online shopping application. In the example, a client object can ask a server to start a shopping session by sending it the '' |
< | < | ||
Line 134: | Line 134: | ||
</ | </ | ||
- | The lease:for: construct takes as parameters a time interval (in milliseconds) and the remote object to which it grants access, and returns a leased far reference that remains valid for the indicated time interval (5 minutes in the example). The construct | + | The '' |
+ | |||
+ | < | ||
+ | We assume the use of futures to get the return value of the '' | ||
+ | </ | ||
At client side, a customer can ask a server to open a shopping session as follows: | At client side, a customer can ask a server to open a shopping session as follows: | ||
Line 144: | Line 148: | ||
</ | </ | ||
- | The future attached to the openSession message will be resolved with a leased reference to a session object which remains valid for the next 5 minutes. From that moment on, the client can use the leased reference as if it were the session object itself until it expires. Similar to far references, client objects can only send messages to service | + | The future attached to the '' |
< | < | ||
Line 151: | Line 155: | ||
</ | </ | ||
- | The renew: construct requests a prolongation of the specified leased reference with a new interval of time which can be different than the initial time. The revoke: construct cancels the given leased reference. Cancelling a lease is in a sense analogous to a natural expiration of the lease, but it requires communication between the client and server side of the leased reference. | + | The '' |
- | When no renewal is performed due to a network partition outlasting the lease time period or in absence of utilization, | + | When no renewal is performed due to a network partition outlasting the lease time period or in absence of utilization, |
< | < |
at/tutorial/distribution.txt · Last modified: 2009/01/30 16:13 by tvcutsem