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:38] elisagat:tutorial:distribution [2009/01/29 15:46] 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 227: Line 227:
 import /.at.lang.leasedrefs; import /.at.lang.leasedrefs;
 </code> </code>
-<note>+<note warning>
 leasedrefs module exports support primitives to manipulate time intervals (i.e. ''minutes'', ''seconds'', ''millisecs'') so that you do not need to explicitly import the timer module. Remember to exclude those methods from the leasedrefs import statement if some other module has already imported them, e.g. if futures are enabled. leasedrefs module exports support primitives to manipulate time intervals (i.e. ''minutes'', ''seconds'', ''millisecs'') so that you do not need to explicitly import the timer module. Remember to exclude those methods from the leasedrefs import statement if some other module has already imported them, e.g. if futures are enabled.
 </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 243: Line 243:
 </code> </code>
  
-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.
    
 <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>
  
at/tutorial/distribution.txt · Last modified: 2009/01/30 16:13 by tvcutsem