Posted By:
Anonymous
Posted On:
Wednesday, October 30, 2002 11:05 PM
I want to use the multiple naming context. In my sample application i create a new context and bind it in the root context. Then i bind my server refereance in the new context. Here is the code sample objeRef = orb.resolve_initial_references("NameService"); root_context = NamingContextHelper.narrow(objRef); NameComponent nc = new NameComponent("com",""); NameComponent ncArr[] = {nc}; NamingContext comContext = root_context.bind_new_context(ncArr); NameComponent nc1 = new NameComponent("Hello", ""); NameComponent path[] = {nc1}; comCont
More>>
I want to use the multiple naming context. In my sample application i create a new context and bind it in the root context. Then i bind my server refereance in the new context. Here is the code sample
objeRef = orb.resolve_initial_references("NameService");
root_context = NamingContextHelper.narrow(objRef);
NameComponent nc = new NameComponent("com","");
NameComponent ncArr[] = {nc};
NamingContext comContext = root_context.bind_new_context(ncArr);
NameComponent nc1 = new NameComponent("Hello", "");
NameComponent path[] = {nc1};
comContext.rebind(path, helloRef); // helloRef is the servant reference
From the client i can resolve the comContext first from the root_context then i have to resolve the servant. The code sample
NameComponent nc = new NameComponent("com", "");
NameComponent path[] = {nc};
NameComponent nc1 = new NameComponent("Hello", "");
NameComponent path1[] = {nc1};
objeRef = orb.resolve_initial_references("NameService");
root_context = NamingContextHelper.narrow(objRef);
NamingContext comContext = NamingContextHelper.narrow(root_context.resolve(path));
helloRef = HelloHelper.narrow(comContext.resolve(path1));
My question is, can the above(client)code (resolving the comContext and then resolve the servant reference) can be replced with following.
NameComponent nc2 = new NameComponent("com/Hello","");
NameComponent path2[] = {nc2};
helloRef = HelloHelper.narrow(root_context.resolve(path2));
That is , can the resolving can be like the above. If the above is wrong, how to resolve the servant reference in one resolving.
Any help is appriciated
<<Less