if (CORBA::is_nil(server_obj) == false) {
_server = plpbus_orb::OrbServer::_narrow(server_obj);
if (CORBA::is_nil(_server) == false) {
- log_info("CORBA service found: %s", server_name);
+ log_info("CORBA service found: %s\n", server_name);
ret_val = PLP_OK;
}
}
}
int BusClient::add_client_listener(IClientListener *listener_param) {
- log_debug("add_client_listener() started\n");
+ log_debug("started\n");
if (_poa == NULL) {
OrbClientImpl *client_cb;
PortableServer::ObjectId_var oid;
client_cb->_remove_ref();
_server->add_event_listener(_client, "event_message", CONST_DEFAULT_EVENT_INTERVAL);
}
- log_debug("add_client_listener() done\n");
+ log_debug("done\n");
return 0;
}
}
}
else {
- cerr << "Failed to create RootPOA." << endl;
+ log_error("Failed to create RootPOA\n");
}
return ret_val;
}
}
catch (CORBA::ORB::InvalidName&) {
// This should not happen!
- cerr << "Could not find name service." << endl;
+ log_error("Could not find name service.\n");
}
catch(CORBA::TRANSIENT& ex) {
- cerr << "Could not find name service, verify that name service is running. " << endl;
+ log_error("Could not find name service, verify that name service is running.\n");
}
catch (CORBA::NO_RESOURCES&) {
- cerr << "Could not find name service, verify that name service is running. " << endl;
+ log_error("Could not find name service, verify that name service is running.\n");
}
catch(CORBA::SystemException& ex) {
- cerr << "Could not find name service, unknown reason. " << endl;
+ log_error("Could not find name service, unknown reason.\n");
}
return ret_val;
}
OrbServerImpl::~OrbServerImpl()
{
- log_info("OrbServerImpl destroyed.\n");
+ log_info("done\n");
}
void OrbServerImpl::send_message_and_request_response(OrbClient_ptr response_listener_param,
server_id = _poa->activate_object(&server_impl);
server_ref = server_impl._this();
//this->_remove_ref();
- naming_cntx = get_service_naming_context(CONST_CONTEXT_NAME__PLPBUS, CONST_CONTEXT_KIND__PLPBUS);
+ naming_cntx = get_naming_service_context(CONST_CONTEXT_NAME__PLPBUS, CONST_CONTEXT_KIND__PLPBUS);
if (naming_cntx != NULL) {
ok_flg = bind_naming_context_and_service(naming_cntx,
server_ref,
PortableServer::POA_var rootpoa;
ret_val = NULL;
- log_debug("started");
+ log_debug("started\n");
try {
poa_obj = orb->resolve_initial_references(CONST_ROOT_POA_NAME);
log_debug("received initial reference to %s\n", CONST_ROOT_POA_NAME);
return ret_val;
}
-CosNaming::NamingContext_var OrbServerImpl::get_service_naming_context(const char *service_name_param,
+CosNaming::NamingContext_var OrbServerImpl::get_naming_service_context(const char *service_name_param,
const char *service_kind_param)
{
CosNaming::NamingContext_var ret_val;
ret_val = NULL;
try {
// get nameservice reference
- log_debug("1\n");
+ log_debug("started\n");
ns_obj = _orb->resolve_initial_references(CONST_NAME_SERVICE_NAME);
if (CORBA::is_nil(ns_obj) == false) {
- log_debug("2\n");
- // get name service context
+ // get naming service context
ns_cntx = CosNaming::NamingContext::_narrow(ns_obj);
- log_debug("3\n");
if (CORBA::is_nil(ns_cntx) == false) {
cntx_dta.length(1);
cntx_dta[0].id = CORBA::string_dup(service_name_param);
cntx_dta[0].kind = CORBA::string_dup(service_kind_param);
- log_debug("4\n");
try {
service_obj = ns_cntx->resolve(cntx_dta);
}
catch(CosNaming::NamingContext::NotFound& ex) {
- log_error("Trying to create new name service context %s.\n", service_name_param);
+ log_error("Trying to create new naming service context %s.\n", service_name_param);
}
try {
- log_debug("5\n");
if (CORBA::is_nil(service_obj)) {
- // not found, try to bind the new context to name service
- log_debug("6\n");
+ // not found, try to bind new context from naming service
ret_val = ns_cntx->bind_new_context(cntx_dta);
- log_debug("7\n");
if (CORBA::is_nil(ret_val) ) {
log_error("Failed to create new context to name service for %s.\n", service_name_param);
}
}
else {
- log_debug("8\n");
ret_val = CosNaming::NamingContext::_narrow(service_obj);
if (CORBA::is_nil(ret_val) ) {
- log_error("Failed to get name service context for %s, narrowing failed for resolved service context.\n", service_name_param);
+ log_error("Failed to get naming service context for %s, narrowing failed for resolved service context.\n", service_name_param);
}
- log_debug("9\n");
}
}
catch(CosNaming::NamingContext::AlreadyBound& ex) {
- log_error("Failed to get name service context for %s. Context with same name already exist.\n", service_name_param);
+ log_error("Failed to get naming service context for %s. Context with same name already exist.\n", service_name_param);
}
}
else {
- log_error("Failed to get name service context for %s. Could not narrow the name service.\n", service_name_param);
+ log_error("Failed to get naming service context for %s. Could not narrow the name service.\n", service_name_param);
}
+ //CORBA::release(ns_obj);
}
else {
- log_error("Failed to get name service context for %s. Could not get reference to name service.\n", service_name_param);
+ log_error("Failed to get naming service context for %s. Could not get reference to name service.\n", service_name_param);
}
}
catch (CORBA::ORB::InvalidName&) {
// This should not happen!
- log_error("Failed to get name service context for %s, name service does not exist.\n", service_name_param);
+ log_error("Failed to get naming service context for %s, name service does not exist.\n", service_name_param);
}
catch(CORBA::TRANSIENT& ex) {
- log_error("Failed to get name service context for %s, verify that name service is running.\n", service_name_param);
+ log_error("Failed to get naming service context for %s, verify that name service is running.\n", service_name_param);
}
catch (CORBA::NO_RESOURCES&) {
- log_error("Failed to get context from name service for %s, Name service is not running or has configuration problem.\n", service_name_param);
+ log_error("Failed to get context from name service for %s, Naming service is not running or has configuration problem.\n", service_name_param);
log_error("Check-list:\n");
log_error("If you have OMNIORB_CONFIG environment variable defined, verify that omniORB.cfg file exist in that location.\n");
log_error("If you do not have OMNIORB_CONFIG environment variable defined, verify that you have /etc/omniORB.cfg file\n");
log_error("Verify that InitRef line is defined in omniORB.cfg file.\n");
}
catch(CORBA::SystemException& ex) {
- log_error("Failed to get name service context for %s, system error.\n", service_name_param);
+ log_error("Failed to get naming service context for %s, system error.\n", service_name_param);
}
log_debug("done\n");
return ret_val;