directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r370968 - in /directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina: common/ common/support/ transport/socket/nio/ transport/socket/nio/support/
Date Sat, 21 Jan 2006 02:48:30 GMT
Author: trustin
Date: Fri Jan 20 18:48:20 2006
New Revision: 370968

URL: http://svn.apache.org/viewcvs?rev=370968&view=rev
Log:
Fixed compilation errors in socket provider

Added:
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSession.java
      - copied, changed from r370948, directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java
Removed:
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoSessionManager.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/support/BaseIoSessionManager.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java
Modified:
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoSession.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/MINA.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/support/BaseIoSession.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/support/DefaultExceptionMonitor.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramServiceProvider.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketServiceProvider.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptor.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnector.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketAcceptor.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnector.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketFilterChain.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoSession.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoSession.java?rev=370968&r1=370967&r2=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoSession.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoSession.java
Fri Jan 20 18:48:20 2006
@@ -50,11 +50,6 @@
 public interface IoSession {
     
     /**
-     * Returns the {@link IoSessionManager} which manages this session.
-     */
-    IoSessionManager getManager();
-
-    /**
      * Returns the {@link IoHandler} which handles this session.
      */
     IoHandler getHandler();

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/MINA.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/MINA.java?rev=370968&r1=370967&r2=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/MINA.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/MINA.java
Fri Jan 20 18:48:20 2006
@@ -150,6 +150,10 @@
     public static void bind( IoAddress address, IoHandler handler, IoFilterChainBuilder filterChainBuilder
) throws IOException
     {
     	IoAcceptor acceptor = getProviderSafely( address ).getAcceptor();
+        if( filterChainBuilder == null )
+        {
+            filterChainBuilder = IoFilterChainBuilder.NOOP;
+        }
     	acceptor.bind( address, handler, filterChainBuilder );
     }
 
@@ -258,6 +262,10 @@
                                          IoHandler handler, IoFilterChainBuilder filterChainBuilder
)
     {
     	IoConnector connector = getProviderSafely( address ).getConnector();
+        if( filterChainBuilder == null )
+        {
+            filterChainBuilder = IoFilterChainBuilder.NOOP;
+        }
     	return connector.connect( address, localAddress, handler, filterChainBuilder );
     }
 }

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/support/BaseIoSession.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/support/BaseIoSession.java?rev=370968&r1=370967&r2=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/support/BaseIoSession.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/support/BaseIoSession.java
Fri Jan 20 18:48:20 2006
@@ -26,7 +26,6 @@
 import org.apache.mina.common.CloseFuture;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IoSessionManager;
 import org.apache.mina.common.TrafficMask;
 import org.apache.mina.common.WriteFuture;
 import org.apache.mina.common.IoFilter.WriteRequest;

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/support/DefaultExceptionMonitor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/support/DefaultExceptionMonitor.java?rev=370968&r1=370967&r2=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/support/DefaultExceptionMonitor.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/support/DefaultExceptionMonitor.java
Fri Jan 20 18:48:20 2006
@@ -19,7 +19,6 @@
 package org.apache.mina.common.support;
 
 import org.apache.mina.common.ExceptionMonitor;
-import org.apache.mina.common.IoSessionManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramServiceProvider.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramServiceProvider.java?rev=370968&r1=370967&r2=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramServiceProvider.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramServiceProvider.java
Fri Jan 20 18:48:20 2006
@@ -19,6 +19,8 @@
 package org.apache.mina.transport.socket.nio;
 
 import org.apache.mina.common.IoServiceProvider;
+import org.apache.mina.transport.socket.nio.support.DatagramAcceptor;
+import org.apache.mina.transport.socket.nio.support.DatagramConnector;
 
 public class DatagramServiceProvider implements IoServiceProvider
 {

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketServiceProvider.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketServiceProvider.java?rev=370968&r1=370967&r2=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketServiceProvider.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketServiceProvider.java
Fri Jan 20 18:48:20 2006
@@ -19,6 +19,8 @@
 package org.apache.mina.transport.socket.nio;
 
 import org.apache.mina.common.IoServiceProvider;
+import org.apache.mina.transport.socket.nio.support.SocketAcceptor;
+import org.apache.mina.transport.socket.nio.support.SocketConnector;
 
 public class SocketServiceProvider implements IoServiceProvider
 {

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptor.java?rev=370968&r1=370967&r2=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptor.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptor.java
Fri Jan 20 18:48:20 2006
@@ -50,7 +50,6 @@
 {
     private static volatile int nextId = 0;
 
-    private final IoAcceptor wrapper;
     private final int id = nextId ++ ;
     private Selector selector;
     private boolean broadcast;
@@ -67,9 +66,8 @@
     /**
      * Creates a new instance.
      */
-    public DatagramAcceptor( IoAcceptor wrapper )
+    public DatagramAcceptor()
     {
-        this.wrapper = wrapper;
     }
 
     public void bind( IoAddress address, IoHandler handler, IoFilterChainBuilder filterChainBuilder
)

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnector.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnector.java?rev=370968&r1=370967&r2=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnector.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnector.java
Fri Jan 20 18:48:20 2006
@@ -46,7 +46,6 @@
 {
     private static volatile int nextId = 0;
 
-    private final IoConnector wrapper;
     private final int id = nextId ++ ;
     private Selector selector;
     private boolean broadcast;
@@ -63,9 +62,8 @@
     /**
      * Creates a new instance.
      */
-    public DatagramConnector( IoConnector wrapper )
+    public DatagramConnector()
     {
-        this.wrapper = wrapper;
     }
 
     public ConnectFuture connect( SocketAddress address, IoHandler handler, IoFilterChainBuilder
filterChainBuilder )

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketAcceptor.java?rev=370968&r1=370967&r2=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketAcceptor.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketAcceptor.java
Fri Jan 20 18:48:20 2006
@@ -19,8 +19,6 @@
 package org.apache.mina.transport.socket.nio.support;
 
 import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
 import java.nio.channels.ServerSocketChannel;
@@ -36,12 +34,11 @@
 import java.util.Set;
 
 import org.apache.mina.common.ExceptionMonitor;
+import org.apache.mina.common.IoAddress;
 import org.apache.mina.common.IoFilterChainBuilder;
-import org.apache.mina.common.IoFuture;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.IoServiceProvider.IoAcceptor;
-import org.apache.mina.transport.socket.nio.SocketSessionManager;
 import org.apache.mina.util.Queue;
 
 /**
@@ -50,11 +47,10 @@
  * @author The Apache Directory Project (dev@directory.apache.org)
  * @version $Rev$, $Date$
  */
-public class SocketAcceptor extends BaseIoAcceptor implements SocketSessionManager
+public class SocketAcceptor implements IoAcceptor
 {
     private static volatile int nextId = 0;
 
-    private final IoAcceptor wrapper;
     private final int id = nextId ++ ;
     private final String threadName = "SocketAcceptor-" + id;
     private boolean reuseAddress = false;
@@ -72,9 +68,8 @@
     /**
      * Creates a new instance.
      */
-    public SocketAcceptor( IoAcceptor wrapper )
+    public SocketAcceptor()
     {
-        this.wrapper = wrapper;
     }
 
     /**
@@ -84,33 +79,13 @@
      *
      * @throws IOException if failed to bind
      */
-    public void bind( SocketAddress address, IoHandler handler, IoFilterChainBuilder filterChainBuilder
) throws IOException
+    public void bind( IoAddress address, IoHandler handler, IoFilterChainBuilder filterChainBuilder
) throws IOException
     {
-        if( address == null )
-        {
-            throw new NullPointerException( "address" );
-        }
-
         if( handler == null )
         {
             throw new NullPointerException( "handler" );
         }
 
-        if( !( address instanceof InetSocketAddress ) )
-        {
-            throw new IllegalArgumentException( "Unexpected address type: " + address.getClass()
);
-        }
-
-        if( ( ( InetSocketAddress ) address ).getPort() == 0 )
-        {
-            throw new IllegalArgumentException( "Unsupported port number: 0" );
-        }
-        
-        if( filterChainBuilder == null )
-        {
-            filterChainBuilder = IoFilterChainBuilder.NOOP;
-        }
-        
         RegistrationRequest request = new RegistrationRequest( address, handler, filterChainBuilder
);
 
         synchronized( this )
@@ -156,7 +131,7 @@
         }
     }
 
-    public Collection getManagedSessions( SocketAddress address )
+    public Collection getManagedSessions( IoAddress address )
     {
         if( address == null )
         {
@@ -173,7 +148,7 @@
         return Collections.unmodifiableCollection( Arrays.asList( managedSessions.toArray()
) );
     }
     
-    public void unbind( SocketAddress address )
+    public void unbind( IoAddress address )
     {
         if( address == null )
         {
@@ -228,6 +203,7 @@
         
         
         // Disconnect all clients
+        /* FIXME Enable this when configuration interface is ready
         if( isDisconnectClientsOnUnbind() && managedSessions != null )
         {
             IoSession[] tempSessions = ( IoSession[] ) 
@@ -270,10 +246,16 @@
                 // Ignored
             }
             
-        }        
+        }
+        */       
     }
     
-    private class Worker extends Thread
+    public IoSession newSession( IoAddress remoteAddress, IoAddress localAddress )
+    {
+    	throw new UnsupportedOperationException();
+	}
+
+	private class Worker extends Thread
     {
         public Worker()
         {
@@ -361,13 +343,12 @@
                 }
    
                 boolean success = false;
-                SocketSessionImpl session = null;
+                SocketSession session = null;
                 try
                 {
                     RegistrationRequest req = ( RegistrationRequest ) key.attachment();
-                    session = new SocketSessionImpl( SocketAcceptor.this.wrapper, 
+                    session = new SocketSession(
                             ( Set ) sessions.get( req.address ), ch, req.handler );
-                    SocketAcceptor.this.filterChainBuilder.buildFilterChain( session.getFilterChain()
);
                     req.filterChainBuilder.buildFilterChain( session.getFilterChain() );
                     ( ( SocketFilterChain ) session.getFilterChain() ).sessionCreated( session
);
                     session.getManagedSessions().add( session );
@@ -430,7 +411,7 @@
                 }
                 
                 // and bind.
-                ssc.socket().bind( req.address, getBacklog() );
+                ssc.socket().bind( SocketAddresses.parse( req.address ), getBacklog() );
                 ssc.register( selector, SelectionKey.OP_ACCEPT, req );
 
                 channels.put( req.address, ssc );
@@ -562,13 +543,13 @@
 
     private static class RegistrationRequest
     {
-        private final SocketAddress address;
+        private final IoAddress address;
         private final IoHandler handler;
         private final IoFilterChainBuilder filterChainBuilder;
         private IOException exception;
         private boolean done;
         
-        private RegistrationRequest( SocketAddress address, IoHandler handler, IoFilterChainBuilder
filterChainBuilder )
+        private RegistrationRequest( IoAddress address, IoHandler handler, IoFilterChainBuilder
filterChainBuilder )
         {
             this.address = address;
             this.handler = handler;
@@ -579,13 +560,13 @@
 
     private static class CancellationRequest
     {
-        private final SocketAddress address;
+        private final IoAddress address;
 
         private boolean done;
 
         private RuntimeException exception;
         
-        private CancellationRequest( SocketAddress address )
+        private CancellationRequest( IoAddress address )
         {
             this.address = address;
         }

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnector.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnector.java?rev=370968&r1=370967&r2=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnector.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnector.java
Fri Jan 20 18:48:20 2006
@@ -20,8 +20,6 @@
 
 import java.io.IOException;
 import java.net.ConnectException;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
 import java.nio.channels.SocketChannel;
@@ -32,10 +30,10 @@
 
 import org.apache.mina.common.ConnectFuture;
 import org.apache.mina.common.ExceptionMonitor;
+import org.apache.mina.common.IoAddress;
 import org.apache.mina.common.IoFilterChainBuilder;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoServiceProvider.IoConnector;
-import org.apache.mina.transport.socket.nio.SocketSessionManager;
 import org.apache.mina.util.ExceptionUtil;
 import org.apache.mina.util.Queue;
 
@@ -45,11 +43,10 @@
  * @author The Apache Directory Project (dev@directory.apache.org)
  * @version $Rev$, $Date$
  */
-public class SocketConnector extends BaseIoConnector implements SocketSessionManager
+public class SocketConnector implements IoConnector
 {
     private static volatile int nextId = 0;
 
-    private final IoConnector wrapper;
     private final int id = nextId++;
     private final String threadName = "SocketConnector-" + id;
     private Selector selector;
@@ -60,36 +57,15 @@
     /**
      * Creates a new instance.
      */
-    public SocketConnector( IoConnector wrapper )
+    public SocketConnector()
     {
-        this.wrapper = wrapper;
     }
 
-    public ConnectFuture connect( SocketAddress address, IoHandler handler, IoFilterChainBuilder
filterChainBuilder )
-    {
-        return connect( address, null, handler, filterChainBuilder );
-    }
-
-    public ConnectFuture connect( SocketAddress address, SocketAddress localAddress,
+    public ConnectFuture connect( IoAddress address, IoAddress localAddress,
                                   IoHandler handler, IoFilterChainBuilder filterChainBuilder
)
     {
-        if( address == null )
-            throw new NullPointerException( "address" );
         if( handler == null )
             throw new NullPointerException( "handler" );
-
-        if( ! ( address instanceof InetSocketAddress ) )
-            throw new IllegalArgumentException( "Unexpected address type: "
-                                                + address.getClass() );
-
-        if( localAddress != null && !( localAddress instanceof InetSocketAddress
) )
-            throw new IllegalArgumentException( "Unexpected local address type: "
-                                                + localAddress.getClass() );
-
-        if( filterChainBuilder == null )
-        {
-            filterChainBuilder = IoFilterChainBuilder.NOOP;
-        }
         
         SocketChannel ch = null;
         boolean success = false;
@@ -99,14 +75,14 @@
             ch.socket().setReuseAddress( true );
             if( localAddress != null )
             {
-                ch.socket().bind( localAddress );
+                ch.socket().bind( SocketAddresses.parse( localAddress ) );
             }
     
             ch.configureBlocking( false );
 
-            if( ch.connect( address ) )
+            if( ch.connect( SocketAddresses.parse( address ) ) )
             {
-                SocketSessionImpl session = newSession( ch, handler, filterChainBuilder );
+                SocketSession session = newSession( ch, handler, filterChainBuilder );
                 success = true;
                 ConnectFuture future = new ConnectFuture();
                 future.setSession( session );
@@ -134,7 +110,7 @@
             }
         }
         
-        ConnectionRequest request = new ConnectionRequest( ch, getConnectTimeout(), handler,
filterChainBuilder );
+        ConnectionRequest request = new ConnectionRequest( ch, /* FIXME getConnectTimeout()*/
60, handler, filterChainBuilder );
         synchronized( this )
         {
             try
@@ -220,7 +196,7 @@
             try
             {
                 ch.finishConnect();
-                SocketSessionImpl session = newSession( ch, entry.handler, entry.filterChainBuilder
);
+                SocketSession session = newSession( ch, entry.handler, entry.filterChainBuilder
);
                 entry.setSession( session );
                 success = true;
             }
@@ -270,12 +246,11 @@
         }
     }
 
-    private SocketSessionImpl newSession( SocketChannel ch, IoHandler handler, IoFilterChainBuilder
filterChainBuilder ) throws IOException
+    private SocketSession newSession( SocketChannel ch, IoHandler handler, IoFilterChainBuilder
filterChainBuilder ) throws IOException
     {
-        SocketSessionImpl session = new SocketSessionImpl( wrapper, managedSessions, ch,
handler );
+        SocketSession session = new SocketSession( managedSessions, ch, handler );
         try
         {
-            this.filterChainBuilder.buildFilterChain( session.getFilterChain() );
             filterChainBuilder.buildFilterChain( session.getFilterChain() );
             ( ( SocketFilterChain ) session.getFilterChain() ).sessionCreated( session );
         }

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketFilterChain.java?rev=370968&r1=370967&r2=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketFilterChain.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketFilterChain.java
Fri Jan 20 18:48:20 2006
@@ -24,7 +24,7 @@
 
     protected void doWrite( IoSession session, WriteRequest writeRequest )
     {
-        SocketSessionImpl s = ( SocketSessionImpl ) session;
+        SocketSession s = ( SocketSession ) session;
         Queue writeRequestQueue = s.getWriteRequestQueue();
         
         ( ( ByteBuffer ) writeRequest.getMessage() ).mark();
@@ -41,7 +41,7 @@
 
     protected void doClose( IoSession session, CloseFuture closeFuture ) throws IOException
     {
-        SocketSessionImpl s = ( SocketSessionImpl ) session;
+        SocketSession s = ( SocketSession ) session;
         s.getIoProcessor().remove( s );
     }
 }

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java?rev=370968&r1=370967&r2=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
Fri Jan 20 18:48:20 2006
@@ -84,7 +84,7 @@
         this.threadName = threadName;
     }
 
-    void addNew( SocketSessionImpl session ) throws IOException
+    void addNew( SocketSession session ) throws IOException
     {
         synchronized( this )
         {
@@ -98,7 +98,7 @@
         selector.wakeup();
     }
 
-    void remove( SocketSessionImpl session ) throws IOException
+    void remove( SocketSession session ) throws IOException
     {
         scheduleRemove( session );
         startupWorker();
@@ -115,7 +115,7 @@
         }
     }
 
-    void flush( SocketSessionImpl session )
+    void flush( SocketSession session )
     {
         scheduleFlush( session );
         Selector selector = this.selector;
@@ -125,7 +125,7 @@
         }
     }
 
-    void updateTrafficMask( SocketSessionImpl session )
+    void updateTrafficMask( SocketSession session )
     {
         scheduleTrafficControl( session );
         Selector selector = this.selector;
@@ -135,7 +135,7 @@
         }
     }
 
-    private void scheduleRemove( SocketSessionImpl session )
+    private void scheduleRemove( SocketSession session )
     {
         synchronized( removingSessions )
         {
@@ -143,7 +143,7 @@
         }
     }
 
-    private void scheduleFlush( SocketSessionImpl session )
+    private void scheduleFlush( SocketSession session )
     {
         synchronized( flushingSessions )
         {
@@ -151,7 +151,7 @@
         }
     }
 
-    private void scheduleTrafficControl( SocketSessionImpl session )
+    private void scheduleTrafficControl( SocketSession session )
     {
         synchronized( trafficControllingSessions )
         {
@@ -164,13 +164,13 @@
         if( newSessions.isEmpty() )
             return;
 
-        SocketSessionImpl session;
+        SocketSession session;
 
         for( ;; )
         {
             synchronized( newSessions )
             {
-                session = ( SocketSessionImpl ) newSessions.pop();
+                session = ( SocketSession ) newSessions.pop();
             }
 
             if( session == null )
@@ -208,11 +208,11 @@
 
         for( ;; )
         {
-            SocketSessionImpl session;
+            SocketSession session;
 
             synchronized( removingSessions )
             {
-                session = ( SocketSessionImpl ) removingSessions.pop();
+                session = ( SocketSession ) removingSessions.pop();
             }
 
             if( session == null )
@@ -260,7 +260,7 @@
         while( it.hasNext() )
         {
             SelectionKey key = ( SelectionKey ) it.next();
-            SocketSessionImpl session = ( SocketSessionImpl ) key.attachment();
+            SocketSession session = ( SocketSession ) key.attachment();
 
             if( key.isReadable() && session.getTrafficMask().isReadable() )
             {
@@ -276,7 +276,7 @@
         selectedKeys.clear();
     }
 
-    private void read( SocketSessionImpl session )
+    private void read( SocketSession session )
     {
         ByteBuffer buf = ByteBuffer.allocate( session.getSessionReceiveBufferSize() ); 
         SocketChannel ch = session.getChannel();
@@ -339,14 +339,14 @@
                 for( Iterator it = keys.iterator(); it.hasNext(); )
                 {
                     SelectionKey key = ( SelectionKey ) it.next();
-                    SocketSessionImpl session = ( SocketSessionImpl ) key.attachment();
+                    SocketSession session = ( SocketSession ) key.attachment();
                     notifyIdleness( session, currentTime );
                 }
             }
         }
     }
 
-    private void notifyIdleness( SocketSessionImpl session, long currentTime )
+    private void notifyIdleness( SocketSession session, long currentTime )
     {
         notifyIdleness0(
                 session, currentTime,
@@ -368,7 +368,7 @@
                 .getWriteTimeoutInMillis(), session.getLastWriteTime() );
     }
 
-    private void notifyIdleness0( SocketSessionImpl session, long currentTime,
+    private void notifyIdleness0( SocketSession session, long currentTime,
                                     long idleTime, IdleStatus status,
                                     long lastIoTime )
     {
@@ -380,7 +380,7 @@
         }
     }
 
-    private void notifyWriteTimeout( SocketSessionImpl session,
+    private void notifyWriteTimeout( SocketSession session,
                                            long currentTime,
                                            long writeTimeout, long lastIoTime )
     {
@@ -401,11 +401,11 @@
 
         for( ;; )
         {
-            SocketSessionImpl session;
+            SocketSession session;
 
             synchronized( flushingSessions )
             {
-                session = ( SocketSessionImpl ) flushingSessions.pop();
+                session = ( SocketSession ) flushingSessions.pop();
             }
 
             if( session == null )
@@ -443,7 +443,7 @@
         }
     }
     
-    private void releaseWriteBuffers( SocketSessionImpl session )
+    private void releaseWriteBuffers( SocketSession session )
     {
         Queue writeRequestQueue = session.getWriteRequestQueue();
         WriteRequest req;
@@ -465,7 +465,7 @@
         }
     }
 
-    private void doFlush( SocketSessionImpl session ) throws IOException
+    private void doFlush( SocketSession session ) throws IOException
     {
         // Clear OP_WRITE
         SelectionKey key = session.getSelectionKey();
@@ -521,11 +521,11 @@
 
         for( ;; )
         {
-            SocketSessionImpl session;
+            SocketSession session;
 
             synchronized( trafficControllingSessions )
             {
-                session = ( SocketSessionImpl ) trafficControllingSessions.pop();
+                session = ( SocketSession ) trafficControllingSessions.pop();
             }
 
             if( session == null )

Copied: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSession.java
(from r370948, directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java)
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSession.java?p2=directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSession.java&p1=directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java&r1=370948&r2=370968&rev=370968&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketSession.java
Fri Jan 20 18:48:20 2006
@@ -28,11 +28,9 @@
 import org.apache.mina.common.IoFilterChain;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IoSessionManager;
 import org.apache.mina.common.TransportType;
 import org.apache.mina.common.IoFilter.WriteRequest;
 import org.apache.mina.common.support.BaseIoSession;
-import org.apache.mina.transport.socket.nio.SocketSession;
 import org.apache.mina.util.Queue;
 
 /**
@@ -41,11 +39,10 @@
  * @author The Apache Directory Project (dev@directory.apache.org)
  * @version $Rev$, $Date$
  */
-class SocketSessionImpl extends BaseIoSession implements SocketSession
+class SocketSession extends BaseIoSession
 {
     private static final int DEFAULT_READ_BUFFER_SIZE = 1024;
 
-    private final IoSessionManager manager;
     private final SocketIoProcessor ioProcessor;
     private final SocketFilterChain filterChain;
     private final SocketChannel ch;
@@ -60,11 +57,10 @@
     /**
      * Creates a new instance.
      */
-    public SocketSessionImpl(
-            IoSessionManager manager, Set managedSessions,
+    public SocketSession(
+            Set managedSessions,
             SocketChannel ch, IoHandler defaultHandler )
     {
-        this.manager = manager;
         this.managedSessions = managedSessions;
         this.ioProcessor = SocketIoProcessor.getInstance();
         this.filterChain = new SocketFilterChain( this );
@@ -73,11 +69,6 @@
         this.handler = defaultHandler;
         this.remoteAddress = ch.socket().getRemoteSocketAddress();
         this.localAddress = ch.socket().getLocalSocketAddress();
-    }
-    
-    public IoSessionManager getManager()
-    {
-        return manager;
     }
     
     SocketIoProcessor getIoProcessor()



Mime
View raw message