classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Implementing "corbaname:" object reference parsing in


From: Meskauskas Audrius
Subject: [cp-patches] FYI: Implementing "corbaname:" object reference parsing in CORBA ORB.
Date: Fri, 02 Sep 2005 17:52:22 +0200
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

This patch extends the ORB.string_to_object supported protocol set by
corbaname: protocol.

2005-09-02  <address@hidden>

       * gnu/CORBA/IOR_Delegate.java (request),
       gnu/CORBA/SocketRepository.java (get_socket),
       gnu/CORBA/gnuRequest (getParameterStream),
       gnu/CORBA/NamingService/NameParser.java,
       gnu/CORBA/NamingService/NamingServiceTransient.java: Rewritten.
       * gnu/CORBA/Functional_ORB.java (nameParser): New field.
       (string_to_object): Rewritten.
       (ior_to_object): Made public.
       * org/omg/CORBA/ORB.java (string_to_object):
       Documentation update.
? gnu/javax/swing/plaf/gtk/icons/Thumbs.db
Index: gnu/CORBA/Functional_ORB.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Functional_ORB.java,v
retrieving revision 1.17
diff -u -r1.17 Functional_ORB.java
--- gnu/CORBA/Functional_ORB.java       29 Aug 2005 21:18:31 -0000      1.17
+++ gnu/CORBA/Functional_ORB.java       2 Sep 2005 10:25:56 -0000
@@ -386,6 +386,11 @@
    * The port, on that the name service is expected to be running.
    */
   private int ns_port = 900;
+  
+  /**
+   * The name parser.
+   */
+  NameParser nameParser = new NameParser();
 
   /**
    * The instance, stored in this field, handles the asynchronous dynamic
@@ -945,32 +950,13 @@
    */
   public org.omg.CORBA.Object string_to_object(String an_ior)
   {
-    int p = an_ior.indexOf(':');
-    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+"'");
+    return nameParser.corbaloc(an_ior, this);
   }
   
   /**
    * Convert ior reference to CORBA object.
    */
-  private org.omg.CORBA.Object ior_to_object(IOR ior)
+  public org.omg.CORBA.Object ior_to_object(IOR ior)
   {
     org.omg.CORBA.Object object = find_local_object(ior);
     if (object == null)
Index: gnu/CORBA/IOR_Delegate.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/IOR_Delegate.java,v
retrieving revision 1.6
diff -u -r1.6 IOR_Delegate.java
--- gnu/CORBA/IOR_Delegate.java 28 Aug 2005 11:23:36 -0000      1.6
+++ gnu/CORBA/IOR_Delegate.java 2 Sep 2005 14:23:24 -0000
@@ -408,10 +408,11 @@
     request.set_target(target);
     request.setOperation(operation);
 
-    request.getParameterStream().response_expected = response_expected;
+    streamRequest out = request.getParameterStream();
+    out.response_expected = response_expected;
     request.setORB(orb);
 
-    return request.getParameterStream();
+    return out;
   }
 
   /**
Index: gnu/CORBA/SocketRepository.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/SocketRepository.java,v
retrieving revision 1.2
diff -u -r1.2 SocketRepository.java
--- gnu/CORBA/SocketRepository.java     2 Jul 2005 20:32:09 -0000       1.2
+++ gnu/CORBA/SocketRepository.java     2 Sep 2005 15:38:16 -0000
@@ -39,6 +39,7 @@
 package gnu.CORBA;
 
 import java.net.Socket;
+import java.net.SocketException;
 
 import java.util.HashMap;
 
@@ -70,16 +71,18 @@
 
   /**
    * Get a socket.
-   *
+   * 
    * @param key a socket key.
-   *
-   * @return an opened socket for reuse, null if no such
-   * available or it is closed.
+   * 
+   * @return an opened socket for reuse, null if no such available or it is
+   * closed.
    */
   public static Socket get_socket(Object key)
   {
     Socket s = (Socket) sockets.get(key);
-    if (s != null && s.isClosed())
+    if (s == null)
+      return null;
+    else if (s.isClosed())
       {
         sockets.remove(key);
         return null;
@@ -87,6 +90,15 @@
     else
       {
         sockets.remove(key);
+        try
+          {
+            // Set one minute time out that will be changed later.
+            s.setSoTimeout(60*1000);
+          }
+        catch (SocketException e)
+          {
+            s = null;
+          }
         return s;
       }
   }
Index: gnu/CORBA/gnuRequest.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/gnuRequest.java,v
retrieving revision 1.10
diff -u -r1.10 gnuRequest.java
--- gnu/CORBA/gnuRequest.java   28 Aug 2005 11:23:36 -0000      1.10
+++ gnu/CORBA/gnuRequest.java   2 Sep 2005 15:23:10 -0000
@@ -340,6 +340,21 @@
     m_parameter_buffer.setCodeSet(cxCodeSet.negotiate(ior.Internet.CodeSets));
     m_parameter_buffer.setOrb(orb);
     m_parameter_buffer.setBigEndian(Big_endian);
+
+    // For the old iiop versions, it is important to set the size
+    // correctly.
+    if (ior.Internet.version.until_inclusive(1, 1))
+      {
+        cdrBufOutput measure = new cdrBufOutput();
+        measure.setOffset(12);
+        if (m_rqh == null)
+          m_rqh = new gnu.CORBA.GIOP.v1_0.RequestHeader();
+        m_rqh.operation = m_operation;
+        m_rqh.object_key = ior.key;
+        m_rqh.write(measure);
+        m_parameter_buffer.setOffset(12 + measure.buffer.size());
+      }
+
     return m_parameter_buffer;
   }
 
@@ -738,7 +753,7 @@
     // This also sets the stream encoding to the encoding, specified
     // in the header.
     rh.write(request_part);
-
+    
     if (m_args != null && m_args.count() > 0)
       {
         write_parameters(header, request_part);
Index: gnu/CORBA/NamingService/NameParser.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/NamingService/NameParser.java,v
retrieving revision 1.1
diff -u -r1.1 NameParser.java
--- gnu/CORBA/NamingService/NameParser.java     29 Aug 2005 21:18:31 -0000      
1.1
+++ gnu/CORBA/NamingService/NameParser.java     2 Sep 2005 12:41:28 -0000
@@ -38,6 +38,7 @@
 
 package gnu.CORBA.NamingService;
 
+import gnu.CORBA.Functional_ORB;
 import gnu.CORBA.IOR;
 import gnu.CORBA.Unexpected;
 import gnu.CORBA.Version;
@@ -47,6 +48,12 @@
 import org.omg.CORBA.ORB;
 import org.omg.CORBA.Object;
 import org.omg.CORBA.ORBPackage.InvalidName;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.CORBA.portable.ObjectImpl;
+import org.omg.CosNaming.NamingContext;
+import org.omg.CosNaming.NamingContextExtHelper;
+import org.omg.CosNaming.NamingContextHelper;
+import org.omg.CosNaming._NamingContextStub;
 
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
@@ -67,11 +74,22 @@
  * @author Audrius Meskauskas, Lithuania (address@hidden)
  */
 public class NameParser
+  extends snConverter
 {
   /**
-   * The mandatory prefix.
+   * The corbaloc prefix.
    */
-  public static final String CORBALOC = "corbaloc";
+  public static final String pxCORBALOC = "corbaloc";
+
+  /**
+   * The corbaname prefix.
+   */
+  public static final String pxCORBANAME = "corbaname";
+
+  /**
+   * The IOR prefix.
+   */
+  public static final String pxIOR = "ior";
 
   /**
    * Marks iiop protocol.
@@ -89,22 +107,46 @@
   public static final int DEFAULT_PORT = 2809;
 
   /**
+   * The default name.
+   */
+  public static final String DEFAULT_NAME = "NameService";
+
+  /**
+   * The string to name converter, initialized on demand.
+   */
+  static snConverter converter;
+
+  /**
+   * The current position.
+   */
+  int p;
+
+  /**
+   * The address being parsed, splitted into tokens.
+   */
+  String[] t;
+
+  /**
    * Parse CORBALOC.
    * 
    * The expected format is: <br>
    * 1. corbaloc:address@hidden:host[:port]/key <br>
-   * 2. corbaloc:rir:/key <br>
+   * 2. corbaloc:rir:[/key] <br>
+   * 3. corbaname:address@hidden:host[:port]/key <br>
+   * 4. corbaname:rir:[/key] <br>
    * 
-   * protocol defaults to IOP.
+   * Protocol defaults to IOP, the object key defaults to the NameService.
    * 
    * @param corbaloc the string to parse.
    * @param orb the ORB, needed to create IORs and resolve rir references.
    * 
-   * @return the constructed IOR.
+   * @return the resolved object.
    */
-  public static java.lang.Object corbaloc(String corbaloc, ORB orb)
+  public synchronized org.omg.CORBA.Object corbaloc(String corbaloc,
+    Functional_ORB orb)
     throws BAD_PARAM
   {
+    boolean corbaname;
 
     // The alternative addresses, if given.
     ArrayList alt_addr = new ArrayList();
@@ -122,22 +164,33 @@
     // The object key as string.
     String key;
 
-    StringTokenizer st = new StringTokenizer(corbaloc, ":@/.,", true);
+    StringTokenizer st = new StringTokenizer(corbaloc, ":@/.,#", true);
 
-    String[] t = new String[st.countTokens()];
+    t = new String[st.countTokens()];
 
     for (int i = 0; i < t.length; i++)
       {
         t[i] = st.nextToken();
       }
 
-    int p = 0;
+    p = 0;
+
+    if (t[p].startsWith(pxCORBANAME))
+      corbaname = true;
+    else if (t[p].equalsIgnoreCase(pxCORBALOC))
+      corbaname = false;
+    else if (t[p].equalsIgnoreCase(pxIOR))
+      {
+        IOR ior = IOR.parse(corbaloc);
+        return orb.ior_to_object(ior);
+      }
+    else
+      throw new DATA_CONVERSION("Unsupported protocol: '" + t[p] + "'");
 
-    if (!t[p++].equalsIgnoreCase(CORBALOC))
-      throw new BAD_PARAM("Must start with corbaloc:");
+    p++;
 
     if (!t[p++].equals(":"))
-      throw new BAD_PARAM("Must start with corbaloc:");
+      throw new BAD_PARAM("Syntax (':' expected after name prefix)");
 
     // Check for rir:
     if (t[p].equals(RIR))
@@ -146,25 +199,25 @@
         if (!t[p++].equals(":"))
           throw new BAD_PARAM("':' expected after 'rir'");
 
-        key = readKey(p, t);
-        
+        key = readKey("/");
+
         Object object;
         try
           {
             object = orb.resolve_initial_references(key);
+            return corbaname ? resolve(object) : object;
           }
         catch (InvalidName e)
           {
-            throw new BAD_PARAM("Unknown initial reference '"+key+"'");
+            throw new BAD_PARAM("Unknown initial reference '" + key + "'");
           }
-        return object;
       }
     else
     // Check for iiop.
     if (t[p].equals(IIOP) || t[p].equals(":"))
       {
         IOR ior = new IOR();
-        
+
         Addresses: do
           { // Read addresses.
             if (t[p].equals(":"))
@@ -203,9 +256,9 @@
                       p++; // '@' at this point.
                     }
               }
-            
+
             ior.Internet.version = new Version(major, minor);
-            
+
             // Then host data goes till '/' or ':'.
             StringBuffer bhost = new StringBuffer(corbaloc.length());
             while (!t[p].equals(":") && !t[p].equals("/") && !t[p].equals(","))
@@ -228,12 +281,12 @@
                     throw new BAD_PARAM("Invalid port '" + t[p - 1] + "'");
                   }
               }
-            
+
             ior.Internet.port = port;
-            
+
             // Id is not listed.
             ior.Id = "";
-            
+
             if (t[p].equals(","))
               p++;
             else
@@ -241,28 +294,80 @@
           }
         while (true);
 
-        key = readKey(p, t);
+        key = readKey("/");
         ior.key = key.getBytes();
-        
-        return ior;
+
+        org.omg.CORBA.Object object = orb.ior_to_object(ior);
+        return corbaname ? resolve(object) : object;
       }
+
     else
       throw new DATA_CONVERSION("Unsupported protocol '" + t[p] + "'");
+  }
 
+  private org.omg.CORBA.Object resolve(org.omg.CORBA.Object object)
+  {
+    NamingContext ns;
+    String key = "?";
+    try
+      {
+        if (object instanceof NamingContext)
+          ns = (NamingContext) object;
+        else
+          {
+            Delegate delegate = ((ObjectImpl) object)._get_delegate();
+            ns = new _NamingContextStub(delegate);
+          }
+      }
+    catch (Exception ex)
+      {
+        BAD_PARAM bad = new BAD_PARAM("The CORBANAME target " + object
+          + " is not a NamingContext");
+        bad.minor = 10;
+        bad.initCause(ex);
+        throw bad;
+      }
+
+    if (converter == null)
+      converter = new snConverter();
+
+    try
+      {
+        key = readKey("#");
+        object = ns.resolve(converter.toName(key));
+        return object;
+      }
+    catch (Exception ex)
+      {
+        BAD_PARAM bad = new BAD_PARAM("Wrong CORBANAME '" + key + "'");
+        bad.minor = 10;
+        bad.initCause(ex);
+        throw bad;
+      }
   }
 
-  private static String readKey(int p, String[] t)
+  private String readKey(String delimiter)
     throws BAD_PARAM
   {
-    if (!t[p].equals("/"))
-      throw new BAD_PARAM("'/keyString' expected '" + t[p] + "' found");
+    if (p < t.length)
+      if (!t[p].equals(delimiter))
+        {
+          if (t[p].equals("#"))
+            return DEFAULT_NAME;
+          else
+            throw new BAD_PARAM("'" + delimiter + "String' expected '" + t[p]
+              + "' found");
+        }
 
     StringBuffer bKey = new StringBuffer();
     p++;
 
-    while (p < t.length)
+    while (p < t.length && !t[p].equals("#"))
       bKey.append(t[p++]);
 
+    if (bKey.length() == 0)
+      return DEFAULT_NAME;
+
     try
       {
         return URLDecoder.decode(bKey.toString(), "UTF-8");
@@ -272,11 +377,13 @@
         throw new Unexpected("URLDecoder does not support UTF-8", e);
       }
   }
-  
-  static void corbalocT(String ior, ORB orb)
+
+  static NameParser n = new NameParser();
+
+  static void corbalocT(String ior, Functional_ORB orb)
   {
     System.out.println(ior);
-    System.out.println(corbaloc(ior, orb));
+    System.out.println(n.corbaloc(ior, orb));
     System.out.println();
   }
 
@@ -284,7 +391,7 @@
   {
     try
       {
-        ORB orb = ORB.init(args, null);
+        Functional_ORB orb = (Functional_ORB) ORB.init(args, null);
         corbalocT("corbaloc:iiop:address@hidden/Prod/aTradingService", orb);
         corbalocT("corbaloc:iiop:address@hidden/Prod/bTradingService", orb);
         corbalocT("corbaloc:iiop:355cxyz.com/Prod/cTradingService", orb);
@@ -295,6 +402,12 @@
         corbalocT("corbaloc:iiop:address@hidden:3076/0", orb);
 
         corbalocT("corbaloc:rir:/NameService", orb);
+        corbalocT("corbaloc:rir:/", orb);
+        corbalocT("corbaloc:rir:", orb);
+
+        corbalocT("corbaloc:rir:/NameService", orb);
+        corbalocT("corbaloc:rir:/", orb);
+        corbalocT("corbaloc:rir:", orb);
 
         corbalocT("corbaloc::555xyz.com,:556xyz.com:80/Dev/NameService", orb);
       }
Index: gnu/CORBA/NamingService/NamingServiceTransient.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/CORBA/NamingService/NamingServiceTransient.java,v
retrieving revision 1.4
diff -u -r1.4 NamingServiceTransient.java
--- gnu/CORBA/NamingService/NamingServiceTransient.java 2 Jul 2005 20:32:09 
-0000       1.4
+++ gnu/CORBA/NamingService/NamingServiceTransient.java 2 Sep 2005 15:28:02 
-0000
@@ -1,44 +1,45 @@
 /* Server.java --
-   Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005 Free Software Foundation, Inc.
 
-This file is part of GNU Classpath.
+ This file is part of GNU Classpath.
 
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING.  If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library.  Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module.  An independent module is a module which is not derived from
+ or based on this library.  If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so.  If you do not wish to do so, delete this
+ exception statement from your version. */
 
 
 package gnu.CORBA.NamingService;
 
 import gnu.CORBA.Functional_ORB;
+import gnu.CORBA.IOR;
 
 import org.omg.CosNaming.NamingContextExt;
 
@@ -47,15 +48,14 @@
 import java.io.UnsupportedEncodingException;
 
 /**
- * The server for the gnu classpath naming service. This is an executable
- * class that must be started to launch the GNU Classpath CORBA
- * transient naming service.
- *
+ * The server for the gnu classpath naming service. This is an executable class
+ * that must be started to launch the GNU Classpath CORBA transient naming
+ * service.
+ * 
  * GNU Classpath currently works with this naming service and is also
- * interoperable with the Sun Microsystems naming services from
- * releases 1.3 and 1.4, both transient <i>tnameserv</i> and persistent
- * <i>orbd</i>.
- *
+ * interoperable with the Sun Microsystems naming services from releases 1.3 
and
+ * 1.4, both transient <i>tnameserv</i> and persistent <i>orbd</i>.
+ * 
  * @author Audrius Meskauskas, Lithuania (address@hidden)
  */
 public class NamingServiceTransient
@@ -67,9 +67,9 @@
   public static final int PORT = 900;
 
   /**
-   * Get the object key for the naming service. The default
-   * key is the string "NameService" in ASCII.
-   *
+   * Get the object key for the naming service. The default key is the string
+   * "NameService" in ASCII.
+   * 
    * @return the byte array.
    */
   public static byte[] getDefaultKey()
@@ -85,15 +85,14 @@
   }
 
   /**
-   * Start the naming service on the current host at the given port.
-   * The parameter  -org.omg.CORBA.ORBInitialPort NNN or
-   *  -ORBInitialPort NNN, if present, specifies the port, on that
-   * the service must be started. If this key is not specified,
-   * the service starts at the port 900.
-   *
-   * The parameter -ior FILE_NAME, if present, forces to store the ior string
-   * of this naming service to the specified file.
-   *
+   * Start the naming service on the current host at the given port. The
+   * parameter -org.omg.CORBA.ORBInitialPort NNN or -ORBInitialPort NNN, if
+   * present, specifies the port, on that the service must be started. If this
+   * key is not specified, the service starts at the port 900.
+   * 
+   * The parameter -ior FILE_NAME, if present, forces to store the ior string 
of
+   * this naming service to the specified file.
+   * 
    * @param args the parameter string.
    */
   public static void main(String[] args)
@@ -108,21 +107,24 @@
         if (args.length > 1)
           for (int i = 0; i < args.length - 1; i++)
             {
-              if (args [ i ].endsWith("ORBInitialPort"))
-                port = Integer.parseInt(args [ i + 1 ]);
+              if (args[i].endsWith("ORBInitialPort"))
+                port = Integer.parseInt(args[i + 1]);
 
-              if (args [ i ].equals("-ior"))
-                iorf = args [ i + 1 ];
+              if (args[i].equals("-ior"))
+                iorf = args[i + 1];
             }
 
         Functional_ORB.setPort(port);
 
         // Create the servant and register it with the ORB
         NamingContextExt namer = new Ext(new TransientContext());
-        orb.connect(namer, getDefaultKey());
+
+        // Case with the key "NameService".
+        orb.connect(namer, "NameService".getBytes());
 
         // Storing the IOR reference.
         String ior = orb.object_to_string(namer);
+        IOR iorr = IOR.parse(ior);
         if (iorf != null)
           {
             FileOutputStream f = new FileOutputStream(iorf);
@@ -131,22 +133,23 @@
             p.close();
           }
 
-        System.out.println("GNU Classpath, transient naming service. " +
-                           "Copyright (C) 2005 Free Software Foundation\n" +
-                           "This tool comes with ABSOLUTELY NO WARRANTY. " +
-                           "This is free software, and you are\nwelcome to " +
-                           "redistribute it under conditions, defined in " +
-                           "GNU Classpath license.\n\n" + ior
-                          );
+        System.out.println("GNU Classpath transient naming service "
+          + "started at " + iorr.Internet.host + ":" + iorr.Internet.port
+          + " key 'NameService'.\n\n"
+          + "Copyright (C) 2005 Free Software Foundation\n"
+          + "This tool comes with ABSOLUTELY NO WARRANTY. "
+          + "This is free software, and you are\nwelcome to "
+          + "redistribute it under conditions, defined in "
+          + "GNU Classpath license.\n\n" + ior);
 
         new Thread()
+        {
+          public void run()
           {
-            public void run()
-            {
-              // Wait for invocations from clients.
-              orb.run();
-            }
-          }.start();
+            // Wait for invocations from clients.
+            orb.run();
+          }
+        }.start();
       }
     catch (Exception e)
       {
@@ -154,7 +157,8 @@
         e.printStackTrace(System.out);
       }
 
-    // Restore the default value for allocating ports for the subsequent 
objects.
+    // Restore the default value for allocating ports for the subsequent
+    // objects.
     Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT);
   }
 }
Index: org/omg/CORBA/ORB.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/omg/CORBA/ORB.java,v
retrieving revision 1.14
diff -u -r1.14 ORB.java
--- org/omg/CORBA/ORB.java      29 Aug 2005 21:18:31 -0000      1.14
+++ org/omg/CORBA/ORB.java      2 Sep 2005 15:18:04 -0000
@@ -976,9 +976,37 @@
    * This type of reference may also contain multiple addresses (see
    * OMG documentation for complete format).<br>
    * 3. <b>corbaloc:rir:/</b><i>name</i> defines internal reference on this
-   * ORB that is resolved using address@hidden #resolve_initial_references}, 
using 
-   * the given <i>name</i>.
-   * <br>
+   * ORB that is resolved using address@hidden #resolve_initial_references}, 
passing 
+   * the given <i>name</i> as parameter.<br>
+   * 4. <b>corbaname:rir:#</b><i>name</i> states that the given <i>name</i>
+   * must be resolved using the naming service, default for this ORB.<br>
+   * 5. 
<b>corbaname:</b>[<b>iiop</b>][version.subversion<b>@</b>]<b>:</b>host[<b>:</b>port]<b>#</b><i>name</i>
+   * states that the <i>name</i> must be resolved using the naming service
+   * that runs on the given host at the given port. The ORB expects to find 
+   * there the address@hidden org.omg.CosNaming.NamingContext} under the key 
+   * "NameService.<br>
+   * 
+   * <p>The default port is always 2809. The default iiop version is 1.0
+   * that now may not always be supported, so we would recommend to specify
+   * the version explicitly.</p>
+   * <p>
+   * The examples of the corbaloc and corbaname addresses:<br>
+   * corbaname:rir:#xobj - ask local naming service for "xobj".<br>
+   * corbaname:rir:/NameService#xobj - same (long form).<br>
+   * corbaname:iiop:address@hidden:900#xobj - same, assuming that the naming 
+   * service runs at port 900 on the local host and supports iiop 1.2.<br>
+   * corbaname:iiop:localhost#xobj - same, assuming that the naming 
+   * service runs at port 2809 on the local host and supports iiop 1.0.<br>
+   * corbaloc::gnu.xxx.yy/Prod/TradingService - the object exists on the
+   * host gnu.xxx.yy, port 2809 having the key "Prod/TradingService". Its ORB 
+   * supports iiop 1.0.<br>
+   * corbaloc::gnu.xxx.yy/Prod/TradingService:801 - the object exists on the
+   * host gnu.xxx.yy, port 801 having the key "Prod/TradingService". Its ORB 
+   * supports iiop 1.0 (iiop keyword ommitted).<br>
+   * corbaloc:iiop:address@hidden/Prod/TradingService - the object exists on 
the
+   * host gnu.xxx.yy, port 801 having the key "Prod/TradingService". Its ORB 
+   * supports iiop 1.1.<br>
+   * corbaloc:rir:/NameService - the default naming service.
    *
    * @param IOR the object IOR representation string.
    *

reply via email to

[Prev in Thread] Current Thread [Next in Thread]