11 #ifndef HPP_CORBA_TEMPLATE_SERVER_HXX 12 #define HPP_CORBA_TEMPLATE_SERVER_HXX 18 #include <hpp/corba/template/debug.hh> 21 #define HPP_CORBA_CATCH(msg, ret) \ 22 catch(CORBA::UserException& exc) { \ 23 hppCorbaDout (error, "CORBA::UserException: " << msg << " " \ 27 catch(CORBA::SystemException&) { \ 28 hppCorbaDout (error, "CORBA::SystemException: " << msg); \ 31 catch(CORBA::Exception&) { \ 32 hppCorbaDout (error, "CORBA::Exception: " << msg); \ 35 catch(omniORB::fatalException& fe) { \ 36 hppCorbaDout (error, "CORBA::fatalException: " << msg); \ 40 hppCorbaDout (error, "CORBA: unknown exception: " << msg); \ 48 using CORBA::Exception;
49 using CORBA::Object_var;
50 using CORBA::SystemException;
51 using CORBA::ORB_init;
52 using CORBA::PolicyList;
53 using CORBA::Object_ptr;
54 using CORBA::COMM_FAILURE;
55 using omniORB::fatalException;
61 const char* orb_identifier,
62 const char* options[][2])
63 :
ServerBase (argc, argv, orb_identifier, options), impl_ (NULL)
70 deactivateAndDestroyServers();
84 if (impl_ != NULL)
return true;
96 servantId_ =
poa_->activate_object(impl_);
108 if (impl_ != NULL)
return true;
119 servantId_ = PortableServer::string_to_ObjectId(object_id);
120 poa_->activate_object_with_id(servantId_, impl_);
122 HPP_CORBA_CATCH(
"failed to activate the server implementation",
false);
132 poa_->deactivate_object(servantId_);
133 }
catch (
const CORBA::OBJECT_NOT_EXIST& exc) {
142 #endif //HPP_CORBA_TEMPLATE_SERVER_HXX PortableServer::POA_var main_poa()
Definition: server.hh:89
CORBA::ORB::InvalidName InvalidName
Definition: server.hxx:57
bool initRootPOA(bool inMultiThread)
PortableServer::POA_var ins_poa_
Definition: server.hh:107
Server(int argc, const char *argv[], const char *orb_identifier="", const char *options[][2]=0)
Constructor.
Definition: server.hxx:60
T & implementation()
Return a reference to the implementation.
Definition: server.hxx:74
~Server()
Shutdown CORBA server.
Definition: server.hxx:68
#define HPP_CORBA_CATCH(msg, ret)
Definition: server.hxx:21
void setServant(CORBA::Object_ptr obj)
Template CORBA server.
Definition: server.hh:137
bool initRootPOA(bool inMultiThread)
Definition: server.hxx:80
PortableServer::POA_var poa_
Definition: server.hh:107