code: @Override
  	public TargetProperties lockAndGetTarget( Application app, Instance scopedInstance )
  	throws IOException {
  
  		String instancePath = InstanceHelpers.computeInstancePath( scopedInstance );
  		String targetId = findTargetId( app, instancePath );
  		if( targetId == null )
  			throw new IOException( "No target was found for " + app + " :: " + instancePath );
  
  		InstanceContext mappingKey = new InstanceContext( app, instancePath );
  		synchronized( LOCK ) {
  			saveUsage( mappingKey, targetId, true );
  		}
  
  		this.logger.fine( "Target " + targetId + "'s lock was acquired for " + instancePath );
  		TargetProperties result = findTargetProperties( app, instancePath );
  		Map<String,String> newTargetProperties = TargetHelpers.expandProperties( scopedInstance, result.asMap());
  
  		result.asMap().clear();
  		result.asMap().putAll( newTargetProperties );
  
  		return result;
  	}
docs: Atomic operations...