final Lock lock = this.lockManager.getLock(idStr);
try {
lock.lockInterruptibly();
} catch (InterruptedException e) {
throw new ManageException(e.getMessage(), e);
}
try {
resource.setID(idStr);
resource.setCreatorID(creatorID);
this.persistence.addEnsemble(resource);
final Element el = this.cache.get(idStr);
if (el == null) {
this.cache.put(new Element(idStr, resource));
} else {
throw new ManageException("UUID collision in groups cache, " +
"ID '" + idStr + "' already exists (seriously?)");
}
} finally {
lock.unlock();