/** * Returns a pre-existing <code>ILockableEntityGroup</code> or null if the group is not found. */ @Override public ILockableEntityGroup findGroupWithLock(String key, String owner, int secs) throws GroupsException { throwExceptionIfNotInternallyManaged(); Class groupType = ICompositeGroupService.GROUP_ENTITY_TYPE; try { IEntityLock lock = (secs == 0) ? EntityLockService.instance().newWriteLock(groupType, key, owner) : EntityLockService.instance() .newWriteLock(groupType, key, owner, secs); ILockableEntityGroup group = groupFactory.findLockable(key); if (group == null) { lock.release(); } else { group.setLock(lock); group.setLocalGroupService(this); } return group; } catch (LockingException le) { throw new GroupsException("Problem getting lock for group " + key, le); } }
/** * Returns a pre-existing <code>ILockableEntityGroup</code> or null if the group is not found. */ @Override public ILockableEntityGroup findGroupWithLock(String key, String owner, int secs) throws GroupsException { throwExceptionIfNotInternallyManaged(); Class groupType = ICompositeGroupService.GROUP_ENTITY_TYPE; try { IEntityLock lock = (secs == 0) ? EntityLockService.instance().newWriteLock(groupType, key, owner) : EntityLockService.instance() .newWriteLock(groupType, key, owner, secs); ILockableEntityGroup group = groupFactory.findLockable(key); if (group == null) { lock.release(); } else { group.setLock(lock); group.setLocalGroupService(this); } return group; } catch (LockingException le) { throw new GroupsException("Problem getting lock for group " + key, le); } }