• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

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_references("NameService");
org.omg.CosNaming.NamingContext namingContext = org.omg.CosNaming.NamingContextHelper.narrow(nsObj);
org.omg.CosNaming.NameComponent[] nc = { new org.omg.CosNaming.NameComponent(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_references("NameService");
org.omg.CosNaming.NamingContext namingContext = org.omg.CosNaming.NamingContextHelper.narrow(nsObj);
String theName = ???; // Something that matches "aName*", where * is the version number
org.omg.CosNaming.NameComponent[] nc = { new org.omg.CosNaming.NameComponent(theName, "") };
org.omg.CORBA.Object cfObj = namingContext.resolve(nc);
myObj = MyHelper.narrow(cfObj);

Any clues?
0
khbh
Asked:
khbh
1 Solution
 
TimYatesCommented:
I don't think you can do this...  it's a security issue that you have to know the name of the CORBA object you want, else it would be easy to search remote machines for any CORBA object, and see what you can do with any that are returned...
0
 
khbhAuthor Commented:
OK, I've done an ugly hack that loops over the versions and has a try-catch clause.

Thanks!
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now