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); \ 46 using CORBA::COMM_FAILURE;
47 using CORBA::Exception;
48 using CORBA::Object_ptr;
49 using CORBA::Object_var;
50 using CORBA::ORB_init;
51 using CORBA::PolicyList;
52 using CORBA::SystemException;
53 using omniORB::fatalException;
59 const char* options[][2])
60 :
ServerBase(argc, argv, orb_identifier, options), impl_(NULL) {}
65 deactivateAndDestroyServers();
77 if (impl_ != NULL)
return true;
89 servantId_ =
poa_->activate_object(impl_);
100 if (impl_ != NULL)
return true;
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) {
133 #endif // HPP_CORBA_TEMPLATE_SERVER_HXX PortableServer::POA_var main_poa()
Definition: server.hh:86
CORBA::ORB::InvalidName InvalidName
Definition: server.hxx:55
bool initRootPOA(bool inMultiThread)
PortableServer::POA_var ins_poa_
Definition: server.hh:95
Server(int argc, const char *argv[], const char *orb_identifier="", const char *options[][2]=0)
Constructor.
Definition: server.hxx:58
T & implementation()
Return a reference to the implementation.
Definition: server.hxx:69
~Server()
Shutdown CORBA server.
Definition: server.hxx:64
#define HPP_CORBA_CATCH(msg, ret)
Definition: server.hxx:21
void setServant(CORBA::Object_ptr obj)
Template CORBA server.
Definition: server.hh:124
bool initRootPOA(bool inMultiThread)
Definition: server.hxx:74
PortableServer::POA_var poa_
Definition: server.hh:95