Exemplo n.º 1
0
 public Long incrMaxSeq(MucRoom room) {
   Lock lock = roomLockSet.getLock(room.getId());
   try {
     lock.lock();
     room.setMaxSeq(room.getMaxSeq() + 1);
     upadte(room);
     return room.getMaxSeq();
   } finally {
     lock.unlock();
   }
 }
Exemplo n.º 2
0
 public void addOccupants(MucRoom room, Set<MucOccupant> occupants) {
   Preconditions.checkArgument(room.getId() != null);
   for (MucOccupant occupant : occupants) {
     occupant.setRoom(room);
     occupant.setId(null);
     occupant.setReadSeq(room.getMaxSeq());
   }
   oDao.save(occupants);
 }