From: Guijarro, J. <jul...@hp...> - 2008-01-23 14:06:39
|
We don't have any command line tool to do that but it would not be difficul= t 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 fo= r 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 =3D new SfTerminate= WithTracer(); ... //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 terminationRe= cord) throws SmartFrogException { Date date =3D new Date(System.currentTimeMillis()); try { prim.sfReplaceAttribute("sfTracesfTraceTerminateLifeCycle",= date); } catch (RemoteException rex){ printMsg(rex.toString(),null); } printMsgTerminate(getDN(prim), terminationRecord.errorType, ter= minationRecord.toString(), date); } } Regards, Julio -----Original Message----- From: sma...@li... [mailto:smartfrog-sup= por...@li...] On Behalf Of Dominik Pospisil Sent: 23 January 2008 13:49 To: sma...@li... 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 c= an 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 Sma...@li... https://lists.sourceforge.net/lists/listinfo/smartfrog-support |