Source:
public void create(final String identifier, final ServerSideConfiguration config) throws EntityAlreadyExistsException, ClusterTierManagerCreationException, EntityBusyException, TimeoutException { Hold existingMaintenance = maintenanceHolds.get(identifier); Hold localMaintenance = null; if (existingMaintenance == null) { localMaintenance = createAccessLockFor(identifier).tryWriteLock(); } if (existingMaintenance == null && localMaintenance == null) { throw new EntityBusyException("Unable to create cluster tier manager for id " + identifier + ": another client owns the maintenance lease"); } boolean finished = false; try { EntityRef<InternalClusterTierManagerClientEntity, ClusterTierManagerConfiguration, Object> ref = getEntityRef(identifier); try { while (true) { ref.create(new ClusterTierManagerConfiguration(identifier, config)); try { InternalClusterTierManagerClientEntity entity = ref.fetchEntity(null); try { entity.setTimeouts(entityTimeouts); finished = true; return; } finally { if (finished) { entity.close(); } else { silentlyClose(entity, identifier); } } } catch (EntityNotFoundException e) { } } } catch (EntityConfigurationException e) { throw new ClusterTierManagerCreationException("Unable to configure cluster tier manager for id " + identifier, e); } catch (EntityNotProvidedException e) { LOGGER.error("Unable to create cluster tier manager for id {}", identifier, e); throw new AssertionError(e); } catch (EntityVersionMismatchException e) { LOGGER.error("Unable to create cluster tier manager for id {}", identifier, e); throw new AssertionError(e); } } finally { if (localMaintenance != null) { if (finished) { localMaintenance.unlock(); } else { silentlyUnlock(localMaintenance, identifier); } } } }

Target:
public void create(final String identifier, final ServerSideConfiguration config) throws EntityAlreadyExistsException, ClusterTierManagerCreationException, EntityBusyException, TimeoutException { Hold existingMaintenance = maintenanceHolds.get(identifier); Hold localMaintenance = null; if (existingMaintenance == null) { localMaintenance = createAccessLockFor(identifier).tryWriteLock(); } if (existingMaintenance == null && localMaintenance == null) { throw new EntityBusyException("Unable to create cluster tier manager for id " + identifier + ": another client owns the maintenance lease"); } boolean finished = false; try { EntityRef<InternalClusterTierManagerClientEntity, ClusterTierManagerConfiguration, Void> ref = getEntityRef(identifier); try { while (true) { ref.create(new ClusterTierManagerConfiguration(identifier, config)); try { InternalClusterTierManagerClientEntity entity = ref.fetchEntity(null); try { entity.setTimeouts(entityTimeouts); finished = true; return; } finally { if (finished) { entity.close(); } else { silentlyClose(entity, identifier); } } } catch (EntityNotFoundException e) { } } } catch (EntityConfigurationException e) { throw new ClusterTierManagerCreationException("Unable to configure cluster tier manager for id " + identifier, e); } catch (EntityNotProvidedException e) { LOGGER.error("Unable to create cluster tier manager for id {}", identifier, e); throw new AssertionError(e); } catch (EntityVersionMismatchException e) { LOGGER.error("Unable to create cluster tier manager for id {}", identifier, e); throw new AssertionError(e); } } finally { if (localMaintenance != null) { if (finished) { localMaintenance.unlock(); } else { silentlyUnlock(localMaintenance, identifier); } } } }