11 #ifndef HPP_CORBA_TEMPLATE_SERVER_HXX
12 #define HPP_CORBA_TEMPLATE_SERVER_HXX
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;
90 setServant(impl_->_this());
96 servantId_ = poa_->activate_object(impl_);
108 if (impl_ != NULL)
return true;
114 setServant(impl_->_this());
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) {
bool initRootPOA(bool inMultiThread)
Template CORBA server.
Definition: server.hh:138
Server(int argc, const char *argv[], const char *orb_identifier="", const char *options[][2]=0)
Constructor.
Definition: server.hxx:60
bool initRootPOA(bool inMultiThread)
Definition: server.hxx:80
T & implementation()
Return a reference to the implementation.
Definition: server.hxx:74
~Server()
Shutdown CORBA server.
Definition: server.hxx:68
CORBA::ORB::InvalidName InvalidName
Definition: server.hxx:57
#define HPP_CORBA_CATCH(msg, ret)
Definition: server.hxx:21