/**
   * Adds group reservation to this partition.
   *
   * @param r Reservation.
   * @return {@code false} If such reservation already added.
   */
  public boolean addReservation(GridDhtPartitionsReservation r) {
    assert state.getReference() != EVICTED : "we can reserve only active partitions";
    assert state.getStamp() != 0
        : "partition must be already reserved before adding group reservation";

    return reservations.addIfAbsent(r);
  }
 /** @param r Reservation. */
 public void removeReservation(GridDhtPartitionsReservation r) {
   if (!reservations.remove(r))
     throw new IllegalStateException("Reservation was already removed.");
 }
Exemple #3
0
 public void unregisterListener(ProcessStoreListener psl) {
   __log.debug("Unregistering listener " + psl);
   _listeners.remove(psl);
 }
Exemple #4
0
 public void registerListener(ProcessStoreListener psl) {
   __log.debug("Registering listener " + psl);
   _listeners.add(psl);
 }