Once an object is delivered to its recipient, it is notified by delivered_to() or by delivery_failed() in case the delivery failed.
virtual void Object::delivered_to ( WeakPointer< Object > destination_object, const STime & delivery_time ); virtual void Object::delivery_failed ( DeliveryFailure failure, const STime & delivery_time ); |
The delivered_to() method is called if the migrated object is successfully delivered to the destination_object.
The delivery_failed() method is called if the migration failed for some reason.
The destination_object and the delivery_time are the arguments passed to the functions migrate_to(), schedule_to() and deliver_asap_to() when a migration is requested.
If the migration has been successful, the Core ensures that the destination_object pointer points to a local object (object located on the same node) and thus it can be accessed directly by dereferencing the pointer. The pointer is weak and thus deliveries to local object replicas by deliver_asap_to() are possible (see Section 5.3.10, “Pointer Policies”). However it is ensured that if destination_object does not point to a replica it is internally strong-referenced from the Core. It is also ensured that this object is strong-referenced too.
If the migration has failed, the failure holds the failure reason.
Value | The migration failed because... |
---|---|
DESTINATION_NOT_ACCESSIBLE | The destination object is not accessible in the simulation. Either the object was already destroyed or the object didn't exist at all. |
EVENT_KILLED | The migration was cancelled. See description of schedule_to() mthod in Section 6.5, “Requesting Migration”. |