Posted By:
Anonymous
Posted On:
Friday, January 6, 2006 11:30 AM
If you are using a naming service, you shouldn't need to copy an IOR file around, that's what the naming service is for. The trick is for the client to get the correct key for the naming service, and then use that to find the reference to the server. Here's an example from the
JavaWorld, I prefer this over the Sun's 1.5 ORB
doc, since Sun is now using some non-standard (Sun only) calls (as if their ORB implementation wasn't non-standard enough already). You should consider upgrading from 1.3, as at least 1.4 is better than 1.3, see the JavaWorld article for more details.
// Create and initialize the ORB
ORB orb = ORB.init(args, null);
// Get the root naming context
org.omg.CORBA.Object objRef =
orb.resolve_initial_references("NameService");
// Use NamingContextExt instead of NamingContext.
This is
// part of the Interoperable Naming Service.
NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
// Resolve the object reference in Naming
String name = "BankServer";
System.out.println(args.length);
if(args.length == 5)
name = args[4];
Bank theBank = BankHelper.narrow(ncRef.resolve_str(name));
For more specific details, comp.object.corba is a great resource, especially for general questions like this, as this jguru forum gets very little traffic. CORBA is complex, partly because there are so many ways to do the same thing (BOA? POA? Event Service? Notification Service? IOR? Naming Service?). Also try comp.lang.java.corba, although if you phrase your question well enough, it would be better answered on the previous link.