Unverified Commit c6d103e9 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by GitHub
Browse files

Merge pull request #55 from jmirabel/devel

Allow bypassing the name service.
parents e3da9658 b3ce26e0
...@@ -43,6 +43,8 @@ class HPP_RBPRM_CORBA_DLLAPI Server : public corbaServer::ServerPlugin { ...@@ -43,6 +43,8 @@ class HPP_RBPRM_CORBA_DLLAPI Server : public corbaServer::ServerPlugin {
std::string name() const; std::string name() const;
::CORBA::Object_ptr servant (const std::string& name) const;
public: public:
corba::Server<impl::RbprmBuilder>* rbprmBuilder_; corba::Server<impl::RbprmBuilder>* rbprmBuilder_;
}; // class Server }; // class Server
......
...@@ -27,7 +27,7 @@ class Client(_Parent): ...@@ -27,7 +27,7 @@ class Client(_Parent):
""" """
defaultClients = { defaultClients = {
'rbprmbuilder': RbprmBuilder, 'builder': RbprmBuilder,
} }
def __init__(self, url=None, context="corbaserver"): def __init__(self, url=None, context="corbaserver"):
...@@ -40,7 +40,7 @@ class Client(_Parent): ...@@ -40,7 +40,7 @@ class Client(_Parent):
self._initOrb(url) self._initOrb(url)
self._makeClients("rbprm", self.defaultClients, context) self._makeClients("rbprm", self.defaultClients, context)
# self.rbprmbuilder is created by self._makeClients # self.builder is created by self._makeClients
# The old code stored the object as self.rbprm # The old code stored the object as self.rbprm
# Make it backward compatible. # Make it backward compatible.
self.rbprm = self.rbprmbuilder self.rbprm = self.builder
...@@ -35,13 +35,13 @@ std::string Server::name() const { return "rbprm"; } ...@@ -35,13 +35,13 @@ std::string Server::name() const { return "rbprm"; }
/// Start corba server /// Start corba server
void Server::startCorbaServer(const std::string& contextId, const std::string& contextKind) { void Server::startCorbaServer(const std::string& contextId, const std::string& contextKind) {
bool mThd = parent()->multiThread(); initializeTplServer (rbprmBuilder_, contextId, contextKind, name(), "builder");
rbprmBuilder_ = new corba::Server<impl::RbprmBuilder>(0, NULL, mThd, "child"); }
rbprmBuilder_->implementation().setServer(this);
if (rbprmBuilder_->startCorbaServer(contextId, contextKind, "rbprm", "rbprmbuilder") != 0) { ::CORBA::Object_ptr Server::servant(const std::string& name) const
HPP_THROW_EXCEPTION(hpp::Exception, "Failed to start corba rbprm server."); {
} if (name == "builder") return rbprmBuilder_->implementation()._this();
throw std::invalid_argument ("No servant " + name);
} }
} // namespace rbprm } // namespace rbprm
} // namespace hpp } // namespace hpp
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment