@Override
  public synchronized ServiceResult<Deployment> undeployByFileName(String fileName) {
    try {
      logger.debug("Deployments List size before undeploy: {}", deployments.size());
      logger.debug("File being undeployed: {}", fileName);

      jarDeployer.deleteAllVersionsOfJar(fileName);

      String artifactId = JarFileUtils.getArtifactId(fileName);

      Deployment deployment = deployments.get(artifactId);
      if (deployment == null || !deployment.getFileName().equals(fileName)) {
        return Failure.of(fileName + " not deployed");
      }

      Deployment removedDeployment = deployments.remove(artifactId);
      logger.debug("Removed Deployment: {}", removedDeployment);
      logger.debug("Deployments List size after remove: {}", deployments.size());
      String undeployedPath =
          jarDeployer.undeploy(JarFileUtils.getArtifactId(removedDeployment.getFileName()));
      logger.debug("Jar at path: {} removed by JarDeployer", undeployedPath);
      functionToFileTracker.unregisterFunctionsForDeployment(removedDeployment.getFileName());
      return Success.of(removedDeployment);
    } catch (IOException e) {
      return Failure.of(e);
    } finally {
      flushCaches();
    }
  }
Implementation of {@link JarDeploymentService} that encapsulates the standard method of deploying
jars by delegating to the {@link JarDeployer}.

@since Geode 1.15
geode-deployment/geode-deployment-legacy/src/main/java/org/apache/geode/deployment/internal/legacy/LegacyJarDeploymentService.java