From: Julio G. <ju...@us...> - 2004-04-06 14:41:52
|
Update of /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29726/src/org/smartfrog/sfcore/common Modified Files: ActionDetach.java ActionDetachAndTerminate.java ActionTerminate.java SmartFrogCoreKeys.java Log Message: Some improvements in error handleing. Not complete yet. Index: ActionDetachAndTerminate.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/common/ActionDetachAndTerminate.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ActionDetachAndTerminate.java 24 Mar 2004 17:59:24 -0000 1.3 --- ActionDetachAndTerminate.java 6 Apr 2004 14:28:58 -0000 1.4 *************** *** 41,58 **** */ public static Prim DetachAndTerminate(String name, ProcessCompound targetP) ! throws SmartFrogResolutionException, RemoteException { Prim targetC=(Prim) targetP.sfResolveWithParser(name); boolean isRootProcess = false; ! if (targetC instanceof ProcessCompound) { ! isRootProcess = ((ProcessCompound)targetC).sfIsRoot(); ! } ! try { ! targetC.sfDetachAndTerminate(new TerminationRecord(TerminationRecord.NORMAL, "External Management Action", targetP.sfCompleteName())); ! } catch (RemoteException ex) { ! HandleTerminationException(ex, isRootProcess); ! } ! return targetC; } --- 41,64 ---- */ public static Prim DetachAndTerminate(String name, ProcessCompound targetP) ! throws SmartFrogException, RemoteException { Prim targetC=(Prim) targetP.sfResolveWithParser(name); boolean isRootProcess = false; ! try { ! if (targetC instanceof ProcessCompound) { ! isRootProcess = ((ProcessCompound)targetC).sfIsRoot(); ! } ! try { ! targetC.sfDetachAndTerminate(new TerminationRecord( ! TerminationRecord.NORMAL, "External Management Action", targetP.sfCompleteName())); ! } catch (RemoteException ex) { ! HandleTerminationException(ex, isRootProcess); ! } ! return targetC; ! } catch (Throwable thr) { ! throw SmartFrogException.forward(thr); ! } ! } Index: SmartFrogCoreKeys.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/common/SmartFrogCoreKeys.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SmartFrogCoreKeys.java 6 Apr 2004 13:15:56 -0000 1.4 --- SmartFrogCoreKeys.java 6 Apr 2004 14:28:58 -0000 1.5 *************** *** 103,107 **** /** ! * Attributed that determines the resolution root of a SmartFrog description */ public final static String SF_CONFIG="sfConfig"; --- 103,107 ---- /** ! * Attribute that determines the resolution root of a SmartFrog description */ public final static String SF_CONFIG="sfConfig"; Index: ActionDetach.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/common/ActionDetach.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ActionDetach.java 24 Mar 2004 17:59:24 -0000 1.3 --- ActionDetach.java 6 Apr 2004 14:28:58 -0000 1.4 *************** *** 39,45 **** public static Prim Detach(String name, ProcessCompound targetP) throws SmartFrogException, RemoteException { ! Prim targetC=(Prim) targetP.sfResolveWithParser(name); ! targetC.sfDetach(); ! return targetC; } --- 39,49 ---- public static Prim Detach(String name, ProcessCompound targetP) throws SmartFrogException, RemoteException { ! try { ! Prim targetC = (Prim)targetP.sfResolveWithParser(name); ! targetC.sfDetach(); ! return targetC; ! } catch (Throwable thr) { ! throw SmartFrogException.forward(thr); ! } } Index: ActionTerminate.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/common/ActionTerminate.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ActionTerminate.java 24 Mar 2004 17:59:24 -0000 1.3 --- ActionTerminate.java 6 Apr 2004 14:28:58 -0000 1.4 *************** *** 41,58 **** */ public static Prim sfTerminate(String name, ProcessCompound targetP) ! throws SmartFrogResolutionException, RemoteException { ! Prim targetC=(Prim) targetP.sfResolveWithParser(name); ! boolean isRootProcess = false; ! if (targetC instanceof ProcessCompound) { ! isRootProcess = ((ProcessCompound)targetC).sfIsRoot(); ! } ! try { ! targetC.sfTerminate(new TerminationRecord(TerminationRecord.NORMAL, ! "External Management Action", ! targetP.sfCompleteName())); ! } catch (RemoteException ex) { ! HandleTerminationException(ex, isRootProcess); ! } ! return targetC; } --- 41,70 ---- */ public static Prim sfTerminate(String name, ProcessCompound targetP) ! throws SmartFrogException, RemoteException { ! Prim targetC; ! ! try { ! if (name==null) { ! targetC = targetP; ! } else { ! targetC = (Prim)targetP.sfResolveWithParser(name); ! ! } ! boolean isRootProcess = false; ! if (targetC instanceof ProcessCompound) { ! isRootProcess = ((ProcessCompound)targetC).sfIsRoot(); ! } ! try { ! targetC.sfTerminate(new TerminationRecord(TerminationRecord. ! NORMAL, ! "External Management Action", ! targetP.sfCompleteName())); ! } catch (RemoteException ex) { ! HandleTerminationException(ex, isRootProcess); ! } ! return targetC; ! } catch (Throwable thr) { ! throw SmartFrogException.forward(thr); ! } } |