#include <HxNSBinding.h>
Public Methods | |
| virtual | ~HxNSBinding () |
| Destructor, remove binding from NS. More... | |
Static Public Methods | |
| HxNSBinding * | bindServer (const char *name, const char *nsAddress) |
| Registers the Constructor object of the HxServer instance in the NS that should be present at the given nsAddress and returns the binding. More... | |
|
|
Destructor, remove binding from NS.
00024 {
00025 try {
00026 _nc->unbind(_name);
00027 }
00028 catch(CORBA::Exception&) {
00029 }
00030 }
|
|
||||||||||||
|
Registers the Constructor object of the HxServer instance in the NS that should be present at the given nsAddress and returns the binding.
00034 {
00035 HxString address = nsAddress;
00036 if(address.find(":") == HxString::npos)
00037 address += ":8001";
00038
00039 HxString corbaloc = "corbaloc::";
00040 corbaloc += address;
00041 corbaloc += "/NameService";
00042
00043 try {
00044 CORBA::Object_var obj =
00045 HxServer::instance()->string_to_object(corbaloc.c_str());
00046 CosNaming::NamingContext_var nc =
00047 CosNaming::NamingContext::_narrow(obj);
00048 nc = getContext(nc, "HxCorba");
00049 nc = getContext(nc, "Servers");
00050
00051 CosNaming::Name path;
00052 path.length(1);
00053 path[0].id = name;
00054
00055 CORBA::Object_var ctor =
00056 HxServer::instance()->getInitialObject("Constructor");
00057
00058 nc->bind(path, ctor);
00059
00060 return new HxNSBinding(path, nc);
00061 }
00062 catch(CORBA::Exception& ex) {
00063 std::cerr << ex << std::endl;
00064 }
00065
00066 return NULL;
00067 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001