sfTerminate(new TerminationRecord( "management action", "forced to terminate", targetName));
sfTerminate(new TerminationRecord("normal", "External Management Action", targetName));
    public static void terminateNamedApplications(OptionSet opts,        ProcessCompound target) {        for (Enumeration terms = opts.terminations.elements();                terms.hasMoreElements();) {            String term = (String) terms.nextElement();            Reference targetName = null;            try {                targetName = (((Prim) target).sfCompleteName());            } catch (Exception ex) {                //ignore  //TODO: Check            }            try {                ((Prim) target.sfResolveHere(term)).                        sfTerminate(new TerminationRecord(                                "management action", "forced to terminate", targetName));            } catch (ClassCastException cce) {                errorTermination = true;                try {                    if (term.equals("rootProcess")) {                        ((Prim) target.sfResolve((Reference) target.                                sfResolveHere(term))).                                sfTerminate(new TerminationRecord(                                        "management action",                                        "sfDaemon forced to terminate ", targetName));                    }                } catch (Exception ex) {                    //TODO: Check exception handling                    if ((ex.getCause() instanceof java.net.SocketException) ||                             (ex.getCause() instanceof java.io.EOFException)){                       Logger.log(MessageUtil.formatMessage(MSG_SF_TERMINATED));                    } else {                        Logger.log(ex);                    }                }            } catch (Exception e) {                errorTermination  = true;                Logger.log(MessageUtil.formatMessage(MSG_ERR_TERM, term));                // log stack trace                Logger.log(e);            }        }    }