try { sa.shutDown(); } catch (Exception e) { }
    public String undeploy(String saName) throws Exception {        if (saName == null) {            throw ManagementSupport.failure("undeploy", "SA name must not be null");        }        ServiceAssemblyLifeCycle sa = registry.getServiceAssembly(saName);        if (sa == null) {            throw ManagementSupport.failure("undeploy", "SA has not been deployed: " + saName);        }        String state = sa.getCurrentState();        if (!DeploymentServiceMBean.SHUTDOWN.equals(state)) {            throw ManagementSupport.failure("undeploy", "SA must be shut down: " + saName);        }        try {            String result = null;            if (sa != null) {                String assemblyName = sa.getName();                registry.unregisterServiceAssembly(assemblyName);                File saDirectory = environmentContext.getSARootDirectory(assemblyName);                ServiceUnitLifeCycle[] sus = sa.getDeployedSUs();                if (sus != null) {                    for (int i = 0;i < sus.length; i++) {                        undeployServiceUnit(sus[i]);                    }                }                FileUtil.deleteFile(saDirectory);            }            return result;        } catch (Exception e) {            log.info("Unable to undeploy assembly", e);            throw e;        }    }