certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

certi RTIA/FederationManagement.cc RTIA/RTIA_fe...


From: certi-cvs
Subject: certi RTIA/FederationManagement.cc RTIA/RTIA_fe...
Date: Fri, 01 Feb 2008 14:12:23 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     ROUSSELOT <rousse>      08/02/01 14:12:23

Modified files:
        RTIA           : FederationManagement.cc RTIA_federate.cc 
                         RTIA_network.cc 
        RTIG           : Federation.cc FederationsList.cc 
                         RTIG_processing.cc 
        libCERTI       : NetworkMessage_RW.cc 
        libRTI         : RTIambassador.cc 

Log message:
        Restore Federation implementation (to be continued)...

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/FederationManagement.cc?cvsroot=certi&r1=3.40&r2=3.41
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA_federate.cc?cvsroot=certi&r1=3.58&r2=3.59
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA_network.cc?cvsroot=certi&r1=3.18&r2=3.19
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.cc?cvsroot=certi&r1=3.76&r2=3.77
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/FederationsList.cc?cvsroot=certi&r1=3.49&r2=3.50
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG_processing.cc?cvsroot=certi&r1=3.48&r2=3.49
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage_RW.cc?cvsroot=certi&r1=3.40&r2=3.41
http://cvs.savannah.gnu.org/viewcvs/certi/libRTI/RTIambassador.cc?cvsroot=certi&r1=3.63&r2=3.64

Patches:
Index: RTIA/FederationManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/FederationManagement.cc,v
retrieving revision 3.40
retrieving revision 3.41
diff -u -b -r3.40 -r3.41
--- RTIA/FederationManagement.cc        29 Jan 2008 14:30:50 -0000      3.40
+++ RTIA/FederationManagement.cc        1 Feb 2008 14:12:21 -0000       3.41
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: FederationManagement.cc,v 3.40 2008/01/29 14:30:50 rousse Exp $
+// $Id: FederationManagement.cc,v 3.41 2008/02/01 14:12:21 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -785,7 +785,7 @@
 
     NetworkMessage req ;
 
-    req.type = status ? NetworkMessage::FEDERATE_SAVE_COMPLETE : 
NetworkMessage::FEDERATE_SAVE_NOT_COMPLETE ;
+    req.type= status ? NetworkMessage::FEDERATE_SAVE_COMPLETE : 
NetworkMessage::FEDERATE_SAVE_NOT_COMPLETE ;
     req.federate = federate ;
     req.federation = _numero_federation ;
 
@@ -847,6 +847,7 @@
 FederationManagement::requestFederationRestore(const char *label,
                                                TypeException &)
 {
+    G.Out(pdGendoc,"enter FederationManagement::requestFederationRestore");
     D.Out(pdInit, "Request for federation restore \"%s\".", label);
 
     assert(label != NULL);
@@ -854,10 +855,16 @@
     NetworkMessage req ;
     req.type = NetworkMessage::REQUEST_FEDERATION_RESTORE ;
     req.setLabel(label);
+    req.federate = federate ;
+    req.federation = _numero_federation ;
+
+    G.Out(pdGendoc,"     requestFederationRestore  ====>send Message R_F_R to 
RTIG");
+
     comm->sendMessage(&req);
 
     // Should make sure that RTIG don't have any save or restore recently set.
     // ...
+    G.Out(pdGendoc,"exit  FederationManagement::requestFederationRestore");
 }
 
 // ----------------------------------------------------------------------------
@@ -885,6 +892,7 @@
                                                      const char *label,
                                                      const char *reason)
 {
+    G.Out(pdGendoc,"enter 
FederationManagement::requestFederationRestoreStatus");
     D.Out(pdInit, "Federation restore request %saccepted",
           status ? "" : "not ");
 
@@ -900,18 +908,22 @@
     }
 
     comm->requestFederateService(&req, &rep);
+    G.Out(pdGendoc,"exit  
FederationManagement::requestFederationRestoreStatus");
 }
 
 // ----------------------------------------------------------------------------
 void
 FederationManagement::federationRestoreBegun()
 {
+    G.Out(pdGendoc,"enter FederationManagement::federationRestoreBegun");
     D.Out(pdInit, "Federation restore begun");
 
     Message req, rep ;
     req.type = Message::FEDERATION_RESTORE_BEGUN ;
 
     comm->requestFederateService(&req, &rep);
+
+    G.Out(pdGendoc,"exit  FederationManagement::federationRestoreBegun");
 }
 
 // ----------------------------------------------------------------------------
@@ -919,6 +931,7 @@
 FederationManagement::initiateFederateRestore(const char *label,
                                               FederateHandle handle)
 {
+    G.Out(pdGendoc,"enter FederationManagement::initiateFederateRestore");
     D.Out(pdInit, "Initiate federate restore \"%s\" with federate handle %d.",
           label, handle);
 
@@ -930,6 +943,7 @@
     req.setLabel(label);
 
     comm->requestFederateService(&req, &rep);
+    G.Out(pdGendoc,"exit  FederationManagement::initiateFederateRestore");
 }
 
 // ----------------------------------------------------------------------------
@@ -972,4 +986,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: FederationManagement.cc,v 3.40 2008/01/29 14:30:50 rousse Exp $
+// $Id: FederationManagement.cc,v 3.41 2008/02/01 14:12:21 rousse Exp $

Index: RTIA/RTIA_federate.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA_federate.cc,v
retrieving revision 3.58
retrieving revision 3.59
diff -u -b -r3.58 -r3.59
--- RTIA/RTIA_federate.cc       29 Jan 2008 14:30:51 -0000      3.58
+++ RTIA/RTIA_federate.cc       1 Feb 2008 14:12:22 -0000       3.59
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: RTIA_federate.cc,v 3.58 2008/01/29 14:30:51 rousse Exp $
+// $Id: RTIA_federate.cc,v 3.59 2008/02/01 14:12:22 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -256,6 +256,7 @@
       case Message::REQUEST_FEDERATION_RESTORE:
         D.Out(pdTrace, "Receiving Message from Federate, type"
               " RequestFederationRestore.");
+        G.Out(pdGendoc,"chooseFederateProcessing REQUEST_FEDERATION_RESTORE");
 
         fm->requestFederationRestore(req->getLabel(), e);
         break ;
@@ -266,6 +267,14 @@
                 " FederateRestore(Not)Complete.");
 
           bool result = req->type == Message::FEDERATE_SAVE_COMPLETE ;
+          if (result)
+              {
+              G.Out(pdGendoc,"chooseFederateProcessing 
FEDERATE_RETORE_COMPLETE");
+              }
+          else
+              {
+              G.Out(pdGendoc,"chooseFederateProcessing 
FEDERATE_RESTORE_NOT_COMPLETE");
+              }
           fm->federateRestoreStatus(result, e);
       }
         break ;
@@ -1266,4 +1275,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: RTIA_federate.cc,v 3.58 2008/01/29 14:30:51 rousse Exp $
+// $Id: RTIA_federate.cc,v 3.59 2008/02/01 14:12:22 rousse Exp $

Index: RTIA/RTIA_network.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA_network.cc,v
retrieving revision 3.18
retrieving revision 3.19
diff -u -b -r3.18 -r3.19
--- RTIA/RTIA_network.cc        29 Jan 2008 14:30:51 -0000      3.18
+++ RTIA/RTIA_network.cc        1 Feb 2008 14:12:22 -0000       3.19
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: RTIA_network.cc,v 3.18 2008/01/29 14:30:51 rousse Exp $
+// $Id: RTIA_network.cc,v 3.19 2008/02/01 14:12:22 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -302,9 +302,16 @@
         break ;
 
       case NetworkMessage::REQUEST_FEDERATION_RESTORE_SUCCEEDED:
+        D.Out(pdTrace, "Receiving Message from RTIG, "
+              " type RequestFederationRestoreSucceeded.");
+        G.Out(pdGendoc,"processNetworkMessage for 
REQUEST_FEDERATION_RESTORE_SUCCEEDED");
+        queues->insertBeginCommand(msg);
+        break ;
+
       case NetworkMessage::REQUEST_FEDERATION_RESTORE_FAILED:
         D.Out(pdTrace, "Receiving Message from RTIG, "
-              " type RequestFederationRestoreStatus.");
+              " type RequestFederationRestoreFailed.");
+        G.Out(pdGendoc,"processNetworkMessage for 
REQUEST_FEDERATION_RESTORE_FAILED");
         queues->insertBeginCommand(msg);
         break ;
 
@@ -317,6 +324,7 @@
       case NetworkMessage::INITIATE_FEDERATE_RESTORE:
         D.Out(pdTrace, "Receiving Message from RTIG, "
               " type InitiateFederateRestore.");
+        G.Out(pdGendoc,"processNetworkMessage for INITIATE_FEDERATE_RESTORE");
         queues->insertBeginCommand(msg);
         break ;
 
@@ -342,4 +350,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: RTIA_network.cc,v 3.18 2008/01/29 14:30:51 rousse Exp $
+// $Id: RTIA_network.cc,v 3.19 2008/02/01 14:12:22 rousse Exp $

Index: RTIG/Federation.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.cc,v
retrieving revision 3.76
retrieving revision 3.77
diff -u -b -r3.76 -r3.77
--- RTIG/Federation.cc  29 Jan 2008 14:30:51 -0000      3.76
+++ RTIG/Federation.cc  1 Feb 2008 14:12:22 -0000       3.77
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: Federation.cc,v 3.76 2008/01/29 14:30:51 rousse Exp $
+// $Id: Federation.cc,v 3.77 2008/02/01 14:12:22 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -1101,6 +1101,8 @@
                                      const char *the_label)
     throw (FederateNotExecutionMember)
 {
+    G.Out(pdGendoc,"enter Federation::requestFederationRestore");
+
     check(the_federate);
 
     if (restoreInProgress)
@@ -1133,17 +1135,29 @@
     success = false ;
 #endif // HAVE_XML
 
+// JYR Note : forcing success to true to skip xmlParseFile (not compliant ?)
+    success = true ;
+
     msg->type = success ?
         NetworkMessage::REQUEST_FEDERATION_RESTORE_SUCCEEDED
         : NetworkMessage::REQUEST_FEDERATION_RESTORE_FAILED ;
 
     socket = server->getSocketLink(msg->federate);
+
+    if (success)
+       G.Out(pdGendoc,"             =====> send message R_F_R_S to RTIA");
+    else
+       G.Out(pdGendoc,"             =====> send message R_F_R_F to RTIA");
+
     msg->write(socket);
     delete msg ;
 
     // Reading file failed: not restoring !
     if (!success)
+        {
+        G.Out(pdGendoc,"exit  Federation::requestFederationRestore on success 
false");
         return ;
+        }
 
     // Otherwise...
     for (FederateList::iterator i = federates.begin(); i != federates.end(); 
++i) {
@@ -1158,6 +1172,8 @@
     msg->federation = handle ;
     msg->type = NetworkMessage::FEDERATION_RESTORE_BEGUN ;
 
+    G.Out(pdGendoc,"             =====> broadcast message F_R_B");
+
     broadcastAnyMessage(msg, 0);
     delete msg ;
 
@@ -1172,8 +1188,10 @@
 
         // send message.
         socket = server->getSocketLink(msg->federate);
+        G.Out(pdGendoc,"             =====> send message I_F_R to federate 
%d",msg->federate);
         msg->write(socket);
     }
+    G.Out(pdGendoc,"exit  Federation::requestFederationRestore");
 }
 
 // ----------------------------------------------------------------------------
@@ -1186,6 +1204,7 @@
                                   bool the_status)
     throw (FederateNotExecutionMember)
 {
+    G.Out(pdGendoc,"enter Federation::federateRestoreStatus");
     Federate &federate = getFederate(the_federate);
     federate.setRestoring(false);
 
@@ -1214,6 +1233,7 @@
     // Reinitialize state.
     restoreStatus = true ;
     restoreInProgress = false ;
+    G.Out(pdGendoc,"exit  Federation::federateRestoreStatus");
 }
 
 // ----------------------------------------------------------------------------
@@ -2250,5 +2270,5 @@
 
 }} // namespace certi/rtig
 
-// $Id: Federation.cc,v 3.76 2008/01/29 14:30:51 rousse Exp $
+// $Id: Federation.cc,v 3.77 2008/02/01 14:12:22 rousse Exp $
 

Index: RTIG/FederationsList.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/FederationsList.cc,v
retrieving revision 3.49
retrieving revision 3.50
diff -u -b -r3.49 -r3.50
--- RTIG/FederationsList.cc     29 Jan 2008 14:30:51 -0000      3.49
+++ RTIG/FederationsList.cc     1 Feb 2008 14:12:22 -0000       3.50
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: FederationsList.cc,v 3.49 2008/01/29 14:30:51 rousse Exp $
+// $Id: FederationsList.cc,v 3.50 2008/02/01 14:12:22 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -1496,6 +1496,7 @@
                                           FederateHandle the_federate,
                                           const char *the_label)
 {
+    G.Out(pdGendoc,"enter FederationsList::requestFederationRestore");
     checkHandle(the_federation);
 
     // It may throw FederationExecutionDoesNotExist
@@ -1503,6 +1504,7 @@
     searchFederation(the_federation, federation);
 
     federation->requestFederationRestore(the_federate, the_label);
+    G.Out(pdGendoc,"exit  FederationsList::requestFederationRestore");
 }
 
 // ----------------------------------------------------------------------------
@@ -1511,6 +1513,7 @@
                                        FederateHandle the_federate,
                                        bool the_status)
 {
+    G.Out(pdGendoc,"enter FederationsList::federateRestoreStatus");
     checkHandle(the_federation);
 
     // It may throw FederationExecutionDoesNotExist
@@ -1518,9 +1521,10 @@
     searchFederation(the_federation, federation);
 
     federation->federateRestoreStatus(the_federate, the_status);
+    G.Out(pdGendoc,"exit  FederationsList::federateRestoreStatus");
 }
 
 }} // certi::rtig
 
-// EOF $Id: FederationsList.cc,v 3.49 2008/01/29 14:30:51 rousse Exp $
+// EOF $Id: FederationsList.cc,v 3.50 2008/02/01 14:12:22 rousse Exp $
 

Index: RTIG/RTIG_processing.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG_processing.cc,v
retrieving revision 3.48
retrieving revision 3.49
diff -u -b -r3.48 -r3.49
--- RTIG/RTIG_processing.cc     29 Jan 2008 14:30:51 -0000      3.48
+++ RTIG/RTIG_processing.cc     1 Feb 2008 14:12:22 -0000       3.49
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: RTIG_processing.cc,v 3.48 2008/01/29 14:30:51 rousse Exp $
+// $Id: RTIG_processing.cc,v 3.49 2008/02/01 14:12:22 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -535,20 +535,28 @@
 void
 RTIG::processRequestFederationRestore(Socket *, NetworkMessage *req)
 {
+    G.Out(pdGendoc,"BEGIN ** REQUEST FEDERATION RESTORE SERVICE **");
+    G.Out(pdGendoc,"enter RTIG::processRequestFederationRestore");
     auditServer << "Federate " << req->federate << " request restore." ;
 
     federations.requestFederationRestore(req->federation, req->federate,
                                           req->label);
+    G.Out(pdGendoc,"exit  RTIG::processRequestFederationRestore");
+    G.Out(pdGendoc,"END   ** REQUEST FEDERATION RESTORE SERVICE **");
 }
 
 // ----------------------------------------------------------------------------
 void
 RTIG::processFederateRestoreStatus(Socket *, NetworkMessage *req)
 {
+    G.Out(pdGendoc,"BEGIN ** FEDERATE RESTORE (NOT)COMPLETE **");
+    G.Out(pdGendoc,"enter RTIG::processRequestFederateRestoreStatus");
     auditServer << "Federate " << req->federate << " restore ended." ;
 
     bool status = req->type == NetworkMessage::FEDERATE_RESTORE_COMPLETE ;
     federations.federateRestoreStatus(req->federation, req->federate, status);
+    G.Out(pdGendoc,"exit  RTIG::processRequestFederateRestoreStatus");
+    G.Out(pdGendoc,"END   ** FEDERATE RESTORE (NOT)COMPLETE **");
 }
 
 // ----------------------------------------------------------------------------
@@ -1337,4 +1345,4 @@
 
 }} // namespace certi/rtig
 
-// $Id: RTIG_processing.cc,v 3.48 2008/01/29 14:30:51 rousse Exp $
+// $Id: RTIG_processing.cc,v 3.49 2008/02/01 14:12:22 rousse Exp $

Index: libCERTI/NetworkMessage_RW.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage_RW.cc,v
retrieving revision 3.40
retrieving revision 3.41
diff -u -b -r3.40 -r3.41
--- libCERTI/NetworkMessage_RW.cc       29 Jan 2008 14:30:51 -0000      3.40
+++ libCERTI/NetworkMessage_RW.cc       1 Feb 2008 14:12:22 -0000       3.41
@@ -16,7 +16,7 @@
 // License along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: NetworkMessage_RW.cc,v 3.40 2008/01/29 14:30:51 rousse Exp $
+// $Id: NetworkMessage_RW.cc,v 3.41 2008/02/01 14:12:22 rousse Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -144,7 +144,14 @@
       case SYNCHRONIZATION_POINT_REGISTRATION_SUCCEEDED:
       case FEDERATION_SYNCHRONIZED:
       case REQUEST_FEDERATION_RESTORE:
+       readLabel(body);
+       break ;
+
       case REQUEST_FEDERATION_RESTORE_SUCCEEDED:
+       readLabel(body);
+G.Out(pdGendoc,"NetworkMessage::readBody type R_F_R_S label= %s",label);
+       break ;
+
       case INITIATE_FEDERATE_RESTORE:
        readLabel(body);
        break ;
@@ -589,7 +596,15 @@
       case SYNCHRONIZATION_POINT_REGISTRATION_SUCCEEDED:
       case FEDERATION_SYNCHRONIZED:
       case REQUEST_FEDERATION_RESTORE:
+       body.writeString(label);
+       break ;
+
       case REQUEST_FEDERATION_RESTORE_SUCCEEDED:
+       body.writeString(label);
+G.Out(pdGendoc,"NetworkMessage::writeBody type R_F_R_S label=%s",label);
+       break ;
+
+
       case INITIATE_FEDERATE_RESTORE:
        body.writeString(label);
        break ;
@@ -994,4 +1009,4 @@
 
 } // namespace certi
 
-// $Id: NetworkMessage_RW.cc,v 3.40 2008/01/29 14:30:51 rousse Exp $
+// $Id: NetworkMessage_RW.cc,v 3.41 2008/02/01 14:12:22 rousse Exp $

Index: libRTI/RTIambassador.cc
===================================================================
RCS file: /sources/certi/certi/libRTI/RTIambassador.cc,v
retrieving revision 3.63
retrieving revision 3.64
diff -u -b -r3.63 -r3.64
--- libRTI/RTIambassador.cc     19 Dec 2007 10:38:06 -0000      3.63
+++ libRTI/RTIambassador.cc     1 Feb 2008 14:12:23 -0000       3.64
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: RTIambassador.cc,v 3.63 2007/12/19 10:38:06 rousse Exp $
+// $Id: RTIambassador.cc,v 3.64 2008/02/01 14:12:23 rousse Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -863,7 +863,7 @@
            RestoreInProgress,
            RTIinternalError)
 {
-    throw UnimplementedService("");
+
     Message req, rep ;
 
     G.Out(pdGendoc,"enter RTIambassador::federateSaveNotComplete");
@@ -882,7 +882,6 @@
     throw (RTI::RTIinternalError, RTI::RestoreInProgress, RTI::SaveInProgress, 
           RTI::ConcurrentAccessAttempted, RTI::FederateNotExecutionMember)
 {
-    throw UnimplementedService("");
     Message req, rep ;
 
     G.Out(pdGendoc,"enter RTIambassador::requestFederationRestore");
@@ -902,7 +901,6 @@
           RTI::ConcurrentAccessAttempted, RTI::FederateNotExecutionMember,
           RTI::RestoreNotRequested)
 {
-    throw UnimplementedService("");
     Message req, rep ;
 
     G.Out(pdGendoc,"enter RTIambassador::federateRestoreComplete");
@@ -921,7 +919,6 @@
           RTI::ConcurrentAccessAttempted, RTI::FederateNotExecutionMember,
           RTI::RestoreNotRequested)
 {
-    throw UnimplementedService("");
     Message req, rep ;
 
     G.Out(pdGendoc,"enter RTIambassador::federateRestoreNotComplete");
@@ -2902,4 +2899,4 @@
     privateRefs->executeService(&req, &rep);
 }
 
-// $Id: RTIambassador.cc,v 3.63 2007/12/19 10:38:06 rousse Exp $
+// $Id: RTIambassador.cc,v 3.64 2008/02/01 14:12:23 rousse Exp $




reply via email to

[Prev in Thread] Current Thread [Next in Thread]