User Tools

Site Tools


at:tutorial:distribution

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
at:tutorial:distribution [2009/01/29 15:19] elisagat:tutorial:distribution [2009/01/29 15:21] elisag
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 ''when:disconnected:'' observers. Disconnected observers get triggered since the taking offline event is considered as a logical disconnection between two devices. However, an object taken offline is removed from the export table and thus, it cannot go online anymore. As a result, the disconnected and reconnected observers will be no longer trigger for that remote far reference. +Clients can get notified when an object is taken offline by means of ''when:disconnected:'' observers. Disconnected observers get triggered since the taking offline event is considered as a logical disconnection between two devices. However, once an object taken offline is removed from the export table, it cannot go online anymore. As a result, the disconnected and reconnected observers will be no longer trigger for that remote far reference. 
  
 Additionally, AmbientTalk provides dedicated takenOffline observers which get triggered only once when the object is taken offline. They are installed similarly to when:disconnected observers as follows: Additionally, AmbientTalk provides dedicated takenOffline observers which get triggered only once when the object is taken offline. They are installed similarly to when:disconnected observers as follows:
  
 +<code>
 when: messenger takenOffline: { when: messenger takenOffline: {
   system.println("Buddy offline: " + name);   system.println("Buddy offline: " + name);
   //clean certain resources associated to the buddy   //clean certain resources associated to the buddy
 }; };
 +</code>
  
 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. ''when:takenOffline'' can be considered as a special kind of ''when:disconnected'' observers which are triggered only in case of "logical" disconnection, but not in cases of network disconnections. 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. ''when:takenOffline'' can be considered as a special kind of ''when:disconnected'' observers which are triggered only in case of "logical" disconnection, but not in cases of network disconnections.
at/tutorial/distribution.txt · Last modified: 2009/01/30 16:13 by tvcutsem