Exemplo n.º 1
0
  /** Stop the archive. */
  public boolean stop(String name) {
    DeployController<?> controller = getDeployContainer().findController(keyToName(name));

    if (controller == null) {
      if (log.isLoggable(Level.FINE)) log.log(Level.FINE, L.l("unknown name '{0}'", name));

      if (log.isLoggable(Level.FINER))
        log.log(Level.FINER, L.l("known names are {0}", getNamesAsString()));

      return false;
    }

    controller.stop();
    return true;
  }
Exemplo n.º 2
0
  /** Undeploy the archive. */
  public boolean undeploy(String name) {
    DeployController<?> controller = getDeployContainer().findController(keyToName(name));

    if (controller == null) {
      if (log.isLoggable(Level.FINE)) log.log(Level.FINE, L.l("unknown name '{0}'", name));

      if (log.isLoggable(Level.FINER))
        log.log(Level.FINER, L.l("known names are {0}", getNamesAsString()));

      return false;
    }

    Path archivePath = getArchivePath(name);
    Path expandPath = getExpandPath(name);

    controller.stop();

    try {
      if (log.isLoggable(Level.FINEST)) log.log(Level.FINEST, L.l("deleting {0}", archivePath));

      archivePath.removeAll();
    } catch (IOException ex) {
      if (log.isLoggable(Level.FINE)) log.log(Level.FINE, ex.toString(), ex);
    }

    try {
      if (expandPath != null) {
        if (log.isLoggable(Level.FINEST)) log.log(Level.FINEST, L.l("deleting {0}", expandPath));

        expandPath.removeAll();
      }
    } catch (IOException ex) {
      if (log.isLoggable(Level.FINE)) log.log(Level.FINE, ex.toString(), ex);
    }

    getDeployContainer().update(keyToName(name));

    return true;
  }