1 // Copyright (C) 2006-2008 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #define private public
23 #define protected public
24 #include <omniORB4/CORBA.h>
25 #include <omniORB4/internal/typecode.h>
28 #include "RuntimeSALOME.hxx"
29 #include "CORBANode.hxx"
30 #include "CORBAComponent.hxx"
31 #include "SalomeComponent.hxx"
32 #include "CORBAPorts.hxx"
33 #include "OutputDataStreamPort.hxx"
34 #include "CalStreamPort.hxx"
36 #include "TypeCode.hxx"
39 #include "SALOME_NamingService.hxx"
40 #include "SALOME_LifeCycleCORBA.hxx"
41 #include "SALOME_Exception.hh"
44 #include <omniORB4/CORBA.h>
45 #include <omniORB4/minorCode.h>
51 #include "YacsTrace.hxx"
53 using namespace YACS::ENGINE;
56 const char CORBANode::IMPL_NAME[]="CORBA";
57 const char CORBANode::KIND[]="CORBA";
59 std::string CORBANode::getKind() const
64 //! CORBANode constructor
65 CORBANode::CORBANode(const std::string& name): ServiceNode(name)
67 _implementation=IMPL_NAME;
70 CORBANode::CORBANode(const CORBANode& other,ComposedNode *father):ServiceNode(other,father)
72 _implementation=IMPL_NAME;
75 //! Execute the service on the component associated to the node
76 void CORBANode::execute()
78 DEBTRACE( "+++++++++++++ CorbaNode::execute: " << getName() << " +++++++++++++++" );
80 //DII request building :
81 // a service gets all its in parameters first
82 // then all its out parameters
83 // no inout parameters
84 // the return value (if any) is the first out parameter
85 // not yet user exception (only CORBA exception)
87 CORBA::Object_var objComponent=((CORBAComponent*)_component)->getCompoPtr();
88 CORBA::Request_var req = objComponent->_request(_method.c_str());
89 CORBA::NVList_ptr arguments = req->arguments() ;
91 DEBTRACE( "+++++++++++++++++CorbaNode::inputs+++++++++++++++++" )
94 list<InputPort *>::iterator iter2;
95 for(iter2 = _setOfInputPort.begin(); iter2 != _setOfInputPort.end(); iter2++)
97 InputCorbaPort *p=(InputCorbaPort *)*iter2;
98 DEBTRACE( "port name: " << p->getName() )
99 DEBTRACE( "port kind: " << p->edGetType()->kind() )
100 CORBA::Any* ob=p->getAny();
102 CORBA::TypeCode_var typcod= ob->type();
103 switch(p->edGetType()->kind())
122 if(*ob >>= CORBA::Any::to_boolean(b))
125 DEBTRACE( "not a boolean" )
128 DEBTRACE( typcod->id() )
134 //add_value makes a copy of any (*ob). This copy will be deleted with the request
135 arguments->add_value( p->getName().c_str() , *ob , CORBA::ARG_IN ) ;
140 DEBTRACE( "+++++++++++++++++CorbaNode::outputs+++++++++++++++++" )
141 list<OutputPort *>::iterator iter;
142 for(iter = _setOfOutputPort.begin(); iter != _setOfOutputPort.end(); iter++)
144 OutputCorbaPort *p=(OutputCorbaPort *)*iter;
145 DEBTRACE( "port name: " << p->getName() )
146 DEBTRACE( "port kind: " << p->edGetType()->kind() )
147 CORBA::Any* ob=p->getAnyOut();
149 DEBTRACE("refcount CORBA : " << ((omni::TypeCode_base*)ob->pd_tc.in())->pd_ref_count);
151 //add_value makes a copy of any. Copy will be deleted with request
152 arguments->add_value( p->getName().c_str() , *ob , CORBA::ARG_OUT );
154 DEBTRACE("refcount CORBA : " << ((omni::TypeCode_base*)ob->pd_tc.in())->pd_ref_count);
160 req->set_return_type(CORBA::_tc_void);
162 DEBTRACE( "+++++++++++++++++CorbaNode::calculation+++++++++++++++++" << _method )
164 CORBA::Exception *exc =req->env()->exception();
167 DEBTRACE( "An exception was thrown!" )
168 DEBTRACE( "The raised exception is of Type:" << exc->_name() )
170 std::cerr << "The raised exception is of Type:" << exc->_name() << std::endl;
172 if(strcmp(exc->_name(),"MARSHAL") == 0)
174 const char* ms = ((CORBA::MARSHAL*)exc)->NP_minorString();
176 std::cerr << "(CORBA::MARSHAL: minor = " << ms << ")" << std::endl;
178 std::cerr << "(CORBA::MARSHAL: minor = " << ((CORBA::MARSHAL*)exc)->minor() << ")" << std::endl;
181 _errorDetails="Execution problem: the raised exception is of Type:";
182 _errorDetails += exc->_name();
183 throw Exception("Execution problem");
186 DEBTRACE( "++++++++++++CorbaNode::outputs++++++++++++" )
187 int out_param=in_param;
188 for(iter = _setOfOutputPort.begin(); iter != _setOfOutputPort.end(); iter++)
190 OutputCorbaPort *p=(OutputCorbaPort *)*iter;
191 DEBTRACE( "port name: " << p->getName() )
192 DEBTRACE( "port kind: " << p->edGetType()->kind() )
193 DEBTRACE( "port number: " << out_param )
194 CORBA::Any *ob=arguments->item(out_param)->value();
196 DEBTRACE("refcount CORBA : " << ((omni::TypeCode_base*)ob->pd_tc.in())->pd_ref_count);
199 CORBA::TypeCode_var tc=ob->type();
200 switch(p->edGetType()->kind())
224 //OutputPort must copy the input Any(ob).
225 //This Any will be deleted with the request.
226 //Copy is made by the method put.
228 out_param=out_param+1;
230 DEBTRACE("refcount CORBA : " << ((omni::TypeCode_base*)ob->pd_tc.in())->pd_ref_count);
233 DEBTRACE( "++++++++++++++++++++++++++++++++++++++++++" )
235 //Request has been deleted (_var )
236 //All anys given to the request are deleted : don't forget to copy them
237 //if you want to keep them
239 list<OutputPort *>::const_iterator iter;
240 for(iter = _setOfOutputPort.begin(); iter != _setOfOutputPort.end(); iter++)
242 OutputCorbaPort *p=(OutputCorbaPort *)*iter;
243 CORBA::Any *ob=p->getAny();
244 DEBTRACE("refcount CORBA : " << ((omni::TypeCode_base*)ob->pd_tc.in())->pd_ref_count);
247 DEBTRACE( "+++++++++++++++++ End CorbaNode::execute: " << getName() << " +++++++++++++++++" )
250 //! Clone the node : must also clone the component instance ?
251 Node *CORBANode::simpleClone(ComposedNode *father, bool editionOnly) const
253 return new CORBANode(*this,father);
256 //! Create a CORBANode with the same component object and no input or output port
258 * \param name : node name
259 * \return a new CORBANode node
261 ServiceNode* CORBANode::createNode(const std::string& name)
264 CORBANode* node= new CORBANode(name);
265 node->setComponent(_component);
271 const char SalomeNode::KIND[]="Salome";
273 std::string SalomeNode::getKind() const
278 //! SalomeNode constructor
279 SalomeNode::SalomeNode(const std::string& name):ServiceNode(name)
281 _implementation=CORBANode::IMPL_NAME;
284 SalomeNode::SalomeNode(const SalomeNode& other,ComposedNode *father):ServiceNode(other,father)
286 _implementation=CORBANode::IMPL_NAME;
289 SalomeNode::~SalomeNode()
294 //! Init the datastream ports of the component associated to the node
295 void SalomeNode::initService()
297 DEBTRACE( "SalomeNode::initService: "<<getName())
298 if(_setOfInputDataStreamPort.size() == 0 && _setOfOutputDataStreamPort.size() == 0)return;
300 CORBA::Object_var objComponent=((SalomeComponent*)_component)->getCompoPtr();
301 Engines::Superv_Component_var compo=Engines::Superv_Component::_narrow(objComponent);
302 if( CORBA::is_nil(compo) )
304 std::string msg="Can't get reference to DSC object (or it was nil).";
306 throw Exception(msg);
310 CORBA::Boolean ret=compo->init_service(_method.c_str());
313 _errorDetails="Problem with component '"+_ref+"' in init_service of service '"+ _method + "'";
314 throw Exception(_errorDetails);
319 _errorDetails="Problem with component '"+_ref+"' in init_service of service '"+ _method + "'";
324 //! Connect the datastream ports of the component associated to the node
325 void SalomeNode::connectService()
327 DEBTRACE( "SalomeNode::connectService: "<<getName());
328 if(_setOfOutputDataStreamPort.size() == 0)return;
330 CORBA::Object_var objComponent=((SalomeComponent*)_component)->getCompoPtr();
331 SALOME_NamingService NS(getSALOMERuntime()->getOrb()) ;
332 SALOME_LifeCycleCORBA LCC(&NS) ;
333 CORBA::Object_var obj = NS.Resolve("/ConnectionManager");
334 Engines::ConnectionManager_var manager=Engines::ConnectionManager::_narrow(obj);
335 Engines::Superv_Component_var me=Engines::Superv_Component::_narrow(objComponent);
336 if( CORBA::is_nil(me) )
338 std::string msg="Can't get reference to Engines::Superv_Component: "+getName();
340 throw Exception(msg);
342 std::list<OutputDataStreamPort *>::iterator iter;
343 Engines::ConnectionManager::connectionId id;
344 for(iter = _setOfOutputDataStreamPort.begin(); iter != _setOfOutputDataStreamPort.end(); iter++)
346 OutputDataStreamPort *port=(OutputDataStreamPort *)*iter;
347 std::set<InPort *> ports=port->edSetInPort();
348 std::set<InPort *>::iterator iterout;
349 for(iterout=ports.begin();iterout != ports.end(); iterout++)
351 //It's only possible to connect 2 SalomeNode : try to get a SalomeNode
352 SalomeNode* snode= dynamic_cast<SalomeNode*>((*iterout)->getNode());
353 if(snode == 0) //don't connect, it's not a SalomeNode
355 std::string msg="Can't connect : not a SalomeNode";
357 throw Exception(msg);
360 CORBA::Object_var comp=((SalomeComponent*)snode->getComponent())->getCompoPtr();
361 if( CORBA::is_nil(comp))
363 std::string msg="Problem in connectService: " + snode->getName();
364 msg=msg+" Component is probably not launched. Modify your YACS file";
366 throw Exception(msg);
369 Engines::Superv_Component_var other=Engines::Superv_Component::_narrow(comp);
370 if( CORBA::is_nil(other))
372 std::string msg="Can't connect to nil Engines::Superv_Component: " + snode->getName();
374 throw Exception(msg);
378 id=manager->connect(me,port->getName().c_str(),other,(*iterout)->getName().c_str());
380 catch(Engines::DSC::PortNotDefined& ex)
382 std::string msg="Problem in connectService. Unknown port: "+port->getName()+" or "+(*iterout)->getName();
384 throw Exception(msg);
386 catch(Engines::DSC::BadPortType& ex)
388 std::string msg="Problem in connectService. Type of provides port is bad. Expected: ";
389 msg=msg + ex.expected.in();
390 msg=msg + "Received: "+ex.received.in();
392 throw Exception(msg);
394 catch(Engines::DSC::NilPort& ex)
396 std::string msg="Problem in connectService. Port is nil: "+port->getName()+" or "+(*iterout)->getName();
398 throw Exception(msg);
400 catch( const SALOME::SALOME_Exception& ex )
402 std::string msg="Problem in connectService. ";
403 msg += ex.details.text.in();
404 msg=msg+getName()+" " + port->getName() + " " + snode->getName() + " " + (*iterout)->getName();
406 throw Exception(msg);
408 catch(CORBA::SystemException& ex)
410 DEBTRACE( "minor code: " << ex.minor() );
411 DEBTRACE( "completion code: " << ex.completed() );
412 std::string msg="Problem in connectService. CORBA System exception ";
413 std::string excname=ex._name();
414 msg=msg+excname + " " +getName()+" " + port->getName() + " " + snode->getName() + " " + (*iterout)->getName();
416 throw Exception(msg);
420 std::string msg="Problem in connectService. Unknown exception";
421 msg=msg+getName()+" " + port->getName() + " " + snode->getName() + " " + (*iterout)->getName();
423 throw Exception(msg);
425 DEBTRACE("Connected: " <<id<<" "<<getName()<<" "<<port->getName()<<" "<<snode->getName()<<" "<<(*iterout)->getName());
430 //Init component port properties
431 for(iter = _setOfOutputDataStreamPort.begin(); iter != _setOfOutputDataStreamPort.end(); iter++)
433 (*iter)->initPortProperties();
435 std::list<InputDataStreamPort *>::iterator iterin;
436 for(iterin = _setOfInputDataStreamPort.begin(); iterin != _setOfInputDataStreamPort.end(); iterin++)
438 (*iterin)->initPortProperties();
442 //! Disconnect the datastream ports of the component associated to the node
443 void SalomeNode::disconnectService()
445 DEBTRACE( "SalomeNode::disconnectService: "<<getName());
446 if(ids.size() == 0)return;
448 SALOME_NamingService NS(getSALOMERuntime()->getOrb()) ;
449 SALOME_LifeCycleCORBA LCC(&NS) ;
450 CORBA::Object_var obj = NS.Resolve("/ConnectionManager");
451 Engines::ConnectionManager_var manager=Engines::ConnectionManager::_narrow(obj);
452 std::list<Engines::ConnectionManager::connectionId>::iterator iter;
453 for(iter = ids.begin(); iter != ids.end(); iter++)
455 DEBTRACE("Trying to disconnect: " << *iter );
458 manager->disconnect(*iter,Engines::DSC::RemovingConnection);
460 catch(Engines::ConnectionManager::BadId& ex)
462 DEBTRACE( "Problem in disconnect: " << *iter );
464 catch(Engines::DSC::PortNotDefined& ex)
466 DEBTRACE( "Problem in disconnect: " << *iter );
468 catch(Engines::DSC::PortNotConnected& ex)
470 DEBTRACE( "Problem in disconnect: " << *iter );
472 catch(Engines::DSC::BadPortReference& ex)
474 DEBTRACE( "Problem in disconnect (Engines::DSC::BadPortReference): " << *iter );
476 catch(CORBA::SystemException& ex)
478 DEBTRACE( "Problem in disconnect (CORBA::SystemException): " << *iter );
482 DEBTRACE( "Problem in disconnect: " << *iter );
489 //! Execute the service on the component associated to the node
490 void SalomeNode::execute()
492 DEBTRACE( "+++++++++++++++++ SalomeNode::execute: " << getName() << " " << _method << " +++++++++++++++++" )
494 CORBA::Object_var objComponent=((SalomeComponent*)_component)->getCompoPtr();
495 Engines::Component_var compo=Engines::Component::_narrow(objComponent);
497 // Set component properties
498 if(_propertyMap.size() > 0)
500 Engines::FieldsDict_var dico = new Engines::FieldsDict;
501 dico->length(_propertyMap.size());
502 std::map<std::string,std::string>::const_iterator it;
504 for(it = _propertyMap.begin(); it != _propertyMap.end(); ++it)
506 dico[i].key=CORBA::string_dup(it->first.c_str());
507 dico[i].value <<=it->second.c_str();
510 compo->setProperties(dico);
513 //DII request building :
514 // a service gets all its in parameters first
515 // then all its out parameters
516 // no inout parameters
517 // the return value (if any) is the first out parameter
519 CORBA::Request_var req ;
522 req = objComponent->_request(_method.c_str());
524 catch(CORBA::SystemException& ex)
526 std::string msg="component '" +_ref+ "' has no service '" + _method+ "'";
528 throw Exception(msg);
530 CORBA::NVList_ptr arguments = req->arguments() ;
532 DEBTRACE( "+++++++++++++++++SalomeNode::inputs+++++++++++++++++" );
535 list<InputPort *>::iterator iter2;
536 for(iter2 = _setOfInputPort.begin(); iter2 != _setOfInputPort.end(); iter2++)
538 InputCorbaPort *p=(InputCorbaPort *)*iter2;
539 if(p->edGetType()->isA(Runtime::_tc_file))
541 DEBTRACE( "port name: " << p->getName() );
542 DEBTRACE( "port kind: " << p->edGetType()->kind() );
543 CORBA::Any* ob=p->getAny();
545 CORBA::TypeCode_var tc=ob->type();
546 switch(p->edGetType()->kind())
570 //add_value makes a copy of any. Copy will be deleted with request
571 arguments->add_value( p->getName().c_str() , *ob , CORBA::ARG_IN ) ;
576 DEBTRACE("checkInputFilesToService: " << _method);
579 for(iter2 = _setOfInputPort.begin(); iter2 != _setOfInputPort.end(); iter2++)
581 InputCorbaPort *p=(InputCorbaPort *)*iter2;
582 if(!p->edGetType()->isA(Runtime::_tc_file))
584 std::string filename=p->getName();
585 // replace ':' by '.'. Needed because port name can not contain '.'
586 string::size_type debut =filename.find_first_of(':',0);
587 while(debut != std::string::npos)
590 debut=filename.find_first_of(':',debut);
592 DEBTRACE( "inport with file: " << filename );
593 Engines::Salome_file_var isf=compo->setInputFileToService(_method.c_str(),p->getName().c_str());
594 isf->setDistributedFile(filename.c_str());
595 Engines::Salome_file_ptr osf;
596 CORBA::Any* any=p->getAny();
602 compo->checkInputFilesToService(_method.c_str());
604 catch( const SALOME::SALOME_Exception& ex )
606 std::string text="Execution problem in checkInputFilesToService: ";
607 text += (const char*)ex.details.text;
609 throw Exception(text);
611 catch(CORBA::SystemException& ex)
613 std::string msg="Execution problem: component probably does not support files ??";
615 throw Exception(msg);
619 DEBTRACE( "+++++++++++++++++SalomeNode::outputs+++++++++++++++++" )
620 list<OutputPort *>::iterator iter;
621 for(iter = _setOfOutputPort.begin(); iter != _setOfOutputPort.end(); iter++)
623 OutputCorbaPort *p=(OutputCorbaPort *)*iter;
624 DEBTRACE( "port name: " << p->getName() )
625 DEBTRACE( "port kind: " << p->edGetType()->kind() )
626 if(p->edGetType()->isA(Runtime::_tc_file))
628 CORBA::Any* ob=p->getAnyOut();
629 //add_value makes a copy of any. Copy will be deleted with request
630 arguments->add_value( p->getName().c_str() , *ob , CORBA::ARG_OUT );
635 //if return type is set to void (not mandatory, it's set by default)
636 //the return value will not be marshalled as a return value but
637 //as the first out argument (don't forget to add it as the first output argument)
638 req->set_return_type(CORBA::_tc_void);
640 req->exceptions()->add(SALOME::_tc_SALOME_Exception);
642 DEBTRACE( "+++++++++++++++++SalomeNode::calculation+++++++++++++++++" << _method )
644 CORBA::Exception *exc =req->env()->exception();
647 DEBTRACE( "An exception was thrown!" )
648 DEBTRACE( "The raised exception is of Type:" << exc->_name() )
650 CORBA::SystemException* sysexc;
651 sysexc=CORBA::SystemException::_downcast(exc);
654 // It's a SystemException
655 DEBTRACE( "minor code: " << sysexc->minor() );
656 DEBTRACE( "completion code: " << sysexc->completed() );
657 std::string text="Execution problem: ";
658 std::string excname=sysexc->_name();
659 if(excname == "BAD_OPERATION")
661 text=text+"component '" +_ref+ "' has no service '" + _method+ "'";
663 else if(excname == "MARSHAL" && sysexc->minor() == omni::MARSHAL_PassEndOfMessage)
665 text=text+"probably an error in arguments of service '" + _method + "' from component '" +_ref+ "'";
667 else if(excname == "COMM_FAILURE" && sysexc->minor() == omni::COMM_FAILURE_UnMarshalResults)
669 text=text+"probably an error in output arguments of service '" + _method + "' from component '" +_ref+ "'";
671 else if(excname == "COMM_FAILURE" && sysexc->minor() == omni::COMM_FAILURE_UnMarshalArguments)
673 text=text+"probably an error in input arguments of service '" + _method + "' from component '" +_ref+ "'";
675 else if(excname == "COMM_FAILURE" && sysexc->minor() == omni::COMM_FAILURE_WaitingForReply)
677 text=text+"probably an error in input arguments of service '" + _method + "' from component '" +_ref+ "'";
681 DEBTRACE(sysexc->NP_minorString() );
682 text=text+"System Exception "+ excname;
685 throw Exception(text);
688 // Not a System Exception
689 CORBA::UnknownUserException* userexc;
690 userexc=CORBA::UnknownUserException::_downcast(exc);
693 CORBA::Any anyExcept = userexc->exception();
695 const SALOME::SALOME_Exception* salexc;
696 if(anyExcept >>= salexc)
698 DEBTRACE("SALOME_Exception: "<< salexc->details.sourceFile);
699 DEBTRACE("SALOME_Exception: "<<salexc->details.lineNumber);
700 _errorDetails=salexc->details.text;
701 throw Exception("Execution problem: Salome Exception occurred" + getErrorDetails() );
703 std::string msg="Execution problem: User Exception occurred";
705 throw Exception(msg);
707 std::string msg="Execution problem";
709 throw Exception(msg);
712 DEBTRACE( "++++++++++++SalomeNode::outputs++++++++++++" )
713 int out_param=in_param;
714 for(iter = _setOfOutputPort.begin(); iter != _setOfOutputPort.end(); iter++)
716 OutputCorbaPort *p=(OutputCorbaPort *)*iter;
717 DEBTRACE( "port name: " << p->getName() );
718 DEBTRACE( "port kind: " << p->edGetType()->kind() );
719 DEBTRACE( "port number: " << out_param );
720 if(p->edGetType()->isA(Runtime::_tc_file))
722 CORBA::Any *ob=arguments->item(out_param)->value();
724 switch(p->edGetType()->kind())
745 //OutputPort must copy the input Any(ob).
746 //This Any will be deleted with the request.
747 //Copy is made by the method put.
749 out_param=out_param+1;
754 DEBTRACE("checkOutputFilesToService: " << _method);
757 for(iter = _setOfOutputPort.begin(); iter != _setOfOutputPort.end(); iter++)
759 OutputCorbaPort *p=(OutputCorbaPort *)*iter;
760 if(!p->edGetType()->isA(Runtime::_tc_file))
762 // The output port has a file object : special treatment
763 std::string filename=p->getName();
764 // replace ':' by '.'. Needed because port name can not contain '.'
765 string::size_type debut =filename.find_first_of(':',0);
766 while(debut != std::string::npos)
769 debut=filename.find_first_of(':',debut);
771 DEBTRACE( "outport with file: " << filename );
772 Engines::Salome_file_var osf=compo->setOutputFileToService(_method.c_str(),p->getName().c_str());
773 osf->setLocalFile(filename.c_str());
779 compo->checkOutputFilesToService(_method.c_str());
781 catch( const SALOME::SALOME_Exception& ex )
783 std::string text=(const char*)ex.details.text;
785 throw Exception("Execution problem in checkOutputFilesToService: " + text);
787 catch(CORBA::SystemException& ex)
789 std::string msg="Execution problem: component probably does not support files ?";
791 throw Exception(msg);
794 //Request has been deleted (_var )
795 //All anys given to the request are deleted : don't forget to copy them
796 //if you want to keep them
797 DEBTRACE( "+++++++++++++++++ End SalomeNode::execute: " << getName() << " +++++++++++++++++" )
800 Node *SalomeNode::simpleClone(ComposedNode *father, bool editionOnly) const
802 return new SalomeNode(*this,father);
805 //! Create a SalomeNode with the same component object and no input or output port
807 * \param name : node name
808 * \return a new SalomeNode node
810 ServiceNode* SalomeNode::createNode(const std::string& name)
812 SalomeNode* node=new SalomeNode(name);
813 node->setComponent(_component);
817 std::string SalomeNode::getContainerLog()
819 std::string msg="Component is not loaded";
822 CORBA::Object_var objComponent=((SalomeComponent*)_component)->getCompoPtr();
823 Engines::Component_var compo=Engines::Component::_narrow(objComponent);
824 if( !CORBA::is_nil(compo) )
826 Engines::Container_var cont= compo->GetContainerRef();
827 CORBA::String_var logname = cont->logfilename();
830 std::string::size_type pos = msg.find(":");
831 msg=msg.substr(pos+1);
834 catch(CORBA::COMM_FAILURE& ex)
836 msg = ":Component no longer reachable: Caught system exception COMM_FAILURE";
837 msg += " -- unable to contact the object.";
839 catch(CORBA::SystemException& ex)
841 msg = ":Component no longer reachable: Caught a CORBA::SystemException.\n";
844 CORBA::TypeCode_var tc = tmp.type();
845 const char *p = tc->name();
851 catch(CORBA::Exception& ex)
853 msg = ":Component no longer reachable: Caught CORBA::Exception.\n";
856 CORBA::TypeCode_var tc = tmp.type();
857 const char *p = tc->name();
863 catch(omniORB::fatalException& fe)
865 msg = ":Component no longer reachable: Caught omniORB::fatalException.\n";
867 log << " file: " << fe.file() << endl;
868 log << " line: " << fe.line() << endl;
869 log << " mesg: " << fe.errmsg() << endl;
874 msg = ":Component no longer reachable: Caught unknown exception.";