commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1130597 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/net/ native/shared/
Date Thu, 02 Jun 2011 15:09:35 GMT
Author: mturk
Date: Thu Jun  2 15:09:34 2011
New Revision: 1130597

URL: http://svn.apache.org/viewvc?rev=1130597&view=rev
Log:
rename private class so that naming is consistent

Added:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractSocketAddress.java
      - copied, changed from r1128709, commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddressImpl.java
Removed:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddressImpl.java
Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractAddress.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Inet4SocketAddress.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Inet6SocketAddress.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/InetSocketAddress.java
    commons/sandbox/runtime/trunk/src/main/native/shared/netaddr.c

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractAddress.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractAddress.java?rev=1130597&r1=1130596&r2=1130597&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractAddress.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractAddress.java
Thu Jun  2 15:09:34 2011
@@ -48,4 +48,14 @@ final class AbstractAddress extends Endp
         this.sa = sa;
     }
 
+    public static void sockaddr(EndpointAddress e, byte[] ba)
+    {
+        e.sa = ba;
+    }
+
+    public static byte[] sockaddr(EndpointAddress e)
+    {
+        return e.sa;
+    }
+
 }

Copied: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractSocketAddress.java
(from r1128709, commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddressImpl.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractSocketAddress.java?p2=commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractSocketAddress.java&p1=commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddressImpl.java&r1=1128709&r2=1130597&rev=1130597&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddressImpl.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractSocketAddress.java
Thu Jun  2 15:09:34 2011
@@ -25,7 +25,7 @@ import org.apache.commons.runtime.Invali
  * It is used by {@link SocketAddress#next()} to create
  * a next address object form internal sockaddr structure.  
  */
-final class SocketAddressImpl extends SocketAddress
+final class AbstractSocketAddress extends SocketAddress
 {
 
     private static native byte[]  sockaddr0(String hostname, String servname, int family,
int port, int flags)
@@ -50,7 +50,7 @@ final class SocketAddressImpl extends So
     /**
      * Default constructor
      */
-    public SocketAddressImpl(byte[] sockaddr)
+    public AbstractSocketAddress(byte[] sockaddr)
     {
         super(sockaddr);
     }
@@ -58,7 +58,7 @@ final class SocketAddressImpl extends So
     /**
      * Create a new socket address with given family.
      */
-    public SocketAddressImpl(AddressFamily family)
+    public AbstractSocketAddress(AddressFamily family)
         throws NetworkException, InvalidArgumentException
     {
         super(family);
@@ -72,9 +72,4 @@ final class SocketAddressImpl extends So
         return sockaddr0(hostname, servname, family.valueOf(), port, 0);
     }
 
-    public static void sockaddr(EndpointAddress e, byte[] ba)
-    {
-        e.sa = ba;
-    }
-
 }

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Inet4SocketAddress.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Inet4SocketAddress.java?rev=1130597&r1=1130596&r2=1130597&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Inet4SocketAddress.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Inet4SocketAddress.java
Thu Jun  2 15:09:34 2011
@@ -43,8 +43,8 @@ public final class Inet4SocketAddress ex
         super();
         if (hostname == null || hostname.length() == 0)
             throw new IllegalArgumentException(Local.sm.get("addr.EHOSTNAME"));
-        byte[] sa = SocketAddressImpl.getnameinfo(AddressFamily.INET, hostname, null, port);
-        SocketAddressImpl.sockaddr(this, sa);        
+        byte[] sa = AbstractSocketAddress.getnameinfo(AddressFamily.INET, hostname, null,
port);
+        AbstractAddress.sockaddr(this, sa);
     }
 
     public Inet4SocketAddress(String hostname)

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Inet6SocketAddress.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Inet6SocketAddress.java?rev=1130597&r1=1130596&r2=1130597&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Inet6SocketAddress.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Inet6SocketAddress.java
Thu Jun  2 15:09:34 2011
@@ -42,8 +42,8 @@ public final class Inet6SocketAddress ex
     {
         if (hostname == null || hostname.length() == 0)
             throw new IllegalArgumentException(Local.sm.get("addr.EHOSTNAME"));
-        byte[] sa = SocketAddressImpl.getnameinfo(AddressFamily.INET6, hostname, null, port);
-        SocketAddressImpl.sockaddr(this, sa);
+        byte[] sa = AbstractSocketAddress.getnameinfo(AddressFamily.INET6, hostname, null,
port);
+        AbstractAddress.sockaddr(this, sa);
     }
 
     public Inet6SocketAddress(String hostname)

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/InetSocketAddress.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/InetSocketAddress.java?rev=1130597&r1=1130596&r2=1130597&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/InetSocketAddress.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/InetSocketAddress.java
Thu Jun  2 15:09:34 2011
@@ -44,8 +44,8 @@ public class InetSocketAddress extends S
         super();
         if (port < 0 || port > 65535)
             throw new InvalidRangeException(Local.sm.get("port.ERANGE"));
-        byte[] sa = SocketAddressImpl.getnameinfo(AddressFamily.UNSPEC, hostname, null, port);
-        SocketAddressImpl.sockaddr(this, sa);
+        byte[] sa = AbstractSocketAddress.getnameinfo(AddressFamily.UNSPEC, hostname, null,
port);
+        AbstractAddress.sockaddr(this, sa);
     }
 
     public InetSocketAddress(String hostname)
@@ -60,14 +60,14 @@ public class InetSocketAddress extends S
         if (port < 0 || port > 65535)
             throw new InvalidRangeException(Local.sm.get("port.ERANGE"));
         int salen = AbstractAddress.SALEN;
-        byte[] sa = SocketAddressImpl.getnameinfo(AddressFamily.UNSPEC, hostname, null, port);
+        byte[] sa = AbstractSocketAddress.getnameinfo(AddressFamily.UNSPEC, hostname, null,
port);
         int naddr = sa.length / salen;
         SocketAddress[] a = new SocketAddress[naddr];
         for (int i = 0; i < naddr; i++) {
             byte[] ba = new byte[salen];
             System.arraycopy(sa, i * salen, ba, 0, salen);
             // Create a new SocketAddress
-            a[i] = new SocketAddressImpl(ba);
+            a[i] = new AbstractSocketAddress(ba);
         }
         return a;
     }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/netaddr.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/netaddr.c?rev=1130597&r1=1130596&r2=1130597&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/netaddr.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/netaddr.c Thu Jun  2 15:09:34 2011
@@ -964,12 +964,9 @@ ACR_NET_EXPORT(jint, SocketAddress, port
     return rv;
 }
 
-ACR_NET_EXPORT(jbyteArray, SocketAddressImpl, sockaddr0)(JNI_STDARGS,
-                                                         jstring hostname,
-                                                         jstring servname,
-                                                         jint jfamily,
-                                                         jint port,
-                                                         jint flags)
+ACR_NET_EXPORT(jbyteArray, AbstractSocketAddress, sockaddr0)(JNI_STDARGS,
+                                jstring hostname, jstring servname,
+                                jint jfamily, jint port, jint flags)
 {
     acr_sockaddr_t *sa = 0;
     int family;



Mime
View raw message