directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r751913 - in /directory: apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/ installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/
Date Tue, 10 Mar 2009 00:05:32 GMT
Author: elecharny
Date: Tue Mar 10 00:05:31 2009
New Revision: 751913

URL: http://svn.apache.org/viewvc?rev=751913&view=rev
Log:
o Fix for DIRSERVER-1324
o Added some logger in some classes, plus some debug logs

Modified:
    directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/AbstractTransport.java
    directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/TcpTransport.java
    directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/UdpTransport.java
    directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java

Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/AbstractTransport.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/AbstractTransport.java?rev=751913&r1=751912&r2=751913&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/AbstractTransport.java
(original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/AbstractTransport.java
Tue Mar 10 00:05:31 2009
@@ -49,7 +49,7 @@
      */
     public AbstractTransport()
     {
-        address = LOCAL_HOST;
+        address = null;
         nbThreads = DEFAULT_NB_THREADS;
         port = -1;
         backlog = DEFAULT_BACKLOG_NB;

Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/TcpTransport.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/TcpTransport.java?rev=751913&r1=751912&r2=751913&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/TcpTransport.java
(original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/TcpTransport.java
Tue Mar 10 00:05:31 2009
@@ -23,6 +23,8 @@
 import org.apache.mina.core.service.IoAcceptor;
 import org.apache.mina.transport.socket.SocketAcceptor;
 import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @org.apache.xbean.XBean
@@ -32,6 +34,9 @@
  */
 public class TcpTransport extends AbstractTransport
 {
+    /** A logger for this class */
+    private static final Logger LOG = LoggerFactory.getLogger( TcpTransport.class );
+
     /**
      * Creates an instance of the TcpTransport class 
      */
@@ -47,9 +52,11 @@
      */
     public TcpTransport( int tcpPort )
     {
-        super( LOCAL_HOST, tcpPort, DEFAULT_NB_THREADS, DEFAULT_BACKLOG_NB );
+        super( null, tcpPort, DEFAULT_NB_THREADS, DEFAULT_BACKLOG_NB );
+        
+        this.acceptor = createAcceptor( null, tcpPort, DEFAULT_NB_THREADS, DEFAULT_BACKLOG_NB
);
         
-        this.acceptor = createAcceptor( LOCAL_HOST, tcpPort, DEFAULT_NB_THREADS, DEFAULT_BACKLOG_NB
);
+        LOG.debug( "TCP Transport created : <*:{},>", tcpPort );
     }
     
     
@@ -60,9 +67,11 @@
      */
     public TcpTransport( int tcpPort, int nbThreads )
     {
-        super( LOCAL_HOST, tcpPort, nbThreads, DEFAULT_BACKLOG_NB );
+        super( null, tcpPort, nbThreads, DEFAULT_BACKLOG_NB );
+        
+        this.acceptor = createAcceptor( null, tcpPort, nbThreads, DEFAULT_BACKLOG_NB );
         
-        this.acceptor = createAcceptor( LOCAL_HOST, tcpPort, nbThreads, DEFAULT_BACKLOG_NB
);
+        LOG.debug( "TCP Transport created : <*:{},>", tcpPort );
     }
     
     
@@ -71,10 +80,12 @@
      * @param address The address
      * @param port The port
      */
-    public TcpTransport( String address, int port )
+    public TcpTransport( String address, int tcpPort )
     {
-        super( address, port, DEFAULT_NB_THREADS, DEFAULT_BACKLOG_NB );
-        this.acceptor = createAcceptor( address, port, DEFAULT_NB_THREADS, DEFAULT_BACKLOG_NB
);
+        super( address, tcpPort, DEFAULT_NB_THREADS, DEFAULT_BACKLOG_NB );
+        this.acceptor = createAcceptor( address, tcpPort, DEFAULT_NB_THREADS, DEFAULT_BACKLOG_NB
);
+
+        LOG.debug( "TCP Transport created : <{}:{}>", address, tcpPort );
     }
     
     
@@ -88,7 +99,9 @@
     public TcpTransport( int tcpPort, int nbThreads, int backLog )
     {
         super( LOCAL_HOST, tcpPort, nbThreads, backLog );
-        this.acceptor = createAcceptor( LOCAL_HOST, tcpPort, nbThreads, backLog );
+        this.acceptor = createAcceptor( null, tcpPort, nbThreads, backLog );
+
+        LOG.debug( "TCP Transport created : <*:{},>", tcpPort );
     }
     
     
@@ -104,6 +117,8 @@
     {
         super( address, tcpPort, nbThreads, backLog );
         this.acceptor = createAcceptor( address, tcpPort, nbThreads, backLog );
+
+        LOG.debug( "TCP Transport created : <{}:{},>", address, tcpPort );
     }
     
     
@@ -112,7 +127,7 @@
      */
     public void init()
     {
-        acceptor = createAcceptor( this.getAddress(), this.getPort(), this.getNbThreads(),
this.getBackLog() );
+        acceptor = createAcceptor( getAddress(), getPort(), getNbThreads(), getBackLog()
);
     }
     
     
@@ -123,7 +138,20 @@
     {
         NioSocketAcceptor acceptor = new NioSocketAcceptor( nbThreads );
         acceptor.setBacklog( backLog );
-        InetSocketAddress socketAddress = new InetSocketAddress( address, port ); 
+        
+        InetSocketAddress socketAddress = null;
+        
+        // The address can be null here, if one want to connect using the wildcard address
+        if ( address == null )
+        {
+            // Create a socket listening on the wildcard address
+            socketAddress = new InetSocketAddress( port );
+        }
+        else
+        {
+            socketAddress = new InetSocketAddress( address, port );
+        }
+        
         acceptor.setDefaultLocalAddress( socketAddress );
         
         return acceptor;

Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/UdpTransport.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/UdpTransport.java?rev=751913&r1=751912&r2=751913&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/UdpTransport.java
(original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/UdpTransport.java
Tue Mar 10 00:05:31 2009
@@ -23,6 +23,8 @@
 import org.apache.mina.core.service.IoAcceptor;
 import org.apache.mina.transport.socket.DatagramAcceptor;
 import org.apache.mina.transport.socket.nio.NioDatagramAcceptor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @org.apache.xbean.XBean
@@ -32,6 +34,9 @@
  */
 public class UdpTransport extends AbstractTransport
 {
+    /** A logger for this class */
+    private static final Logger LOG = LoggerFactory.getLogger( UdpTransport.class );
+
     /**
      * Creates an instance of the UdpTransport class 
      */
@@ -49,9 +54,9 @@
     {
         super( udpPort );
         
-        this.acceptor = createAcceptor( LOCAL_HOST, udpPort );
+        this.acceptor = createAcceptor( null, udpPort );
         
-        System.out.println( "UDP Transport created : <localhost:" + udpPort + ", 3>"
);
+        LOG.debug( "UDP Transport created : <*:{},>", udpPort );
     }
     
     
@@ -64,7 +69,9 @@
     {
         super( address, udpPort );
         
-        this.acceptor = createAcceptor( LOCAL_HOST, udpPort );
+        this.acceptor = createAcceptor( address, udpPort );
+
+        LOG.debug( "UDP Transport created : <{}:{},>", address, udpPort );
     }
     
     
@@ -73,7 +80,8 @@
      */
     public void init()
     {
-        acceptor = createAcceptor( this.getAddress(), this.getPort() );
+        acceptor = createAcceptor( getAddress(), getPort() );
+        LOG.debug( "UDP Transport created : <{}:{},>", getAddress(), getPort() );
     }
 
     
@@ -92,7 +100,20 @@
     private IoAcceptor createAcceptor( String address, int port )
     {
         NioDatagramAcceptor acceptor = new NioDatagramAcceptor();
-        InetSocketAddress socketAddress = new InetSocketAddress( address, port ); 
+        
+        InetSocketAddress socketAddress =  null;
+        
+        // The address can be null here, if one want to connect using the wildcard address
+        if ( address == null )
+        {
+            // Create a socket listening on the wildcard address
+            socketAddress = new InetSocketAddress( port );
+        }
+        else
+        {
+            socketAddress = new InetSocketAddress( address, port );
+        }
+        
         acceptor.setDefaultLocalAddress( socketAddress );
         
         return acceptor;

Modified: directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
URL: http://svn.apache.org/viewvc/directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java?rev=751913&r1=751912&r2=751913&view=diff
==============================================================================
--- directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
(original)
+++ directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
Tue Mar 10 00:05:31 2009
@@ -45,7 +45,9 @@
  */
 public class Service implements DaemonApplication
 {
+    /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( Service.class );
+    
     private Thread workerThread;
     private SynchWorker worker = new SynchWorker();
     



Mime
View raw message