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/29 15:10] – revision elisag | at:tutorial:distribution [2009/01/29 22:10] – * elisag | ||
---|---|---|---|
Line 19: | Line 19: | ||
</ | </ | ||
- | ===== Exporting and discovering objects | + | ===== Exporting and Discovering Objects |
AmbientTalk provides language support to make some objects available to other objects residing in remote actors by means of the '' | AmbientTalk provides language support to make some objects available to other objects residing in remote actors by means of the '' | ||
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==== | ||
Line 227: | Line 227: | ||
import / | import / | ||
</ | </ | ||
- | < | + | < |
leasedrefs module exports support primitives to manipulate time intervals (i.e. '' | leasedrefs module exports support primitives to manipulate time intervals (i.e. '' | ||
</ | </ | ||
- | More information pertaining to the API of the leased references language module can be found in the appendix. | + | More information pertaining to the API of the leased references language module can be found in the [[appendix|appendix]]. |
- | ===== Taking | + | ===== Taking |
- | AmbientTalk distributed memory management scheme has been based on reference listing and network objects. Similar to these techniques, remote far references are implemented by means of a proxy at client-side, | + | AmbientTalk distributed memory management scheme has been based on [[http:// |
- | As previously explained, in order to deal with volatile connections, | + | As previously explained, in order to deal with volatile connections, |
< | < | ||
Line 243: | Line 243: | ||
</ | </ | ||
- | The primitive takes as parameter an object which is removed from the export table of the actor where the code is executed. When the object is removed from the export table, all remote far reference to the object become invalidated and the object no longer belongs to the set of root objects and as such, it can be eventually reclaimed by Java's local garbage collector once it is no longer locally referenced. Although the actual reclamation of an unexported object may be triggered at a later point in time, any attempt to access via a remote far reference results in an ObjectOffline exception notifying the client object that the object was taken offline and thus, the remote far references is invalid. | + | The primitive takes as parameter an object which is removed from the export table of the actor where the code is executed. When the object is removed from the export table, all remote far reference to the object become invalidated and the object no longer belongs to the set of root objects and as such, it can be eventually reclaimed by Java's local garbage collector once it is no longer locally referenced. Although the actual reclamation of an unexported object may be triggered at a later point in time, any attempt to access via a remote far reference results in an ObjectOffline exception notifying the client object that the object was taken offline and thus, its remote far references is invalid. |
- | < | + | < |
- | Leased object references make use of the takeOffline: | + | [[distribution# |
</ | </ | ||
Line 253: | Line 253: | ||
On the client side, taking offline an object results in a permanent disconnection of the remote far references pointing to it. In other words, despite having network connection, unexporting an object renders remote far references permanently disconnected. This implies that client have to deal explicitly with unexported objects. | On the client side, taking offline an object results in a permanent disconnection of the remote far references pointing to it. In other words, despite having network connection, unexporting an object renders remote far references permanently disconnected. This implies that client have to deal explicitly with unexported objects. | ||
- | Clients can get notified when an object is taken offline by means of '' | + | Clients can get notified when an object is taken offline by means of '' |
Additionally, | Additionally, | ||
+ | < | ||
when: messenger takenOffline: | when: messenger takenOffline: | ||
system.println(" | system.println(" | ||
//clean certain resources associated to the buddy | //clean certain resources associated to the buddy | ||
}; | }; | ||
+ | </ | ||
- | + | The construct takes as parameter a far reference and a block of code that is executed when the taken offline event is notified to the virtual machine. '' | |
- | The construct takes as parameter a far reference and a block of code that is executed when the taken offline event is notified to the virtual machine. '' | + | |
< | < | ||
Line 269: | Line 270: | ||
</ | </ | ||
- | ====Distributed unit testing and '' | + | ====Distributed unit testing and takeOffline==== |
- | As previously mentioned, the '' | + | As previously mentioned, the '' |
- | This semantics are useful for unit test purposes. The unit testing framework shipped with AmbinentTalk has support to perform asynchronous invocations which can be used to perform concurrent or distributed unit tests. However, distributed unit tests couldn' | + | |
+ | These semantics is useful for unit test purposes. The [[appendix# | ||
- | < | + | By means of the '' |
- | The complete implementation | + | |
- | </ | + |
at/tutorial/distribution.txt · Last modified: 2009/01/30 16:13 by tvcutsem