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 {
std::string name() const;
::CORBA::Object_ptr servant (const std::string& name) const;
public:
corba::Server<impl::RbprmBuilder>* rbprmBuilder_;
}; // class Server
......
......@@ -27,7 +27,7 @@ class Client(_Parent):
"""
defaultClients = {
'rbprmbuilder': RbprmBuilder,
'builder': RbprmBuilder,
}
def __init__(self, url=None, context="corbaserver"):
......@@ -40,7 +40,7 @@ class Client(_Parent):
self._initOrb(url)
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
# Make it backward compatible.
self.rbprm = self.rbprmbuilder
self.rbprm = self.builder
......@@ -35,13 +35,13 @@ std::string Server::name() const { return "rbprm"; }
/// Start corba server
void Server::startCorbaServer(const std::string& contextId, const std::string& contextKind) {
bool mThd = parent()->multiThread();
rbprmBuilder_ = new corba::Server<impl::RbprmBuilder>(0, NULL, mThd, "child");
rbprmBuilder_->implementation().setServer(this);
initializeTplServer (rbprmBuilder_, contextId, contextKind, name(), "builder");
}
if (rbprmBuilder_->startCorbaServer(contextId, contextKind, "rbprm", "rbprmbuilder") != 0) {
HPP_THROW_EXCEPTION(hpp::Exception, "Failed to start corba rbprm server.");
}
::CORBA::Object_ptr Server::servant(const std::string& name) const
{
if (name == "builder") return rbprmBuilder_->implementation()._this();
throw std::invalid_argument ("No servant " + name);
}
} // namespace rbprm
} // 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