obj = (Prim)target;
while (st.hasMoreTokens()) { token = st.nextToken(); obj = ((Prim)obj.sfResolveHere(token)); } obj.sfDetachAndTerminate(tr); detachCount++;
    public static void detachAndTerminateNamedComponents(OptionSet opts,        ProcessCompound target) {            Prim obj = null;            try {                    obj = (Prim)target;            } catch (Exception e) {                errorTermination  = true;                Logger.log(MessageUtil.formatMessage(MSG_ERR_TERM, target));                // log stack trace                Logger.log(e);            }            StringTokenizer st = null;            String token = null;            TerminationRecord tr = new TerminationRecord(TerminationRecord.NORMAL,                    "External Management Action", null);            for (Enumeration detachs = opts.detaching.elements();                detachs.hasMoreElements();) {                     String detach = (String) detachs.nextElement();                     st = new StringTokenizer(detach, ":");                     try {                             while (st.hasMoreTokens()) {                                     token = st.nextToken();                                     obj = ((Prim)obj.sfResolveHere(token));                             }                             obj.sfDetachAndTerminate(tr);                     } catch (Exception e) {                             errorTermination  = true;                             Logger.log(MessageUtil.formatMessage(                                                       MSG_ERR_TERM,token));                             // log stack trace                             Logger.log(e);                     }            }    }