public void closeAllRuntimeManagers() {

    for (DeployedUnit deployedUnit : deploymentService.getDeployedUnits()) {
      deployedUnit.getRuntimeManager().close();
      undeploymentEvent.fire(
          new DeploymentEvent(deployedUnit.getDeploymentUnit().getIdentifier(), deployedUnit));
    }
  }
  /**
   * Returns <code>RuntimeManager</code> instance for given deployment unit (kjar)
   *
   * @param deploymentId unique identifier of unit (kjar)
   * @return null if no RuntimeManager available for given id
   */
  public RuntimeManager getRuntimeManager(String deploymentId) {

    DeployedUnit deployedUnit = deploymentService.getDeployedUnit(deploymentId);
    if (deployedUnit == null) {
      return null;
    }

    return deployedUnit.getRuntimeManager();
  }