Back to index

salome-kernel  6.5.0
SALOME_Container_SignalsHandler.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #include <SALOMEconfig.h>
00024 #include <stdexcept>
00025 #include <omniORB4/CORBA.h>
00026 
00027 #include "utilities.h"
00028 
00029 // CCRT porting
00030 // #include "CASCatch_SignalsHandler.h" // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
00031 
00032 extern "C" void HandleServerSideSignals(CORBA::ORB_ptr theORB)
00033 {
00034  // CCRT porting
00035  //  CASCatch_SignalsHandler aSignalsHandler;
00036   try {
00037     theORB->run();
00038     // CCRT porting
00039     //  }catch(CORBA::SystemException&){
00040     //    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
00041     //    throw std::runtime_error(aFail->GetMessageString());
00042   }catch(CORBA::SystemException&){
00043     INFOS("Caught CORBA::SystemException.");
00044   }catch(PortableServer::POA::WrongPolicy&){
00045     INFOS("Caught CORBA::WrongPolicyException.");
00046   }catch(PortableServer::POA::ServantAlreadyActive&){
00047     INFOS("Caught CORBA::ServantAlreadyActiveException");
00048   }catch(CORBA::Exception&){
00049     INFOS("Caught CORBA::Exception.");
00050   }catch(std::exception& exc){
00051     INFOS("Caught std::exception - "<<exc.what()); 
00052   }catch(...){
00053     INFOS("Caught unknown exception.");
00054   }
00055 }