386 |
* The port, on that the name service is expected to be running. |
* The port, on that the name service is expected to be running. |
387 |
*/ |
*/ |
388 |
private int ns_port = 900; |
private int ns_port = 900; |
389 |
|
|
390 |
|
/** |
391 |
|
* The name parser. |
392 |
|
*/ |
393 |
|
NameParser nameParser = new NameParser(); |
394 |
|
|
395 |
/** |
/** |
396 |
* The instance, stored in this field, handles the asynchronous dynamic |
* The instance, stored in this field, handles the asynchronous dynamic |
950 |
*/ |
*/ |
951 |
public org.omg.CORBA.Object string_to_object(String an_ior) |
public org.omg.CORBA.Object string_to_object(String an_ior) |
952 |
{ |
{ |
953 |
int p = an_ior.indexOf(':'); |
return nameParser.corbaloc(an_ior, this); |
|
if (p < 0) |
|
|
throw new BAD_PARAM("IOR: or CORBALOC: prefix expected"); |
|
|
|
|
|
String prefix = an_ior.substring(0, p).toLowerCase(); |
|
|
|
|
|
if (prefix.equals("ior")) |
|
|
{ |
|
|
IOR ior = IOR.parse(an_ior); |
|
|
return ior_to_object(ior); |
|
|
} |
|
|
else if (prefix.equals("corbaloc")) |
|
|
{ |
|
|
java.lang.Object r = NameParser.corbaloc(an_ior, this); |
|
|
if (r instanceof IOR) |
|
|
return ior_to_object((IOR) r); |
|
|
else |
|
|
return (org.omg.CORBA.Object) r; |
|
|
} |
|
|
else throw new DATA_CONVERSION("Unsupported prefix '"+prefix+"'"); |
|
954 |
} |
} |
955 |
|
|
956 |
/** |
/** |
957 |
* Convert ior reference to CORBA object. |
* Convert ior reference to CORBA object. |
958 |
*/ |
*/ |
959 |
private org.omg.CORBA.Object ior_to_object(IOR ior) |
public org.omg.CORBA.Object ior_to_object(IOR ior) |
960 |
{ |
{ |
961 |
org.omg.CORBA.Object object = find_local_object(ior); |
org.omg.CORBA.Object object = find_local_object(ior); |
962 |
if (object == null) |
if (object == null) |