The ReservationManager coordinates
org.cougaar.core.blackboard.Distributor persistence to ensure
that only one agent can persist at a time, and that an agent
preparing to persist will not block other agents from
persisting.
Persistence reservations indicate that a persistence instance
wishes to take a snapshot of its agent. The reservations are held
in a queue (FIFO). When a persistence instance reaches the head of
the queue it has exclusive use of the persistence mechanism. The
reservation will only be held for a certain interval and if not
exercised or re-confirmed within that interval, it is cancelled.
During this interval, the agent should be getting itself into a
well-defined state so the persistence snapshot will be valid.
If at any time after reaching the head of the queue (and trying to
reach a well-defined state), an agent discovers that its
reservation has been cancelled, it should abandon its attempt to
reach a well-defined state, continue execution, and try again
later.
If a ReservationManager is created with a timeout of 0, the manager
is effectively disabled. This means that all requests and commits
are satisfied unconditionally, and waitFor and release return
immediately and do nothing. Also no storage is allocated.
|