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:35] elisagat:tutorial:distribution [2009/01/29 15:42] 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 //permanently// disconnected remote far reference. The figure below shows a diagram of the different states of a leased reference. 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 //permanently// disconnected remote far reference. The figure below shows a diagram of the different states of a leased reference.
  
-{{ :at:tutorial:leasedref-state.png |:at:tutorial:leasedref-state.png}}+{{ :at:tutorial:leasedref-state.png |:at:tutorial:leasedref-state.png?160x30}}
  
 ====Working with leased object references==== ====Working with leased object references====
Line 231: Line 231:
 </note> </note>
  
-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 Offline Remote Objects ===== ===== Taking Offline Remote Objects =====
Line 246: Line 246:
    
 <note> <note>
-Leased object references make use of the ''takeOffline:'' primitive to terminate the access to a remote object once the lease time elapses. Note that the ''takeOffline'' primitive can be considered the equivalent to the so-called [[http://en.wikipedia.org/wiki/Manual_memory_management|''delete'' operation]] provided by some sequential languages without built-in local garbage collection.  Rather than using this primitive for garbage collection purposes, regular AmbientTalk developers are encouraged to make use of the high-level language constructs for leasing explained in the previous section which aids them to deal with both transient and permanent disconnections and properly reclaim their remote objects.+[[distribution#dealing_with_permanent_failures|Leased object references]] make use of the ''takeOffline:'' primitive to terminate the access to a remote object once the lease time elapses. Note that the ''takeOffline'' primitive can be considered the equivalent to the so-called [[http://en.wikipedia.org/wiki/Manual_memory_management|''delete'' operation]] provided by some sequential languages without built-in local garbage collection.  Rather than using this primitive for garbage collection purposes, regular AmbientTalk developers are encouraged to make use of the high-level language constructs for leasing explained in the previous section which aids them to deal with both transient and permanent disconnections and properly reclaim their remote objects.
 </note> </note>
  
Line 270: Line 270:
 </note> </note>
  
-====Distributed unit testing and ''takeOffline''====+====Distributed unit testing and takeOffline====
  
 As previously mentioned, the ''takeOffline'' primitive notifies connected virtual machines when taking an object offline. Since AmbientTalk 2.12, the primitive not only notifies remote virtual machines, but it also notifies the local virtual machine where the ''takeOffline'' was executed so that if any inner actor has local far references to that object, it will also get notified. In other words, if an object is taken offline, all actors holding far references to it (independent of their location) get notified.  As previously mentioned, the ''takeOffline'' primitive notifies connected virtual machines when taking an object offline. Since AmbientTalk 2.12, the primitive not only notifies remote virtual machines, but it also notifies the local virtual machine where the ''takeOffline'' was executed so that if any inner actor has local far references to that object, it will also get notified. In other words, if an object is taken offline, all actors holding far references to it (independent of their location) get notified. 
  
-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't simulate network disconnections as ''network.offline'' works at actor level. In other words, ''network.offline'' simulates a disconnection of the complete virtual machine, but it cannot simulate the disconnection of a particular actor inside the VM. By means of ''takeOffline'' primitive, you can cut the access of an object contained in any actor (within the same VM or a remote VM),  enabling the simulation of the disconnection of an actor inside a virtual machine.+This semantics are useful for unit test purposes. The [[appendix#unit_testing_framework|unit testing framework]] shipped with AmbientTalk has support to perform asynchronous invocations which can be used to perform concurrent or distributed unit tests. However, distributed unit tests couldn't simulate network disconnections as ''network.offline'' works at actor level. In other words, ''network.offline'' simulates a disconnection of the complete virtual machine, but it cannot simulate the disconnection of a particular actor inside the VM. By means of ''takeOffline'' primitive, you can cut the access of an object contained in any actor (within the same VM or a remote VM),  enabling the simulation of the disconnection of an actor inside a virtual machine.
at/tutorial/distribution.txt · Last modified: 2009/01/30 16:13 by tvcutsem