harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r453541 [6/6] - in /incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java: java/rmi/ java/rmi/activation/ java/rmi/dgc/ java/rmi/registry/ java/rmi/server/ org/apache/harmony/rmi/ org/apache/harmony/rmi/activation/ org/apache/...
Date Fri, 06 Oct 2006 10:15:55 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/RMIObjectInfo.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/RMIObjectInfo.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/RMIObjectInfo.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/RMIObjectInfo.java Fri Oct  6 03:15:51 2006
@@ -213,7 +213,7 @@
                                         }
                                     }, acc);
                         }
-                    }, "Unreferenced", false, false)));
+                    }, "Unreferenced", false, false))); //$NON-NLS-1$
             uThread.setContextClassLoader(loader);
             uThread.start();
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/RMIReference.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/RMIReference.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/RMIReference.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/RMIReference.java Fri Oct  6 03:15:51 2006
@@ -26,6 +26,7 @@
 import java.lang.ref.WeakReference;
 
 import org.apache.harmony.rmi.common.RMILog;
+import org.apache.harmony.rmi.internal.nls.Messages;
 
 
 /**
@@ -73,15 +74,17 @@
 
 
                 if (DGCImpl.dgcLog.isLoggable(RMILog.VERBOSE)) {
-                    DGCImpl.dgcLog.log(RMILog.VERBOSE, "Strongly referenced "
-                            + strongRef);
+                    // rmi.log.9F=Strongly referenced {0}
+                    DGCImpl.dgcLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.9F", //$NON-NLS-1$
+                            strongRef));
                 }
             }
         } else {
             if (strongRef != null
                     && DGCImpl.dgcLog.isLoggable(RMILog.VERBOSE)) {
-                DGCImpl.dgcLog.log(RMILog.VERBOSE, "Weakly referenced "
-                        + strongRef);
+                // rmi.log.10D=Weakly referenced {0}
+                DGCImpl.dgcLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.10D", //$NON-NLS-1$
+                        strongRef));
             }
             strongRef = null;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/RemoteRefBase.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/RemoteRefBase.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/RemoteRefBase.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/RemoteRefBase.java Fri Oct  6 03:15:51 2006
@@ -78,8 +78,8 @@
      * @see RemoteRef.remoteToString()
      */
     public String remoteToString() {
-        return getRefClass(null) + "[endpoint:[" + ep + "]"
-                + ((isLocal) ? "(local)" : "(remote)") + ", " + objId + "]";
+        return getRefClass(null) + "[endpoint:[" + ep + "]" //$NON-NLS-1$ //$NON-NLS-2$
+                + ((isLocal) ? "(local)" : "(remote)") + ", " + objId + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/ServerConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/ServerConnection.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/ServerConnection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/ServerConnection.java Fri Oct  6 03:15:51 2006
@@ -41,6 +41,7 @@
 
 import org.apache.harmony.rmi.common.RMILog;
 import org.apache.harmony.rmi.common.RMIUtil;
+import org.apache.harmony.rmi.internal.nls.Messages;
 import org.apache.harmony.rmi.remoteref.UnicastServerRef;
 import org.apache.harmony.rmi.transport.Endpoint;
 import org.apache.harmony.rmi.transport.RMIObjectInputStream;
@@ -125,7 +126,8 @@
                 try {
                     id = ObjID.read(oin);
                 } catch (IOException ioe) {
-                    throw new UnmarshalException("Unable to read Object ID",
+                    // rmi.74=Unable to read Object ID
+                    throw new UnmarshalException(Messages.getString("rmi.74"), //$NON-NLS-1$
                             ioe);
                 }
                 RMIObjectInfo info = ExportManager.getInfo(id);
@@ -133,8 +135,9 @@
 
                 if (info == null) {
                     sref = null;
+                    // rmi.75=No objects with {0} exported.
                     exToReturn = new NoSuchObjectException(
-                            "No objects with " + id + " exported.");
+                            Messages.getString("rmi.75",id)); //$NON-NLS-1$
                 } else {
                     sref = info.sref;
 
@@ -144,8 +147,9 @@
 
                     if (ServerConnectionManager.transportLog.isLoggable(
                             RMILog.VERBOSE)) {
+                        // rmi.76=Dispatch call for processing
                         ServerConnectionManager.transportLog.log(RMILog.VERBOSE,
-                                "Dispatch call for processing");
+                                Messages.getString("rmi.76")); //$NON-NLS-1$
                     }
 
                     // Dispatch the call for processing
@@ -174,8 +178,9 @@
                         IOException ioe = (IOException) pae.getException();
 
                         if (ioe instanceof RemoteException) {
-                            exToReturn = new ServerException(
-                                    "RemoteException occurred in server thread",
+                            // rmi.77=RemoteException occurred in server thread
+                            exToReturn = new ServerException(Messages
+                                    .getString("rmi.77"), //$NON-NLS-1$
                                     ioe);
                         } else {
                             throw ioe;
@@ -189,9 +194,9 @@
                     sCall.releaseInputStream();
                     if (ServerConnectionManager.transportLog.isLoggable(
                             RMILog.VERBOSE)) {
+                        // rmi.log.10B=Return exception to the client: {0}
                         ServerConnectionManager.transportLog.log(RMILog.VERBOSE,
-                                "Return exception to the client: "
-                                + exToReturn);
+                                Messages.getString("rmi.log.10B", exToReturn));//$NON-NLS-1$
                     }
                     DataOutputStream dout = new DataOutputStream(out);
                     RMIObjectOutputStream oout;
@@ -274,8 +279,9 @@
         } catch (IOException e) {
             if (ServerConnectionManager.transportLog.isLoggable(
                     RMILog.VERBOSE)) {
+                // rmi.log.10C=Note: close operation produced exception:
                 ServerConnectionManager.transportLog.log(RMILog.VERBOSE,
-                        "Note: close operation produced exception: ", e);
+                        Messages.getString("rmi.log.10C"), e); //$NON-NLS-1$
             }
         }
     }
@@ -327,6 +333,6 @@
      * @return string representation of this connection
      */
     public String toString() {
-        return RMIUtil.getShortName(getClass()) + ": remote endpoint:" + ep;
+        return RMIUtil.getShortName(getClass()) + ": remote endpoint:" + ep; //$NON-NLS-1$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/ServerConnectionManager.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/ServerConnectionManager.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/ServerConnectionManager.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/ServerConnectionManager.java Fri Oct  6 03:15:51 2006
@@ -35,6 +35,7 @@
 
 import org.apache.harmony.rmi.common.CreateThreadAction;
 import org.apache.harmony.rmi.common.RMILog;
+import org.apache.harmony.rmi.internal.nls.Messages;
 import org.apache.harmony.rmi.transport.Endpoint;
 import org.apache.harmony.rmi.transport.proxy.HttpInboundSocket;
 import org.apache.harmony.rmi.transport.proxy.HttpServerConnection;
@@ -132,8 +133,8 @@
         }
         mgr = new ServerConnectionManager(ep);
         ((Thread) AccessController.doPrivileged(
-                new CreateThreadAction(mgr, "ServerConnectionManager["
-                        + mgr.getEndpoint() + "]", true))).start();
+                new CreateThreadAction(mgr, "ServerConnectionManager[" //$NON-NLS-1$
+                        + mgr.getEndpoint() + "]", true))).start(); //$NON-NLS-1$
         if (tmpl == null) {
             tmpl = Endpoint.createTemplate(ep);
         }
@@ -268,12 +269,13 @@
          * (see comment for CreateThreadAction class).
          */
         Thread connThread = (Thread) AccessController.doPrivileged(
-                new CreateThreadAction(conn, "Call from " + conn.ep, true,
+                new CreateThreadAction(conn, "Call from " + conn.ep, true, //$NON-NLS-1$
                         false));
         connThread.start();
 
         if (transportLog.isLoggable(RMILog.VERBOSE)) {
-            transportLog.log(RMILog.VERBOSE, "Accepted " + conn);
+            // rmi.log.10A=Accepted {0}
+            transportLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.10A", conn)); //$NON-NLS-1$
         }
         return conn;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/ServerRemoteCall.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/ServerRemoteCall.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/ServerRemoteCall.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/server/ServerRemoteCall.java Fri Oct  6 03:15:51 2006
@@ -30,6 +30,7 @@
 import java.io.ObjectOutput;
 import java.rmi.server.RemoteCall;
 
+import org.apache.harmony.rmi.internal.nls.Messages;
 import org.apache.harmony.rmi.transport.RMIObjectInputStream;
 import org.apache.harmony.rmi.transport.RMIObjectOutputStream;
 import org.apache.harmony.rmi.transport.RMIProtocolConstants;
@@ -122,8 +123,8 @@
     public ObjectOutput getResultStream(boolean success)
             throws IOException, StreamCorruptedException {
         if (hasResStream) {
-            throw new StreamCorruptedException(
-                    "getResultStream() method has already been called.");
+            // rmi.7A=getResultStream() method has already been called.
+            throw new StreamCorruptedException(Messages.getString("rmi.7A")); //$NON-NLS-1$
         }
         (new DataOutputStream(conn.getOutputStream())).writeByte(CALL_OK);
 
@@ -169,7 +170,7 @@
      * @return string representation of this RemoteCall
      */
     public String toString() {
-        return "ServerRemoteCall: connection: " + conn;
+        return "ServerRemoteCall: connection: " + conn; //$NON-NLS-1$
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/DefaultRMISocketFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/DefaultRMISocketFactory.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/DefaultRMISocketFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/DefaultRMISocketFactory.java Fri Oct  6 03:15:51 2006
@@ -38,6 +38,7 @@
 import org.apache.harmony.rmi.common.GetLongPropAction;
 import org.apache.harmony.rmi.common.RMILog;
 import org.apache.harmony.rmi.common.RMIProperties;
+import org.apache.harmony.rmi.internal.nls.Messages;
 import org.apache.harmony.rmi.transport.proxy.HttpProxyRMISocketFactory;
 import org.apache.harmony.rmi.transport.proxy.Proxy;
 import org.apache.harmony.rmi.transport.proxy.ProxyRMISocketFactory;
@@ -102,8 +103,9 @@
      */
     public Socket createSocket(String host, int port) throws IOException {
         if (proxyTransportLog.isLoggable(RMILog.BRIEF)) {
+            // rmi.log.114=Creating socket to [{0}:{1}].
             proxyTransportLog.log(RMILog.BRIEF,
-                    "Creating socket to [" + host + ':' + port + "].");
+                    Messages.getString("rmi.log.114", host, port)); //$NON-NLS-1$
         }
         Socket s = null;
         Proxy proxy = new Proxy();
@@ -111,10 +113,10 @@
         if (disableDirectSocket) {
             // If direct connections are disabled, fallback to proxy connection.
             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
+                // rmi.log.115=Direct socket connections disabled, trying proxy connection to [{0}:{1}].
                 proxyTransportLog.log(RMILog.VERBOSE,
-                        "Direct socket connections disabled, "
-                        + "trying proxy connection to ["
-                        + host + ':' + port + "].");
+                        Messages.getString("rmi.log.115", //$NON-NLS-1$
+                                host, port));
             }
         } else {
             if (disableHttp || !(proxy.isSet())) {
@@ -122,7 +124,8 @@
                 s = directRsf.createSocket(host, port);
 
                 if (s == null) {
-                    String msg = "Unable to connect to [" + host + ':' + port
+                    // rmi.log.116=Unable to connect to [
+                    String msg = Messages.getString("rmi.log.116") + host + ':' + port //$NON-NLS-1$
                             + ']';
                     if (proxyTransportLog.isLoggable(RMILog.BRIEF)) {
                         proxyTransportLog.log(RMILog.BRIEF, msg);
@@ -142,9 +145,9 @@
                 if (s == null) {
                     // Direct socket attempt failed.
                     if (proxyTransportLog.isLoggable(RMILog.BRIEF)) {
-                        proxyTransportLog.log(RMILog.BRIEF,
-                                "Direct socket connection to ["
-                                + host + ':' + port + "] failed.");
+                        // rmi.log.117=Direct socket connection to [{0}:{1}] failed.
+                        proxyTransportLog.log(RMILog.BRIEF, Messages.getString(
+                                "rmi.log.117", host, port)); //$NON-NLS-1$
                     }
 
                     if (ex != null) {
@@ -156,19 +159,21 @@
                             throw ex;
                         } else {
                             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
+                                // rmi.log.118=Trying proxy connection to [{1}:{1}].
                                 proxyTransportLog.log(RMILog.VERBOSE,
-                                        "Trying proxy connection to ["
-                                        + host + ':' + port + "].");
+                                        Messages.getString("rmi.log.118", //$NON-NLS-1$
+                                        host, port ));
                             } // Falling through to HTTP connection attempt.
                         }
                     } else {
-                        throw new NoRouteToHostException("Connection "
-                                + "to [" + host + ':' + port + "] timed out");
+                        // rmi.log.119=Connection to [{0}:{1}] timed out
+                        throw new NoRouteToHostException(Messages.getString("rmi.log.119", //$NON-NLS-1$
+                                host, port));
                     }
                 } else if (proxyTransportLog.isLoggable(RMILog.BRIEF)) {
+                    // rmi.log.11A=Direct socket connection to [{0}:{1}] from port {2} succeeded.
                     proxyTransportLog.log(RMILog.BRIEF,
-                            "Direct socket connection to [" + host + ':' + port
-                            + "] from port " + s.getLocalPort()+ " succeeded.");
+                            Messages.getString("rmi.log.11A", new Object[]{host, port, s.getLocalPort()})); //$NON-NLS-1$
                 }
             }
         }
@@ -178,8 +183,8 @@
             s = proxyRsf.createSocket(proxy, host, port);
 
             if (s == null) {
-                String msg = "Proxy connection to [" + host + ':' + port
-                        + "] failed";
+                // rmi.log.11B=Proxy connection to [{0}:{1}] failed
+                String msg = Messages.getString("rmi.log.11B", host, port); //$NON-NLS-1$
                 if (proxyTransportLog.isLoggable(RMILog.BRIEF)) {
                     proxyTransportLog.log(RMILog.BRIEF, msg);
                 }
@@ -188,9 +193,9 @@
             }
 
             if (proxyTransportLog.isLoggable(RMILog.BRIEF)) {
-                proxyTransportLog.log(RMILog.BRIEF,
-                        "Proxy connection to [" + host + ':' + port
-                        + "] from port " + s.getLocalPort()+ " succeeded.");
+                // rmi.log.11C=Proxy connection to [{0}:{1}] from port {2} succeeded.
+                proxyTransportLog.log(RMILog.BRIEF,Messages.getString("rmi.log.11C", //$NON-NLS-1$
+                        new Object[]{host, port, s.getLocalPort()}));
             }
         }
         return s;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/Endpoint.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/Endpoint.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/Endpoint.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/Endpoint.java Fri Oct  6 03:15:51 2006
@@ -40,6 +40,7 @@
 import org.apache.harmony.rmi.common.GetLongPropAction;
 import org.apache.harmony.rmi.common.GetStringPropAction;
 import org.apache.harmony.rmi.common.RMIProperties;
+import org.apache.harmony.rmi.internal.nls.Messages;
 
 
 /**
@@ -167,14 +168,15 @@
             s = DefaultRMISocketFactory.getNonNullClientFactory(csf)
                     .createSocket(host, port);
         } catch (java.net.UnknownHostException uhe) {
+            // rmi.80=Unable to connect to server {0}
             throw new java.rmi.UnknownHostException(
-                    "Unable to connect to server " + toString(), uhe);
+                    Messages.getString("rmi.80", toString()), uhe); //$NON-NLS-1$
         } catch (java.net.ConnectException ce) {
             throw new java.rmi.ConnectException(
-                    "Unable to connect to server " + toString(), ce);
+                    Messages.getString("rmi.80", toString()), ce); //$NON-NLS-1$
         } catch (IOException ioe) {
             throw new ConnectIOException(
-                    "Unable to connect to server " + toString(), ioe);
+                    Messages.getString("rmi.80", toString()), ioe); //$NON-NLS-1$
         }
         return s;
     }
@@ -319,16 +321,16 @@
      * @return string representation of this Endpoint
      */
     public String toString() {
-        String str = "[" + host + ":" + port;
+        String str = "[" + host + ":" + port; //$NON-NLS-1$ //$NON-NLS-2$
 
         if (csf != null) {
-            str += ", csf: " + csf;
+            str += ", csf: " + csf; //$NON-NLS-1$
         }
 
         if (ssf != null) {
-            str += ", ssf: " + ssf;
+            str += ", ssf: " + ssf; //$NON-NLS-1$
         }
-        return str  + "]";
+        return str  + "]"; //$NON-NLS-1$
     }
 
     /*
@@ -394,7 +396,7 @@
         String addr = iaddr.getHostAddress();
         FQDNGetter getter = new FQDNGetter(addr);
         Thread fqdnThread = (Thread) AccessController.doPrivileged(
-                new CreateThreadAction(getter, "FQDN getter.", true));
+                new CreateThreadAction(getter, "FQDN getter.", true)); //$NON-NLS-1$
 
         try {
             synchronized (getter) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/RMIObjectInputStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/RMIObjectInputStream.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/RMIObjectInputStream.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/RMIObjectInputStream.java Fri Oct  6 03:15:51 2006
@@ -32,6 +32,7 @@
 
 import org.apache.harmony.rmi.common.GetBooleanPropAction;
 import org.apache.harmony.rmi.common.RMIProperties;
+import org.apache.harmony.rmi.internal.nls.Messages;
 
 
 /**
@@ -193,7 +194,8 @@
                 } else if (cl == Void.TYPE) {
                     return null;
                 } else {
-                    throw new IOException("Unknown primitive class: " + cl);
+                    // rmi.7F=Unknown primitive class: {0}
+                    throw new IOException(Messages.getString("rmi.7F", cl)); //$NON-NLS-1$
                 }
             } else {
                 return readObject();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/RMIObjectOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/RMIObjectOutputStream.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/RMIObjectOutputStream.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/RMIObjectOutputStream.java Fri Oct  6 03:15:51 2006
@@ -33,6 +33,7 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
+import org.apache.harmony.rmi.internal.nls.Messages;
 import org.apache.harmony.rmi.server.ExportManager;
 
 
@@ -194,8 +195,8 @@
                 writeChar(((Character) obj).charValue());
             } else if (cl == Void.TYPE) {
             } else {
-                throw new IOException("Unable to serialize primitive class: "
-                        + cl);
+                // rmi.7E=Unable to serialize primitive class: {0}
+                throw new IOException(Messages.getString("rmi.7E", cl));//$NON-NLS-1$
             }
         } else {
             writeObject(obj);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpConnection.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpConnection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpConnection.java Fri Oct  6 03:15:51 2006
@@ -30,6 +30,7 @@
 
 import org.apache.harmony.rmi.client.ClientConnection;
 import org.apache.harmony.rmi.common.RMILog;
+import org.apache.harmony.rmi.internal.nls.Messages;
 import org.apache.harmony.rmi.transport.Endpoint;
 
 
@@ -69,8 +70,8 @@
             dout.flush();
 
             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-                proxyTransportLog.log(RMILog.VERBOSE,
-                        "Using singleop RMI protocol");
+                // rmi.log.130=Using singleop RMI protocol
+                proxyTransportLog.log(RMILog.VERBOSE,Messages.getString("rmi.log.130")); //$NON-NLS-1$
             }
             dout.flush();
         } catch (RemoteException re) {
@@ -78,8 +79,8 @@
             throw re;
         } catch (IOException ioe) {
             close();
-            throw new ConnectIOException(
-                    "Unable to acknowledge protocol with server", ioe);
+            // rmi.8E=Unable to acknowledge protocol with server
+            throw new ConnectIOException(Messages.getString("rmi.8E"), ioe); //$NON-NLS-1$
         }
 
         // protocol is agreed
@@ -104,7 +105,8 @@
      * Always throws error because this connection is not reusable.
      */
     public boolean reuse() {
-        throw new Error(toString() + " is not reusable.");
+        // rmi.8F={0} is not reusable.
+        throw new Error(Messages.getString("rmi.8F", toString())); //$NON-NLS-1$
     }
 
     /**
@@ -127,6 +129,7 @@
      * Always throws error because this connection is not reusable.
      */
     public long getExpiration() {
-        throw new Error(toString() + " is not reusable.");
+        // rmi.8F={0} is not reusable.
+        throw new Error(Messages.getString("rmi.8F", toString())); //$NON-NLS-1$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpInboundSocket.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpInboundSocket.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpInboundSocket.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpInboundSocket.java Fri Oct  6 03:15:51 2006
@@ -91,7 +91,7 @@
      * {@inheritDoc}
      */
     public String toString() {
-        return ("HttpInboundSocket[" + s.toString() + ", "
+        return ("HttpInboundSocket[" + s.toString() + ", " //$NON-NLS-1$ //$NON-NLS-2$
                 + host + ':' + port + ']');
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpInputStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpInputStream.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpInputStream.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpInputStream.java Fri Oct  6 03:15:51 2006
@@ -29,6 +29,7 @@
 import java.io.InputStream;
 
 import org.apache.harmony.rmi.common.RMILog;
+import org.apache.harmony.rmi.internal.nls.Messages;
 
 
 /**
@@ -107,8 +108,9 @@
             available--;
 
             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
+                // rmi.log.128=Read 1 byte, {0} remaining.
                 proxyTransportLog.log(RMILog.VERBOSE,
-                        "Read 1 byte, " + available + " remaining.");
+                        Messages.getString("rmi.log.128", available )); //$NON-NLS-1$
             }
         }
 
@@ -133,13 +135,15 @@
 
         int readSize = in.read(b, off, len);
 
-        assert (readSize <= len) : "readSize is greater than len";
+        // rmi.8D=readSize is greater than len
+        assert (readSize <= len) : Messages.getString("rmi.8D"); //$NON-NLS-1$
 
         available -= readSize;
 
+        // rmi.log.129=Read {0} bytes, {1} remaining.
         if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-            proxyTransportLog.log(RMILog.VERBOSE,
-                    "Read " + readSize + " bytes, " + available + " remaining.");
+            proxyTransportLog.log(RMILog.VERBOSE,Messages.getString("rmi.log.129", //$NON-NLS-1$
+                    readSize, available ));
         }
 
         return readSize;
@@ -175,23 +179,27 @@
         String expectHeader;
 
         if (inbound) {
-            expectName = "POST request";
+            expectName = "POST request"; //$NON-NLS-1$
             expectHeader = HTTP_REQUEST_SIGNATURE;
         } else {
-            expectName = "HTTP response";
+            expectName = "HTTP response"; //$NON-NLS-1$
             expectHeader = HTTP_RESPONSE_HEADER_SIGNATURE;
         }
 
         String[] errorMessages = {
-                ("Unable to read header data, couldn't find " + expectName),
-                "Unable to read header data, Content-Length not specified",
-                "Unable to read input stream data, no data found"
+                // rmi.log.12A=Unable to read header data, couldn't find {0}
+                Messages.getString("rmi.log.12A", expectName), //$NON-NLS-1$
+                // rmi.log.12B=Unable to read header data, Content-Length not specified
+                Messages.getString("rmi.log.12B"), //$NON-NLS-1$
+                // rmi.log.12C=Unable to read input stream data, no data found
+                Messages.getString("rmi.log.12C") //$NON-NLS-1$
         };
 
         // Looking for headers phases sequentially.
         for (int phase = 0; ; phase++) {
+            // rmi.89=Incorrect phase: {0}
             assert ((phase >= 0) && (phase <= 2))
-                    : ("Incorrect phase: " + phase);
+                    : (Messages.getString("rmi.89", phase)); //$NON-NLS-1$
 
             String expectSubject;
             String expectString;
@@ -204,7 +212,7 @@
                 expectStringLength = expectHeader.length();
                 break;
             case 1:
-                expectSubject = "Content-Length specification";
+                expectSubject = "Content-Length specification"; //$NON-NLS-1$
                 expectString = CONTENT_LENGTH_SIGNATURE;
                 expectStringLength = CONTENT_LENGTH_SIGNATURE_LENGTH;
                 break;
@@ -231,8 +239,8 @@
 
                 // Diagnostic print.
                 if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-                    proxyTransportLog.log(RMILog.VERBOSE,
-                            "Header line received: [" + line + "].");
+                    // rmi.log.12D=Header line received: [{0}].
+                    proxyTransportLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.12D", line )); //$NON-NLS-1$
                 }
 
                 // Checking for empty line.
@@ -242,8 +250,8 @@
                     } else { // phase == 2
                         // Empty line found, end of headers, everything's fine.
                         if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-                            proxyTransportLog.log(RMILog.VERBOSE,
-                                    "Input stream data found, stream ready.");
+                            // rmi.log.12E=Input stream data found, stream ready.
+                            proxyTransportLog.log(RMILog.VERBOSE,Messages.getString("rmi.log.12E")); //$NON-NLS-1$
                         }
                         return;
                     }
@@ -265,8 +273,9 @@
                 if (line.regionMatches(
                         (phase == 1), 0, expectString, 0, expectStringLength)) {
                     if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
+                        // rmi.log.12F={0} found.
                         proxyTransportLog.log(RMILog.VERBOSE,
-                                expectSubject + " found.");
+                                Messages.getString("rmi.log.12F", expectSubject)); //$NON-NLS-1$
                     }
 
                     if (phase == 1) {
@@ -275,19 +284,21 @@
                             available = Integer.parseInt(
                                     line.substring(expectStringLength).trim());
                         } catch (NumberFormatException e) {
+                            // rmi.8A=Content-Length specified incorrectly: {0}
                             throw new IOException(
-                                    "Content-Length specified incorrectly: "
-                                    + line);
+                                    Messages.getString("rmi.8A", line));//$NON-NLS-1$
                         }
 
                         if (available < 0) {
+                            // rmi.8B=Invalid Content-Length: {0}
                             throw new IOException(
-                                    "Invalid Content-Length: " + available);
+                                    Messages.getString("rmi.8B", available)); //$NON-NLS-1$
                         }
 
                         if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
+                            // rmi.8C=Content-Length received: {0}
                             proxyTransportLog.log(RMILog.VERBOSE,
-                                    "Content-Length received: " + available);
+                                    Messages.getString("rmi.8C", available)); //$NON-NLS-1$
                         }
                     }
                     // Move to the next phase.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpOutboundSocket.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpOutboundSocket.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpOutboundSocket.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpOutboundSocket.java Fri Oct  6 03:15:51 2006
@@ -137,7 +137,7 @@
      * {@inheritDoc}
      */
     public String toString() {
-        return ("HttpOutboundSocket[" + s.toString() + ", "
-                + host + ':' + port + ", " + (cgi ? "" : "non-") + "CGI]");
+        return ("HttpOutboundSocket[" + s.toString() + ", " //$NON-NLS-1$ //$NON-NLS-2$
+                + host + ':' + port + ", " + (cgi ? "" : "non-") + "CGI]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpOutputStream.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpOutputStream.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpOutputStream.java Fri Oct  6 03:15:51 2006
@@ -31,6 +31,7 @@
 import org.apache.harmony.rmi.common.GetStringPropAction;
 import org.apache.harmony.rmi.common.RMIConstants;
 import org.apache.harmony.rmi.common.RMILog;
+import org.apache.harmony.rmi.internal.nls.Messages;
 
 
 /**
@@ -159,7 +160,8 @@
      */
     public synchronized void close() throws IOException {
         if (isClosed) {
-            throw new IOException("Repeated attempt to close HttpOutputStream");
+            // rmi.88=Repeated attempt to close HttpOutputStream
+            throw new IOException(Messages.getString("rmi.88")); //$NON-NLS-1$
         }
 
         // Port the outbound connection is established to.
@@ -187,16 +189,16 @@
         //          Proxy-Connection: keep-alive
         //          Content-Length: LENGTH
         out.writeBytes((inbound ? HTTP_RESPONSE_HEADER :
-                (HTTP_REQUEST_SIGNATURE + "http://" + host + ':' + connectPort
-                    + '/' + (cgi ? ("cgi-bin/java-rmi?forward=" + port) : "")
-                    + " HTTP/1.1" + EOLN
-                + "Cache-Control: no-cache" + EOLN + "Pragma: no-cache" + EOLN
-                + "Host: " + host + ':' + connectPort + EOLN
-                + "Proxy-Connection: keep-alive" + EOLN
-                + "User-Agent: DRL/" + (String) AccessController.doPrivileged(
-                        new GetStringPropAction("java.version")))) + EOLN);
+                (HTTP_REQUEST_SIGNATURE + "http://" + host + ':' + connectPort //$NON-NLS-1$
+                    + '/' + (cgi ? ("cgi-bin/java-rmi?forward=" + port) : "") //$NON-NLS-1$ //$NON-NLS-2$
+                    + " HTTP/1.1" + EOLN //$NON-NLS-1$
+                + "Cache-Control: no-cache" + EOLN + "Pragma: no-cache" + EOLN //$NON-NLS-1$ //$NON-NLS-2$
+                + "Host: " + host + ':' + connectPort + EOLN //$NON-NLS-1$
+                + "Proxy-Connection: keep-alive" + EOLN //$NON-NLS-1$
+                + "User-Agent: DRL/" + (String) AccessController.doPrivileged( //$NON-NLS-1$
+                        new GetStringPropAction("java.version")))) + EOLN); //$NON-NLS-1$
 
-        out.writeBytes("Content-type: application/octet-stream" + EOLN
+        out.writeBytes("Content-type: application/octet-stream" + EOLN //$NON-NLS-1$
                 + CONTENT_LENGTH_SIGNATURE + ' ' + count + EOLN + EOLN);
         out.write(buf, 0, count);
         out.flush();
@@ -207,9 +209,9 @@
 
         if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
             proxyTransportLog.log(RMILog.VERBOSE,
-                    "HTTP " + (inbound ? "response" : "request")
-                    + ((host != null) ? (" to [" + host + ':' + port + ']')
-                            : "") + " sent.");
+                    "HTTP " + (inbound ? "response" : "request") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                    + ((host != null) ? (" to [" + host + ':' + port + ']') //$NON-NLS-1$
+                            : "") + " sent."); //$NON-NLS-1$ //$NON-NLS-2$
         }
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpProxyRMISocketFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpProxyRMISocketFactory.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpProxyRMISocketFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpProxyRMISocketFactory.java Fri Oct  6 03:15:51 2006
@@ -29,6 +29,7 @@
 
 import org.apache.harmony.rmi.common.GetBooleanPropAction;
 import org.apache.harmony.rmi.common.RMILog;
+import org.apache.harmony.rmi.internal.nls.Messages;
 
 
 /**
@@ -57,9 +58,8 @@
         if (((Boolean) AccessController.doPrivileged(new GetBooleanPropAction(
                 DISABLE_PLAIN_HTTP_PROP))).booleanValue()) {
             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-                proxyTransportLog.log(RMILog.VERBOSE,
-                        "Plain HTTP connections disabled, "
-                        + "trying CGI connection.");
+                // rmi.log.131=Plain HTTP connections disabled, trying CGI connection.
+                proxyTransportLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.131")); //$NON-NLS-1$
             }
         } else {
             try {
@@ -67,18 +67,18 @@
                 s = new HttpOutboundSocket(proxy, host, port, false);
 
                 if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
+                    // rmi.log.132=Plain HTTP connection to [{0}:{1}] from port {2} succeeded.
                     proxyTransportLog.log(RMILog.VERBOSE,
-                            "Plain HTTP connection to [" + host + ':' + port
-                            + "] from port " + s.getLocalPort()+ " succeeded.");
+                            Messages.getString("rmi.log.132", new Object[]{host, port, s.getLocalPort()})); //$NON-NLS-1$
                 }
 
                 return s;
             } catch (IOException e) {
                 if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
+                    // rmi.log.133=Plain HTTP connection to [{0}:{1}] failed: {2}. Trying CGI connection.
                     proxyTransportLog.log(RMILog.VERBOSE,
-                            "Plain HTTP connection to ["
-                            + host + ':' + port + "] failed: " + e
-                            + ". Trying CGI connection.");
+                            Messages.getString("rmi.log.133", //$NON-NLS-1$
+                            new Object[]{ host, port, e}));
                 }
             }
         }
@@ -88,16 +88,18 @@
             s = new HttpOutboundSocket(proxy, host, port, true);
 
             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
+                // rmi.log.134=CGI HTTP connection to [{0}:{1}] from port {2} succeeded.
                 proxyTransportLog.log(RMILog.VERBOSE,
-                        "CGI HTTP connection to [" + host + ':' + port
-                        + "] from port " + s.getLocalPort()+ " succeeded.");
+                        Messages.getString("rmi.log.134", //$NON-NLS-1$
+                                new Object[]{host, port, s.getLocalPort()}));
             }
             return s;
         } catch (IOException e) {
             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
+                // rmi.log.135=CGI HTTP connection to [{0}:{1}] failed: {2}
                 proxyTransportLog.log(RMILog.VERBOSE,
-                        "CGI HTTP connection to ["
-                        + host + ':' + port + "] failed: " + e);
+                        Messages.getString("rmi.log.135", //$NON-NLS-1$
+                        new Object[]{ host, port, e}));
             }
             throw e;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpServerConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpServerConnection.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpServerConnection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpServerConnection.java Fri Oct  6 03:15:51 2006
@@ -31,6 +31,7 @@
 import java.rmi.server.UID;
 
 import org.apache.harmony.rmi.common.RMILog;
+import org.apache.harmony.rmi.internal.nls.Messages;
 import org.apache.harmony.rmi.server.ServerConnection;
 import org.apache.harmony.rmi.server.ServerConnectionManager;
 
@@ -73,32 +74,36 @@
             int header = din.readInt();
 
             if (header != RMI_HEADER) {
-                throw new UnmarshalException("Unknown header: " + header);
+                // rmi.82=Unknown header: {0}
+                throw new UnmarshalException(Messages.getString("rmi.82", header)); //$NON-NLS-1$
             }
 
             // read RMI protocol version
             short ver = din.readShort();
 
             if (ver != PROTOCOL_VER) {
-                throw new UnmarshalException("Unknown RMI protocol version: "
-                        + ver);
+                // rmi.83=Unknown RMI protocol version: {0}
+                throw new UnmarshalException(Messages.getString("rmi.83", ver));//$NON-NLS-1$
             }
         } catch (IOException ioe) {
-            throw new UnmarshalException("Unable to read RMI protocol header",
+            // rmi.84=Unable to read RMI protocol header
+            throw new UnmarshalException(Messages.getString("rmi.84"), //$NON-NLS-1$
                     ioe);
         }
 
         if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-            proxyTransportLog.log(RMILog.VERBOSE, "Using protocol version "
-                    + PROTOCOL_VER);
+            // rmi.85=Using protocol version {0}
+            proxyTransportLog.log(RMILog.VERBOSE, Messages.getString("rmi.85", //$NON-NLS-1$
+                    PROTOCOL_VER));
         }
 
         // read protocol type
         if (din.readByte() == SINGLEOP_PROTOCOL) {
 
             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
+                // rmi.86=Using singleop RMI protocol
                 proxyTransportLog.log(RMILog.VERBOSE,
-                        "Using singleop RMI protocol");
+                        Messages.getString("rmi.86")); //$NON-NLS-1$
             }
         } else {
             return -1;
@@ -125,8 +130,9 @@
 
         if (data == -1) {
             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
+                // rmi.log.123=Connection [{0}] is closed
                 proxyTransportLog.log(RMILog.VERBOSE,
-                        "Connection [" + toString() + "] is closed");
+                        Messages.getString("rmi.log.123", toString())); //$NON-NLS-1$
             }
             return -1;
         }
@@ -134,8 +140,8 @@
 
         if (data == PING_MSG) {
             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-                proxyTransportLog.log(RMILog.VERBOSE,
-                        "Got ping request");
+                // rmi.log.124=Got ping request
+                proxyTransportLog.log(RMILog.VERBOSE,Messages.getString("rmi.log.124")); //$NON-NLS-1$
             }
             releaseInputStream();
 
@@ -145,8 +151,8 @@
             return -1;
         } else if (data == DGCACK_MSG) {
             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-                proxyTransportLog.log(RMILog.VERBOSE,
-                        "Got DGC ack request");
+                // rmi.log.125=Got DGC ack request
+                proxyTransportLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.125")); //$NON-NLS-1$
             }
             dgcUnregisterUID(UID.read(new DataInputStream(in)));
             releaseInputStream();
@@ -154,16 +160,17 @@
             return -1;
         } else if (data == CALL_MSG) {
             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-                proxyTransportLog.log(RMILog.VERBOSE,
-                        "Got call request");
+                // rmi.log.126=Got call request
+                proxyTransportLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.126")); //$NON-NLS-1$
             }
             return data;
         } else {
             if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-                proxyTransportLog.log(RMILog.VERBOSE,
-                        "Unknown request got: " + data);
+                // rmi.log.127=Unknown request got: {0}
+                proxyTransportLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.127", data)); //$NON-NLS-1$
             }
-            throw new RemoteException("Unknown message got: " + data);
+            // rmi.87=Unknown message got: {0}
+            throw new RemoteException(Messages.getString("rmi.87", data)); //$NON-NLS-1$
         }
     }
 
@@ -185,6 +192,6 @@
      * @return string representation of this connection
      */
     public String toString() {
-        return "HttpServerConnection: remote endpoint:" + ep;
+        return "HttpServerConnection: remote endpoint:" + ep; //$NON-NLS-1$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpServerSocket.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpServerSocket.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpServerSocket.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/HttpServerSocket.java Fri Oct  6 03:15:51 2006
@@ -28,6 +28,7 @@
 import java.net.Socket;
 
 import org.apache.harmony.rmi.common.RMILog;
+import org.apache.harmony.rmi.internal.nls.Messages;
 import org.apache.harmony.rmi.transport.SocketWrapper;
 
 
@@ -77,9 +78,10 @@
         Socket s = super.accept();
 
         if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-            proxyTransportLog.log(RMILog.VERBOSE, "Inbound connection from ["
-                    + s.getInetAddress().getHostName() + ':' + s.getPort()
-                    + "] to port " + s.getLocalPort() + " detected.");
+            // rmi.log.11F=Inbound connection from [{0}:{1}] to port {2} detected.
+            proxyTransportLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.11F", //$NON-NLS-1$
+                    new Object[]{s.getInetAddress().getHostName(), s.getPort(),
+                        s.getLocalPort()}));
         }
 
         // Detect if incoming request is using HTTP or direct socket.
@@ -113,15 +115,17 @@
 
         if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
             proxyTransportLog.log(RMILog.VERBOSE,
-                    "Inbound connection signature: ["
-                    + new String(buffer) + "].");
+                    Messages.getString("rmi.log.120", new String(buffer)));//$NON-NLS-1$
         }
 
         if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-            proxyTransportLog.log(RMILog.VERBOSE,
-                    (isHttp ? "HTTP" : "Direct socket") + " connection from ["
-                    + s.getInetAddress().getHostName() + ':' + s.getPort()
-                    + "] to port " + s.getLocalPort() + " detected.");
+            // rmi.log.121=Direct socket
+            // rmi.log.122= connection from [{0}:{1}] to port {2} detected.
+            proxyTransportLog.log(RMILog.VERBOSE, (isHttp ? "HTTP" : Messages //$NON-NLS-1$
+                    .getString("rmi.log.121")) //$NON-NLS-1$
+                    + Messages.getString("rmi.log.122", //$NON-NLS-1$ 
+                            new Object[] { s.getInetAddress().getHostName(),
+                                    s.getPort(), s.getLocalPort() }));
         }
 
         // Direct socket must be wrapped to avoid losing already read data.
@@ -133,6 +137,6 @@
      * {@inheritDoc}
      */
     public String toString() {
-        return ("HttpServerSocket[" + super.toString() + "]");
+        return ("HttpServerSocket[" + super.toString() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/Proxy.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/Proxy.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/Proxy.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/Proxy.java Fri Oct  6 03:15:51 2006
@@ -32,6 +32,7 @@
 import org.apache.harmony.rmi.common.GetStringPropAction;
 import org.apache.harmony.rmi.common.RMIConstants;
 import org.apache.harmony.rmi.common.RMILog;
+import org.apache.harmony.rmi.internal.nls.Messages;
 
 
 /**
@@ -87,12 +88,13 @@
             proxyPort = (-1);
             enableDirect = isDirectEnabled();
         }
-
+        // rmi.log.11D=Proxy configuration:
+        // rmi.log.11E=proxy disabled, direct HTTP connections
         if (proxyTransportLog.isLoggable(RMILog.VERBOSE)) {
-            proxyTransportLog.log(RMILog.VERBOSE, "Proxy configuration: "
+            proxyTransportLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.11D") //$NON-NLS-1$
                     + (proxySet ? (proxyHost + ':' + proxyPort)
-                            : ("proxy disabled, direct HTTP connections "
-                                + (enableDirect ? "enabled" : "disabled")
+                            : (Messages.getString("rmi.log.11E") //$NON-NLS-1$
+                                + (enableDirect ? "enabled" : "disabled") //$NON-NLS-1$ //$NON-NLS-2$
                                 + '.')));
         }
     }
@@ -152,7 +154,8 @@
         } else if (enableDirect) {
             return new Socket(host, port);
         } else {
-            throw new NoRouteToHostException("HTTP proxy is not set");
+            // rmi.81=HTTP proxy is not set
+            throw new NoRouteToHostException(Messages.getString("rmi.81")); //$NON-NLS-1$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/ProxyConstants.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/ProxyConstants.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/ProxyConstants.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/proxy/ProxyConstants.java Fri Oct  6 03:15:51 2006
@@ -37,12 +37,12 @@
     /**
      * HTTP end-of-line string.
      */
-    String EOLN = "\r\n";
+    String EOLN = "\r\n"; //$NON-NLS-1$
 
     /**
      * HTTP POST request signature.
      */
-    String HTTP_REQUEST_SIGNATURE = "POST ";
+    String HTTP_REQUEST_SIGNATURE = "POST "; //$NON-NLS-1$
 
     /**
      * Length of {@link #HTTP_REQUEST_SIGNATURE} string.
@@ -52,17 +52,17 @@
     /**
      * HTTP response header signature.
      */
-    String HTTP_RESPONSE_HEADER_SIGNATURE = "HTTP/1.0 200 ";
+    String HTTP_RESPONSE_HEADER_SIGNATURE = "HTTP/1.0 200 "; //$NON-NLS-1$
 
     /**
      * HTTP response header.
      */
-    String HTTP_RESPONSE_HEADER = HTTP_RESPONSE_HEADER_SIGNATURE + "OK";
+    String HTTP_RESPONSE_HEADER = HTTP_RESPONSE_HEADER_SIGNATURE + "OK"; //$NON-NLS-1$
 
     /**
      * Content-Length header string signature.
      */
-    String CONTENT_LENGTH_SIGNATURE = "Content-Length:";
+    String CONTENT_LENGTH_SIGNATURE = "Content-Length:"; //$NON-NLS-1$
 
     /**
      * Length of {@link #CONTENT_LENGTH_SIGNATURE} string.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/tcp/TcpConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/tcp/TcpConnection.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/tcp/TcpConnection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/tcp/TcpConnection.java Fri Oct  6 03:15:51 2006
@@ -35,6 +35,7 @@
 import org.apache.harmony.rmi.common.GetLongPropAction;
 import org.apache.harmony.rmi.common.RMILog;
 import org.apache.harmony.rmi.common.RMIProperties;
+import org.apache.harmony.rmi.internal.nls.Messages;
 import org.apache.harmony.rmi.transport.Endpoint;
 
 
@@ -96,8 +97,8 @@
             out.flush();
 
             if (tcpTransportLog.isLoggable(RMILog.VERBOSE)) {
-                tcpTransportLog.log(RMILog.VERBOSE,
-                        "Using stream RMI protocol");
+                // rmi.90=Using stream RMI protocol
+                tcpTransportLog.log(RMILog.VERBOSE,Messages.getString("rmi.90")); //$NON-NLS-1$
             }
 
             // set handshakeTimeout
@@ -114,10 +115,11 @@
             int ack = din.readByte();
 
             if (ack != PROTOCOL_ACK) {
+                // rmi.log.137=Protocol version {0} is not supported.
+                // rmi.log.13C=Unknown protocol response: {0}
                 throw new ConnectIOException((ack == PROTOCOL_NOT_SUPPORTED)
-                        ? ("Protocol version " + STREAM_PROTOCOL
-                        + " is not supported.") : ("Unknown protocol response: "
-                        + ack));
+                        ? (Messages.getString("rmi.log.137", STREAM_PROTOCOL)) //$NON-NLS-1$
+                        : (Messages.getString("rmi.log.13C",ack))); //$NON-NLS-1$
             }
 
             // read host and port
@@ -125,8 +127,9 @@
             int port = din.readInt();
 
             if (tcpTransportLog.isLoggable(RMILog.VERBOSE)) {
+                // rmi.log.138=Server is seeing us as {0}:{1}
                 tcpTransportLog.log(RMILog.VERBOSE,
-                        "Server is seeing us as " + host + ":" + port);
+                        Messages.getString("rmi.log.138", host, port)); //$NON-NLS-1$
             }
 
             // restore original value of soTimeout
@@ -144,8 +147,9 @@
             throw re;
         } catch (IOException ioe) {
             close();
+            // rmi.92=Unable to acknowledge protocol with server
             throw new ConnectIOException(
-                    "Unable to acknowledge protocol with server", ioe);
+                    Messages.getString("rmi.92"), ioe); //$NON-NLS-1$
         }
 
         // protocol is agreed
@@ -180,8 +184,9 @@
             ackResp = in.read();
         } catch (IOException ioe) {
             if (tcpTransportLog.isLoggable(RMILog.BRIEF)) {
+                // rmi.log.139=Ping request for {0} failed.
                 tcpTransportLog.log(RMILog.BRIEF,
-                        "Ping request for " + toString() + " failed.");
+                        Messages.getString("rmi.log.139", toString())); //$NON-NLS-1$
             }
             close(false);
             return false;
@@ -189,9 +194,10 @@
 
         if (ackResp != PING_ACK) {
             if (tcpTransportLog.isLoggable(RMILog.BRIEF)) {
+                // rmi.log.13A=Unknown response to ping request for {0}:{1}
                 tcpTransportLog.log(RMILog.BRIEF,
-                        "Unknown response to ping request for " + toString()
-                        + ": " + ackResp);
+                        Messages.getString("rmi.log.13A", toString(), //$NON-NLS-1$
+                        ackResp));
             }
             close(false);
             return false;
@@ -202,8 +208,9 @@
         }
 
         if (tcpTransportLog.isLoggable(RMILog.BRIEF)) {
+            // rmi.log.13B=Reusing {0}...
             tcpTransportLog.log(RMILog.BRIEF,
-                    "Reusing " + toString() + "...");
+                    Messages.getString("rmi.log.13B", toString())); //$NON-NLS-1$
         }
         return true;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/tcp/TcpServerConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/tcp/TcpServerConnection.java?view=diff&rev=453541&r1=453540&r2=453541
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/tcp/TcpServerConnection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/tcp/TcpServerConnection.java Fri Oct  6 03:15:51 2006
@@ -34,6 +34,7 @@
 import org.apache.harmony.rmi.common.GetLongPropAction;
 import org.apache.harmony.rmi.common.RMILog;
 import org.apache.harmony.rmi.common.RMIProperties;
+import org.apache.harmony.rmi.internal.nls.Messages;
 import org.apache.harmony.rmi.server.ServerConnection;
 import org.apache.harmony.rmi.server.ServerConnectionManager;
 
@@ -84,32 +85,36 @@
             int header = din.readInt();
 
             if (header != RMI_HEADER) {
-                throw new UnmarshalException("Unknown header: " + header);
+                // rmi.82=Unknown header: {0}
+                throw new UnmarshalException(Messages.getString("rmi.82", header)); //$NON-NLS-1$
             }
 
             // read RMI protocol version
             short ver = din.readShort();
 
             if (ver != PROTOCOL_VER) {
-                throw new UnmarshalException("Unknown RMI protocol version: "
-                        + ver);
+                // rmi.83=Unknown RMI protocol version: {0}
+                throw new UnmarshalException(Messages.getString("rmi.83", ver)); //$NON-NLS-1$
             }
         } catch (IOException ioe) {
-            throw new UnmarshalException("Unable to read RMI protocol header",
+            // rmi.84=Unable to read RMI protocol header
+            throw new UnmarshalException(Messages.getString("rmi.84"), //$NON-NLS-1$
                     ioe);
         }
 
         if (tcpTransportLog.isLoggable(RMILog.VERBOSE)) {
-            tcpTransportLog.log(RMILog.VERBOSE, "Using protocol version "
-                    + PROTOCOL_VER);
+            // rmi.85=Using protocol version {0}
+            tcpTransportLog.log(RMILog.VERBOSE, Messages.getString("rmi.85", //$NON-NLS-1$
+                    PROTOCOL_VER));
         }
         DataOutputStream dout = new DataOutputStream(out);
 
         // read protocol type
         if (din.readByte() == STREAM_PROTOCOL) {
             if (tcpTransportLog.isLoggable(RMILog.VERBOSE)) {
+                // rmi.90=Using stream RMI protocol
                 tcpTransportLog.log(RMILog.VERBOSE,
-                        "Using stream RMI protocol");
+                        Messages.getString("rmi.90")); //$NON-NLS-1$
             }
         } else {
             dout.writeByte(PROTOCOL_NOT_SUPPORTED);
@@ -128,8 +133,9 @@
         dout.flush();
 
         if (tcpTransportLog.isLoggable(RMILog.VERBOSE)) {
+            // rmi.log.136=Server is seeing client as {0}:{1}
             tcpTransportLog.log(RMILog.VERBOSE,
-                    "Server is seeing client as " + host + ":" + port);
+                    Messages.getString("rmi.log.136", host, port)); //$NON-NLS-1$ //$NON-NLS-2$
         }
 
         // read host and port
@@ -155,8 +161,9 @@
 
             if (data == -1) {
                 if (tcpTransportLog.isLoggable(RMILog.BRIEF)) {
+                    // rmi.log.123=Connection [{0}] is closed
                     tcpTransportLog.log(RMILog.BRIEF,
-                            "Connection [" + toString() + "] is closed");
+                            Messages.getString("rmi.log.123", toString())); //$NON-NLS-1$ //$NON-NLS-2$
                 }
                 return -1;
             }
@@ -164,8 +171,9 @@
 
             if (data == PING_MSG) {
                 if (tcpTransportLog.isLoggable(RMILog.VERBOSE)) {
+                    // rmi.log.124=Got ping request
                     tcpTransportLog.log(RMILog.VERBOSE,
-                            "Got ping request");
+                            Messages.getString("rmi.log.124")); //$NON-NLS-1$
                 }
 
                 // send ping ack
@@ -173,22 +181,26 @@
                 dout.flush();
             } else if (data == DGCACK_MSG) {
                 if (tcpTransportLog.isLoggable(RMILog.VERBOSE)) {
+                    // rmi.log.125=Got DGC ack request
                     tcpTransportLog.log(RMILog.VERBOSE,
-                            "Got DGC ack request");
+                            Messages.getString("rmi.log.125")); //$NON-NLS-1$
                 }
                 dgcUnregisterUID(UID.read(new DataInputStream(in)));
             } else if (data == CALL_MSG) {
                 if (tcpTransportLog.isLoggable(RMILog.VERBOSE)) {
+                    // rmi.log.126=Got call request
                     tcpTransportLog.log(RMILog.VERBOSE,
-                            "Got call request");
+                            Messages.getString("rmi.log.126")); //$NON-NLS-1$
                 }
                 return data;
             } else {
                 if (tcpTransportLog.isLoggable(RMILog.BRIEF)) {
+                    // rmi.log.127=Unknown request got: {0}
                     tcpTransportLog.log(RMILog.BRIEF,
-                            "Unknown request got: " + data);
+                            Messages.getString("rmi.log.127", data)); //$NON-NLS-1$
                 }
-                throw new RemoteException("Unknown message got: " + data);
+                // rmi.91=Unknown message got: {0}
+                throw new RemoteException(Messages.getString("rmi.91", data)); //$NON-NLS-1$
             }
         }
     }
@@ -199,6 +211,6 @@
      * @return string representation of this connection
      */
     public String toString() {
-        return "TcpServerConnection: remote endpoint:" + ep;
+        return "TcpServerConnection: remote endpoint:" + ep; //$NON-NLS-1$
     }
 }



Mime
View raw message