?
Solved

Search for CORBA binding instead of a static name

Posted on 2003-03-17
2
Medium Priority
?
198 Views
Last Modified: 2010-03-31
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
Comment
Question by:khbh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 1500 total points
ID: 8150669
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
 

Author Comment

by:khbh
ID: 8150776
OK, I've done an ugly hack that loops over the versions and has a try-catch clause.

Thanks!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month14 days, 14 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question