khbh
asked on
Search for CORBA binding instead of a static name
Instead of looking up a static CORBA binding I would like to search the bindings to find the desired one. The desired binding will have a name that follows a specific pattern, i.e. the version will be appended at the end.
Today I have the following in my code:
private static final String NAME = "aName";
...
org.omg.CORBA.Object nsObj = orb.resolve_initial_refere nces("Name Service");
org.omg.CosNaming.NamingCo ntext namingContext = org.omg.CosNaming.NamingCo ntextHelpe r.narrow(n sObj);
org.omg.CosNaming.NameComp onent[] nc = { new org.omg.CosNaming.NameComp onent(NAME , "") };
org.omg.CORBA.Object cfObj = namingContext.resolve(nc);
myObj = MyHelper.narrow(cfObj);
I would like to have something like:
org.omg.CORBA.Object nsObj = orb.resolve_initial_refere nces("Name Service");
org.omg.CosNaming.NamingCo ntext namingContext = org.omg.CosNaming.NamingCo ntextHelpe r.narrow(n sObj);
String theName = ???; // Something that matches "aName*", where * is the version number
org.omg.CosNaming.NameComp onent[] nc = { new org.omg.CosNaming.NameComp onent(theN ame, "") };
org.omg.CORBA.Object cfObj = namingContext.resolve(nc);
myObj = MyHelper.narrow(cfObj);
Any clues?
Today I have the following in my code:
private static final String NAME = "aName";
...
org.omg.CORBA.Object nsObj = orb.resolve_initial_refere
org.omg.CosNaming.NamingCo
org.omg.CosNaming.NameComp
org.omg.CORBA.Object cfObj = namingContext.resolve(nc);
myObj = MyHelper.narrow(cfObj);
I would like to have something like:
org.omg.CORBA.Object nsObj = orb.resolve_initial_refere
org.omg.CosNaming.NamingCo
String theName = ???; // Something that matches "aName*", where * is the version number
org.omg.CosNaming.NameComp
org.omg.CORBA.Object cfObj = namingContext.resolve(nc);
myObj = MyHelper.narrow(cfObj);
Any clues?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!