Пример #1
0
 public void setRetiredPackage(String packageName, boolean retired) {
   DeploymentUnitDir duDir = _deploymentUnits.get(packageName);
   if (duDir == null) throw new ContextException("Could not find package " + packageName);
   for (QName processName : duDir.getProcessNames()) {
     setState(
         toPid(processName, duDir.getVersion()),
         retired ? ProcessState.RETIRED : ProcessState.ACTIVE);
   }
 }
Пример #2
0
 public List<QName> listProcesses(String packageName) {
   _rw.readLock().lock();
   try {
     DeploymentUnitDir du = _deploymentUnits.get(packageName);
     if (du == null) return null;
     return toPids(du.getProcessNames(), du.getVersion());
   } finally {
     _rw.readLock().unlock();
   }
 }
Пример #3
0
  public Collection<QName> undeploy(final String duName) {
    try {
      exec(
          new Callable<Collection<QName>>() {
            public Collection<QName> call(ConfStoreConnection conn) {
              DeploymentUnitDAO dudao = conn.getDeploymentUnit(duName);
              if (dudao != null) dudao.delete();
              return null;
            }
          });
    } catch (Exception ex) {
      __log.error(
          "Error synchronizing with data store; " + duName + " may be reappear after restart!");
    }

    Collection<QName> undeployed = Collections.emptyList();
    DeploymentUnitDir du;
    _rw.writeLock().lock();
    try {
      du = _deploymentUnits.remove(duName);
      if (du != null) {
        undeployed = toPids(du.getProcessNames(), du.getVersion());
      }

      for (QName pn : undeployed) {
        fireEvent(new ProcessStoreEvent(ProcessStoreEvent.Type.UNDEPLOYED, pn, du.getName()));
        __log.info(__msgs.msgProcessUndeployed(pn));
      }

      _processes.keySet().removeAll(undeployed);
    } finally {
      _rw.writeLock().unlock();
    }

    return undeployed;
  }