Re: [Smartfrog-support] Determinig deployment termination status

"Guijarro, Julio" <[email protected]> Wed, 23 Jan 2008 14:05:14 +0000
Newsgroups gmane.comp.java.smartfrog.user
Message-ID <C5494CF4D11D3E409910DBEEB7A9C48F158E1B4EBC@G5W0277.americas.hpqcorp.net>
We don't have any command line tool to do that but it would not be difficult to add one.

You could have a component that registers itself with the Termination Hooks and then either sends you a notification or terminates itself (and, and for example, you block on it until it terminates).

The termination hook sends information about the name of the component that has terminated and its termination record.

An example for of how to use the termination hooks is the Trace component: org/smartfrog/services/trace/SFTrace

    /** Terminate tracer. */
    private SfTerminateWithTracer sfTerminateWithTracer = new SfTerminateWithTracer();
...
//add hook
sfTerminateWithHooks.addHook(sfTerminateWithTracer);
...
//remove hook
sfTerminateWithHooks.removeHook(sfTerminateWithTracer);
...

//Example of listening to hook events.
   /**
     * Utility inner class- terminate tracer
     */
    private class SfTerminateWithTracer implements PrimHook {
    /**
     * sfHookAction for terminating
     *
     * @param prim prim component
     * @param terminationRecord TerminationRecord object
     *
     * @throws SmartFrogException in case of any error
     */
        public void sfHookAction(Prim prim, TerminationRecord terminationRecord)
            throws SmartFrogException {
            Date date = new Date(System.currentTimeMillis());
            try {
                prim.sfReplaceAttribute("sfTracesfTraceTerminateLifeCycle",date);
            } catch (RemoteException rex){
                printMsg(rex.toString(),null);
            }
            printMsgTerminate(getDN(prim), terminationRecord.errorType, terminationRecord.toString(), date);
        }
    }


Regards,

Julio

-----Original Message-----
From: smartfrog-support-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:smartfrog-support-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Dominik Pospisil
Sent: 23 January 2008 13:49
To: smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [Smartfrog-support] Determinig deployment termination status

Hello,

is there a way how to determine deployment termination status outside of SF
environment? I want to achaive something like this:

1) call sfStart shell script
2) block until component terminates
3) check component TerminationRecord (normal/abnormal)

Currently, I am periodically checking if component is still alive using
sfDiagnostics. But I am not able to catch component termination status. I can
easily do this by adding some notification code to sf components. But I
really want to implement this mechanism generally, working for all
components.

Thanks a lot,

- Dominik

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Smartfrog-support mailing list
Smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/smartfrog-support

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/