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) { \
24 "CORBA::UserException: " << msg << " " << exc._name()); \
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); \
46using CORBA::COMM_FAILURE;
47using CORBA::Exception;
48using CORBA::Object_ptr;
49using CORBA::Object_var;
51using CORBA::PolicyList;
52using CORBA::SystemException;
53using omniORB::fatalException;
59 const char* options[][2])
60 :
ServerBase(argc, argv, orb_identifier, options), impl_(NULL) {}
65 deactivateAndDestroyServers();
77 if (impl_ != NULL)
return true;
83 setServant(impl_->_this());
89 servantId_ = poa_->activate_object(impl_);
100 if (impl_ != NULL)
return true;
106 setServant(impl_->_this());
111 servantId_ = PortableServer::string_to_ObjectId(object_id);
112 poa_->activate_object_with_id(servantId_, impl_);
114 HPP_CORBA_CATCH(
"failed to activate the server implementation",
false);
123 poa_->deactivate_object(servantId_);
124 }
catch (
const CORBA::OBJECT_NOT_EXIST& exc) {
bool initRootPOA(bool inMultiThread)
Template CORBA server.
Definition: server.hh:124
Server(int argc, const char *argv[], const char *orb_identifier="", const char *options[][2]=0)
Constructor.
Definition: server.hxx:58
bool initRootPOA(bool inMultiThread)
Definition: server.hxx:74
T & implementation()
Return a reference to the implementation.
Definition: server.hxx:69
~Server()
Shutdown CORBA server.
Definition: server.hxx:64
CORBA::ORB::InvalidName InvalidName
Definition: server.hxx:55
#define HPP_CORBA_CATCH(msg, ret)
Definition: server.hxx:21