directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r326507 - in /directory/network/trunk/src/java/org/apache/mina: common/ common/support/ transport/socket/nio/ transport/socket/nio/support/ transport/vmpipe/
Date Wed, 19 Oct 2005 09:36:50 GMT
Author: trustin
Date: Wed Oct 19 02:36:44 2005
New Revision: 326507

URL: http://svn.apache.org/viewcvs?rev=326507&view=rev
Log:
Replaced IoAcceptor.unbind(SocketAddress, boolean) with 'disconnectClientsOnUnbind' property.

Modified:
    directory/network/trunk/src/java/org/apache/mina/common/IoAcceptor.java
    directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoAcceptor.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorImpl.java
    directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeAcceptor.java

Modified: directory/network/trunk/src/java/org/apache/mina/common/IoAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/IoAcceptor.java?rev=326507&r1=326506&r2=326507&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/IoAcceptor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/IoAcceptor.java Wed Oct 19 02:36:44
2005
@@ -57,13 +57,16 @@
     void unbind( SocketAddress address );
     
     /**
-     * Unbinds from the specified <code>address</code>.
-     * 
-     * @param disconnectClients <tt>true</tt> if and only if you want to disconnect
-     *                          all clients connected to <tt>address</tt>.
-     *                          <tt>false</tt> otherwise.
+     * Returns <tt>true</tt> if and only if all clients are disconnected
+     * when this acceptor unbinds the related local address.
      */
-    void unbind( SocketAddress address, boolean disconnectClients );
+    boolean isDisconnectClientsOnUnbind();
+    
+    /**
+     * Sets whether all clients are disconnected from this acceptor unbinds the
+     * related local address.  The default value is <tt>true</tt>.
+     */
+    void setDisconnectClientsOnUnbind( boolean disconnectClientsOnUnbind );
     
     /**
      * (Optional) Returns an {@link IoSession} that is bound to the specified

Modified: directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoAcceptor.java?rev=326507&r1=326506&r2=326507&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoAcceptor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoAcceptor.java Wed
Oct 19 02:36:44 2005
@@ -31,15 +31,22 @@
  */
 public abstract class BaseIoAcceptor extends BaseIoSessionManager implements IoAcceptor
 {
+    private boolean disconnectClientsOnUnbind = true;
+    
     protected BaseIoAcceptor()
     {
     }
+    
+    public boolean isDisconnectClientsOnUnbind()
+    {
+        return disconnectClientsOnUnbind;
+    }
 
-    public void unbind( SocketAddress address )
+    public void setDisconnectClientsOnUnbind( boolean disconnectClientsOnUnbind )
     {
-        unbind( address, true );
+        this.disconnectClientsOnUnbind = disconnectClientsOnUnbind;
     }
-    
+
     public IoSession newSession( SocketAddress remoteAddress, SocketAddress localAddress
)
     {
         throw new UnsupportedOperationException();

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java?rev=326507&r1=326506&r2=326507&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java
Wed Oct 19 02:36:44 2005
@@ -49,11 +49,6 @@
         stub.unbind( address );
     }
 
-    public void unbind( SocketAddress address, boolean disconnectClients )
-    {
-        stub.unbind( address, disconnectClients );
-    }
-
     public IoSession newSession( SocketAddress remoteAddress, SocketAddress localAddress
)
     {
         return stub.newSession( remoteAddress, localAddress );
@@ -77,5 +72,15 @@
     public void setExceptionMonitor( ExceptionMonitor monitor )
     {
         stub.setExceptionMonitor( monitor );
+    }
+
+    public boolean isDisconnectClientsOnUnbind()
+    {
+        return stub.isDisconnectClientsOnUnbind();
+    }
+
+    public void setDisconnectClientsOnUnbind( boolean disconnectClientsOnUnbind )
+    {
+        stub.setDisconnectClientsOnUnbind( disconnectClientsOnUnbind );
     }
 }

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java?rev=326507&r1=326506&r2=326507&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
Wed Oct 19 02:36:44 2005
@@ -151,7 +151,7 @@
         }
     }
 
-    public void unbind( SocketAddress address, boolean disconnectClients )
+    public void unbind( SocketAddress address )
     {
         // FIXME: Make this work properly when disconnectClients is true.
         if( address == null )

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorImpl.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorImpl.java?rev=326507&r1=326506&r2=326507&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorImpl.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorImpl.java
Wed Oct 19 02:36:44 2005
@@ -123,11 +123,6 @@
 
     public void unbind( SocketAddress address )
     {
-        unbind( address, true );
-    }
-
-    public void unbind( SocketAddress address, boolean disconnectClients )
-    {
         // FIXME: Make this work properly when disconnectClients is true.
         if( address == null )
             throw new NullPointerException( "address" );

Modified: directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeAcceptor.java?rev=326507&r1=326506&r2=326507&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeAcceptor.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeAcceptor.java
Wed Oct 19 02:36:44 2005
@@ -73,11 +73,6 @@
 
     public void unbind( SocketAddress address )
     {
-        unbind( address, true );
-    }
-    
-    public void unbind( SocketAddress address, boolean disconnectClients )
-    {
         // FIXME: Make this work properly when disconnectClients is true.
         if( address == null )
             throw new NullPointerException( "address" );



Mime
View raw message