directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r326557 - in /directory/network/trunk/src: examples/org/apache/mina/examples/echoserver/ examples/org/apache/mina/examples/netcat/ examples/org/apache/mina/examples/sumup/ java/org/apache/mina/common/ java/org/apache/mina/common/support/ ja...
Date Wed, 19 Oct 2005 13:40:57 GMT
Author: trustin
Date: Wed Oct 19 06:40:07 2005
New Revision: 326557

URL: http://svn.apache.org/viewcvs?rev=326557&view=rev
Log:
Merged IoSessionConfig and its decendants to appropriate IoSession interfaces.

Added:
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramSession.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketSession.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
      - copied, changed from r326548, directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorImpl.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java
      - copied, changed from r326548, directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorImpl.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionImpl.java
      - copied, changed from r326541, directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSession.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java
      - copied, changed from r326541, directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSession.java
    directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeSession.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java
      - copied, changed from r326541, directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSession.java
Removed:
    directory/network/trunk/src/java/org/apache/mina/common/IoSessionConfig.java
    directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSessionConfig.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramSessionConfig.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketSessionConfig.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorImpl.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorImpl.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSession.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionConfigImpl.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSession.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSessionConfigImpl.java
    directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeSessionConfig.java
    directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSession.java
Modified:
    directory/network/trunk/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java
    directory/network/trunk/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java
    directory/network/trunk/src/examples/org/apache/mina/examples/sumup/ServerSessionHandler.java
    directory/network/trunk/src/java/org/apache/mina/common/IdleStatus.java
    directory/network/trunk/src/java/org/apache/mina/common/IoSession.java
    directory/network/trunk/src/java/org/apache/mina/common/WriteTimeoutException.java
    directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java
    directory/network/trunk/src/java/org/apache/mina/handler/StreamIoHandler.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/DatagramConnector.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/SocketConnector.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionManager.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionManagerFilterChain.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSessionManagerFilterChain.java
    directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeConnector.java
    directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeFilter.java
    directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java
    directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionManagerFilterChain.java
    directory/network/trunk/src/java/org/apache/mina/util/SessionUtil.java
    directory/network/trunk/src/test/org/apache/mina/common/FutureTest.java
    directory/network/trunk/src/test/org/apache/mina/common/IoFilterChainTest.java
    directory/network/trunk/src/test/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java
    directory/network/trunk/src/test/org/apache/mina/filter/codec/CumulativeProtocolDecoderTest.java

Modified: directory/network/trunk/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java (original)
+++ directory/network/trunk/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java Wed Oct 19 06:40:07 2005
@@ -25,8 +25,7 @@
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoHandlerAdapter;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IoSessionConfig;
-import org.apache.mina.transport.socket.nio.SocketSessionConfig;
+import org.apache.mina.transport.socket.nio.SocketSession;
 
 /**
  * {@link IoHandler} implementation for echo server. 
@@ -40,13 +39,12 @@
 
     public void sessionCreated( IoSession session )
     {
-        IoSessionConfig cfg = session.getConfig();
-        if( cfg instanceof SocketSessionConfig )
+        if( session instanceof SocketSession )
         {
-            ( ( SocketSessionConfig ) cfg ).setSessionReceiveBufferSize( 2048 );
+            ( ( SocketSession ) session ).setSessionReceiveBufferSize( 2048 );
         }
         
-        cfg.setIdleTime( IdleStatus.BOTH_IDLE, 10 );
+        session.setIdleTime( IdleStatus.BOTH_IDLE, 10 );
     }
     
     public void sessionIdle( IoSession session, IdleStatus status )

Modified: directory/network/trunk/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java (original)
+++ directory/network/trunk/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java Wed Oct 19 06:40:07 2005
@@ -38,7 +38,7 @@
         // Set reader idle time to 10 seconds.
         // sessionIdle(...) method will be invoked when no data is read
         // for 10 seconds.
-        session.getConfig().setIdleTime( IdleStatus.READER_IDLE, 10 );
+        session.setIdleTime( IdleStatus.READER_IDLE, 10 );
     }
 
     public void sessionClosed( IoSession session )

Modified: directory/network/trunk/src/examples/org/apache/mina/examples/sumup/ServerSessionHandler.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/examples/org/apache/mina/examples/sumup/ServerSessionHandler.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/examples/org/apache/mina/examples/sumup/ServerSessionHandler.java (original)
+++ directory/network/trunk/src/examples/org/apache/mina/examples/sumup/ServerSessionHandler.java Wed Oct 19 06:40:07 2005
@@ -55,7 +55,7 @@
     public void sessionOpened( IoSession session )
     {
         // set idle time to 60 seconds
-        session.getConfig().setIdleTime( IdleStatus.BOTH_IDLE, 60 );
+        session.setIdleTime( IdleStatus.BOTH_IDLE, 60 );
 
         // initial sum is zero
         session.setAttachment( new Integer( 0 ) );

Modified: directory/network/trunk/src/java/org/apache/mina/common/IdleStatus.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/IdleStatus.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/IdleStatus.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/IdleStatus.java Wed Oct 19 06:40:07 2005
@@ -29,7 +29,7 @@
  * </ul>
  * <p>
  * Idle time settings are all disabled by default.  You can enable them
- * using {@link IoSessionConfig#setIdleTime(IdleStatus,int)}.
+ * using {@link IoSession#setIdleTime(IdleStatus,int)}.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: directory/network/trunk/src/java/org/apache/mina/common/IoSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/IoSession.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/IoSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/IoSession.java Wed Oct 19 06:40:07 2005
@@ -29,6 +29,11 @@
  * application-specific data which is associated with a session.
  * It often contains objects that represents the state of a higher-level protocol
  * and becomes a way to exchange data between filters and handlers.
+ * 
+ * <h2>Adjusting Transport Type Specific Properties</h2>
+ * <p>
+ * You can simply downcast the session to an appropriate subclass.
+ * </p>
  *   
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
@@ -93,6 +98,16 @@
     Object setAttribute( String key, Object value );
     
     /**
+     * Sets a user defined attribute without a value.  This is useful when
+     * you just want to put a 'mark' attribute.  Its value is set to
+     * {@link Boolean#TRUE}.
+     * 
+     * @param key the key of the attribute
+     * @return The old value of the attribute.  <tt>null</tt> if it is new.
+     */
+    Object setAttribute( String key );
+    
+    /**
      * Removes a user-defined attribute with the specified key.
      * 
      * @return The old value of the attribute.  <tt>null</tt> if not found.
@@ -100,6 +115,12 @@
     Object removeAttribute( String key );
     
     /**
+     * Returns <tt>true</tt> if this session contains the attribute with
+     * the specified <tt>key</tt>.
+     */
+    boolean containsAttribute( String key );
+    
+    /**
      * Returns the set of keys of all user-defined attributes.
      */
     Set getAttributeKeys();
@@ -115,11 +136,6 @@
     boolean isConnected();
 
     /**
-     * Returns the configuration of this session.
-     */
-    IoSessionConfig getConfig();
-
-    /**
      * Returns the socket address of remote peer. 
      */
     SocketAddress getRemoteAddress();
@@ -130,6 +146,36 @@
      */
     SocketAddress getLocalAddress();
 
+    /**
+     * Returns idle time for the specified type of idleness in seconds.
+     */
+    int getIdleTime( IdleStatus status );
+
+    /**
+     * Returnd idle time for the specified type of idleness in milliseconds.
+     */
+    long getIdleTimeInMillis( IdleStatus status );
+
+    /**
+     * Sets idle time for the specified type of idleness in seconds.
+     */
+    void setIdleTime( IdleStatus status, int idleTime );
+
+    /**
+     * Returns write timeout in seconds.
+     */
+    int getWriteTimeout();
+
+    /**
+     * Returns write timeout in milliseconds.
+     */
+    long getWriteTimeoutInMillis();
+
+    /**
+     * Sets write timeout in seconds.
+     */
+    void setWriteTimeout( int writeTimeout );
+    
     /**
      * Returns the total number of bytes which were read from this session.
      */

Modified: directory/network/trunk/src/java/org/apache/mina/common/WriteTimeoutException.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/WriteTimeoutException.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/WriteTimeoutException.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/WriteTimeoutException.java Wed Oct 19 06:40:07 2005
@@ -22,7 +22,7 @@
 
 /**
  * An {@link IOException} which is thrown when write buffer is not flushed for
- * {@link IoSessionConfig#getWriteTimeout()} seconds.
+ * {@link IoSession#getWriteTimeout()} seconds.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$, 

Modified: directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java Wed Oct 19 06:40:07 2005
@@ -36,6 +36,13 @@
     private final Map attributes = new HashMap();
     private final long creationTime;
 
+    // Configuration variables
+    private int idleTimeForRead;
+    private int idleTimeForWrite;
+    private int idleTimeForBoth;
+    private int writeTimeout;
+    
+    // Status variables
     private long readBytes;
     private long writtenBytes;
     private long writtenWriteRequests;
@@ -85,6 +92,11 @@
         }
     }
     
+    public Object setAttribute( String key )
+    {
+        return setAttribute( key, Boolean.TRUE );
+    }
+    
     public Object removeAttribute( String key )
     {
         synchronized( attributes )
@@ -92,6 +104,11 @@
             return attributes.remove( key );
         }
     }
+    
+    public boolean containsAttribute( String key )
+    {
+        return getAttribute( key ) != null;
+    }
 
     public Set getAttributeKeys() {
         synchronized( attributes )
@@ -100,6 +117,60 @@
         }
     }
     
+    public int getIdleTime( IdleStatus status )
+    {
+        if( status == IdleStatus.BOTH_IDLE )
+            return idleTimeForBoth;
+
+        if( status == IdleStatus.READER_IDLE )
+            return idleTimeForRead;
+
+        if( status == IdleStatus.WRITER_IDLE )
+            return idleTimeForWrite;
+
+        throw new IllegalArgumentException( "Unknown idle status: " + status );
+    }
+
+    public long getIdleTimeInMillis( IdleStatus status )
+    {
+        return getIdleTime( status ) * 1000L;
+    }
+
+    public void setIdleTime( IdleStatus status, int idleTime )
+    {
+        if( idleTime < 0 )
+            throw new IllegalArgumentException( "Illegal idle time: "
+                                                + idleTime );
+
+        if( status == IdleStatus.BOTH_IDLE )
+            idleTimeForBoth = idleTime;
+        else if( status == IdleStatus.READER_IDLE )
+            idleTimeForRead = idleTime;
+        else if( status == IdleStatus.WRITER_IDLE )
+            idleTimeForWrite = idleTime;
+        else
+            throw new IllegalArgumentException( "Unknown idle status: "
+                                                + status );
+    }
+
+    public int getWriteTimeout()
+    {
+        return writeTimeout;
+    }
+
+    public long getWriteTimeoutInMillis()
+    {
+        return writeTimeout * 1000L;
+    }
+
+    public void setWriteTimeout( int writeTimeout )
+    {
+        if( writeTimeout < 0 )
+            throw new IllegalArgumentException( "Illegal write timeout: "
+                                                + writeTimeout );
+        this.writeTimeout = writeTimeout;
+    }
+
     public long getReadBytes()
     {
         return readBytes;

Modified: directory/network/trunk/src/java/org/apache/mina/handler/StreamIoHandler.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/handler/StreamIoHandler.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/handler/StreamIoHandler.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/handler/StreamIoHandler.java Wed Oct 19 06:40:07 2005
@@ -88,8 +88,8 @@
     public void sessionOpened( IoSession session )
     {
         // Set timeouts
-        session.getConfig().setWriteTimeout( writeTimeout );
-        session.getConfig().setIdleTime( IdleStatus.READER_IDLE, readTimeout );
+        session.setWriteTimeout( writeTimeout );
+        session.setIdleTime( IdleStatus.READER_IDLE, readTimeout );
 
         // Create streams
         PipedOutputStream out = new PipedOutputStream();

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=326557&r1=326556&r2=326557&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 06:40:07 2005
@@ -26,7 +26,7 @@
 import org.apache.mina.common.IoFilterChain;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.transport.socket.nio.support.DatagramAcceptorImpl;
+import org.apache.mina.transport.socket.nio.support.DatagramAcceptorDelegate;
 
 /**
  * {@link IoAcceptor} for datagram transport (UDP/IP).
@@ -36,45 +36,45 @@
  */
 public class DatagramAcceptor implements IoAcceptor
 {
-    private final IoAcceptor stub = new DatagramAcceptorImpl();
+    private final IoAcceptor delegate = new DatagramAcceptorDelegate();
     
     public void bind( SocketAddress address, IoHandler handler ) throws IOException
     {
-        stub.bind( address, handler );
+        delegate.bind( address, handler );
     }
 
     public void unbind( SocketAddress address )
     {
-        stub.unbind( address );
+        delegate.unbind( address );
     }
 
     public IoSession newSession( SocketAddress remoteAddress, SocketAddress localAddress )
     {
-        return stub.newSession( remoteAddress, localAddress );
+        return delegate.newSession( remoteAddress, localAddress );
     }
 
     public IoFilterChain getFilterChain()
     {
-        return stub.getFilterChain();
+        return delegate.getFilterChain();
     }
 
     public ExceptionMonitor getExceptionMonitor()
     {
-        return stub.getExceptionMonitor();
+        return delegate.getExceptionMonitor();
     }
 
     public void setExceptionMonitor( ExceptionMonitor monitor )
     {
-        stub.setExceptionMonitor( monitor );
+        delegate.setExceptionMonitor( monitor );
     }
 
     public boolean isDisconnectClientsOnUnbind()
     {
-        return stub.isDisconnectClientsOnUnbind();
+        return delegate.isDisconnectClientsOnUnbind();
     }
 
     public void setDisconnectClientsOnUnbind( boolean disconnectClientsOnUnbind )
     {
-        stub.setDisconnectClientsOnUnbind( disconnectClientsOnUnbind );
+        delegate.setDisconnectClientsOnUnbind( disconnectClientsOnUnbind );
     }
 }

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramConnector.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramConnector.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramConnector.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramConnector.java Wed Oct 19 06:40:07 2005
@@ -26,7 +26,7 @@
 import org.apache.mina.common.IoConnector;
 import org.apache.mina.common.IoFilterChain;
 import org.apache.mina.common.IoHandler;
-import org.apache.mina.transport.socket.nio.support.DatagramConnectorImpl;
+import org.apache.mina.transport.socket.nio.support.DatagramConnectorDelegate;
 
 /**
  * {@link IoConnector} for datagram transport (UDP/IP).
@@ -36,7 +36,7 @@
  */
 public class DatagramConnector implements IoConnector
 {
-    private final IoConnector stub = new DatagramConnectorImpl();
+    private final IoConnector delegate = new DatagramConnectorDelegate();
 
     /**
      * Creates a new instance.
@@ -47,42 +47,42 @@
 
     public ConnectFuture connect( SocketAddress address, IoHandler handler ) throws IOException
     {
-        return stub.connect( address, handler );
+        return delegate.connect( address, handler );
     }
 
     public ConnectFuture connect( SocketAddress address, SocketAddress localAddress,
                               IoHandler handler ) throws IOException
     {
-        return stub.connect( address, localAddress, handler );
+        return delegate.connect( address, localAddress, handler );
     }
 
     public IoFilterChain getFilterChain()
     {
-        return stub.getFilterChain();
+        return delegate.getFilterChain();
     }
 
     public ExceptionMonitor getExceptionMonitor()
     {
-        return stub.getExceptionMonitor();
+        return delegate.getExceptionMonitor();
     }
 
     public void setExceptionMonitor( ExceptionMonitor monitor )
     {
-        stub.setExceptionMonitor( monitor );
+        delegate.setExceptionMonitor( monitor );
     }
 
     public int getConnectTimeout()
     {
-        return stub.getConnectTimeout();
+        return delegate.getConnectTimeout();
     }
 
     public long getConnectTimeoutMillis()
     {
-        return stub.getConnectTimeoutMillis();
+        return delegate.getConnectTimeoutMillis();
     }
 
     public void setConnectTimeout( int connectTimeout )
     {
-        stub.setConnectTimeout( connectTimeout );
+        delegate.setConnectTimeout( connectTimeout );
     }
 }

Added: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramSession.java?rev=326557&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramSession.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramSession.java Wed Oct 19 06:40:07 2005
@@ -0,0 +1,37 @@
+/*
+ *   @(#) $Id$
+ *
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.mina.transport.socket.nio;
+
+import java.net.SocketException;
+
+import org.apache.mina.common.IoSession;
+
+/**
+ * An {@link IoSession} for datagram transport (UDP/IP).
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface DatagramSession extends IoSession
+{
+    boolean getReuseAddress() throws SocketException;
+    void setReuseAddress( boolean on ) throws SocketException;
+    int getTrafficClass() throws SocketException;
+    void setTrafficClass( int tc ) throws SocketException;
+}
\ No newline at end of file

Propchange: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/DatagramSession.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

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=326557&r1=326556&r2=326557&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 06:40:07 2005
@@ -36,7 +36,7 @@
 import org.apache.mina.common.support.BaseIoAcceptor;
 import org.apache.mina.common.support.IoSessionManagerFilterChain;
 import org.apache.mina.transport.socket.nio.support.SocketIoProcessor;
-import org.apache.mina.transport.socket.nio.support.SocketSession;
+import org.apache.mina.transport.socket.nio.support.SocketSessionImpl;
 import org.apache.mina.transport.socket.nio.support.SocketSessionManagerFilterChain;
 import org.apache.mina.util.Queue;
 
@@ -293,7 +293,7 @@
                 try
                 {
                     RegistrationRequest req = ( RegistrationRequest ) key.attachment();
-                    SocketSession session = new SocketSession( filters, ch, req.handler );
+                    SocketSessionImpl session = new SocketSessionImpl( filters, ch, req.handler );
                     req.handler.sessionCreated( session );
                     SocketIoProcessor.getInstance().addSession( session );
                     success = true;

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketConnector.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketConnector.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketConnector.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketConnector.java Wed Oct 19 06:40:07 2005
@@ -35,7 +35,7 @@
 import org.apache.mina.common.support.BaseIoConnector;
 import org.apache.mina.common.support.IoSessionManagerFilterChain;
 import org.apache.mina.transport.socket.nio.support.SocketIoProcessor;
-import org.apache.mina.transport.socket.nio.support.SocketSession;
+import org.apache.mina.transport.socket.nio.support.SocketSessionImpl;
 import org.apache.mina.transport.socket.nio.support.SocketSessionManagerFilterChain;
 import org.apache.mina.util.ExceptionUtil;
 import org.apache.mina.util.Queue;
@@ -102,7 +102,7 @@
 
             if( ch.connect( address ) )
             {
-                SocketSession session = newSession( ch, handler );
+                SocketSessionImpl session = newSession( ch, handler );
                 success = true;
                 ConnectFuture future = new ConnectFuture();
                 future.setSession( session );
@@ -189,7 +189,7 @@
             try
             {
                 ch.finishConnect();
-                SocketSession session = newSession( ch, entry.handler );
+                SocketSessionImpl session = newSession( ch, entry.handler );
                 entry.setSession( session );
                 success = true;
             }
@@ -239,9 +239,9 @@
         }
     }
 
-    private SocketSession newSession( SocketChannel ch, IoHandler handler ) throws IOException
+    private SocketSessionImpl newSession( SocketChannel ch, IoHandler handler ) throws IOException
     {
-        SocketSession session = new SocketSession( filters, ch, handler );
+        SocketSessionImpl session = new SocketSessionImpl( filters, ch, handler );
         try
         {
             handler.sessionCreated( session );

Added: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketSession.java?rev=326557&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketSession.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketSession.java Wed Oct 19 06:40:07 2005
@@ -0,0 +1,51 @@
+/*
+ *   @(#) $Id$
+ *
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.mina.transport.socket.nio;
+
+import java.net.SocketException;
+
+import org.apache.mina.common.IoSession;
+
+/**
+ * An {@link IoSession} for socket transport (TCP/IP).
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface SocketSession extends IoSession
+{
+    boolean getKeepAlive() throws SocketException;
+    void setKeepAlive( boolean on ) throws SocketException;
+    boolean getOOBInline() throws SocketException;
+    void setOOBInline( boolean on ) throws SocketException;
+    boolean getReuseAddress() throws SocketException;
+    void setReuseAddress( boolean on ) throws SocketException;
+    int getSoLinger() throws SocketException;
+    void setSoLinger( boolean on, int linger ) throws SocketException;
+    boolean getTcpNoDelay() throws SocketException;
+    void setTcpNoDelay( boolean on ) throws SocketException;
+    int getTrafficClass() throws SocketException;
+    void setTrafficClass( int tc ) throws SocketException;
+    int getSendBufferSize() throws SocketException;
+    void setSendBufferSize( int size ) throws SocketException;
+    int getReceiveBufferSize() throws SocketException;
+    void setReceiveBufferSize( int size ) throws SocketException;
+    int getSessionReceiveBufferSize();
+    void setSessionReceiveBufferSize( int size );
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketSession.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Copied: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java (from r326548, 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/DatagramAcceptorDelegate.java?p2=directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java&p1=directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorImpl.java&r1=326548&r2=326557&rev=326557&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/DatagramAcceptorDelegate.java Wed Oct 19 06:40:07 2005
@@ -46,7 +46,7 @@
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
-public class DatagramAcceptorImpl extends BaseIoAcceptor implements IoAcceptor, DatagramSessionManager
+public class DatagramAcceptorDelegate extends BaseIoAcceptor implements IoAcceptor, DatagramSessionManager
 {
     private static volatile int nextId = 0;
 
@@ -70,7 +70,7 @@
     /**
      * Creates a new instance.
      */
-    public DatagramAcceptorImpl()
+    public DatagramAcceptorDelegate()
     {
     }
 
@@ -194,7 +194,7 @@
         }
 
         RegistrationRequest req = ( RegistrationRequest ) key.attachment();
-        DatagramSession s = new DatagramSession( filters, ch, req.handler );
+        DatagramSessionImpl s = new DatagramSessionImpl( filters, ch, req.handler );
         s.setRemoteAddress( remoteAddress );
         s.setSelectionKey( key );
         
@@ -220,17 +220,17 @@
         }
     }
 
-    public void flushSession( DatagramSession session )
+    public void flushSession( DatagramSessionImpl session )
     {
         scheduleFlush( session );
         selector.wakeup();
     }
 
-    public void closeSession( DatagramSession session )
+    public void closeSession( DatagramSessionImpl session )
     {
     }
 
-    private void scheduleFlush( DatagramSession session )
+    private void scheduleFlush( DatagramSessionImpl session )
     {
         synchronized( flushingSessions )
         {
@@ -265,7 +265,7 @@
 
                     if( selector.keys().isEmpty() )
                     {
-                        synchronized( DatagramAcceptorImpl.this )
+                        synchronized( DatagramAcceptorDelegate.this )
                         {
                             if( selector.keys().isEmpty() &&
                                 registerQueue.isEmpty() &&
@@ -278,7 +278,7 @@
                                 }
                                 catch( IOException e )
                                 {
-                                    exceptionMonitor.exceptionCaught( DatagramAcceptorImpl.this, e );
+                                    exceptionMonitor.exceptionCaught( DatagramAcceptorDelegate.this, e );
                                 }
                                 finally
                                 {
@@ -291,7 +291,7 @@
                 }
                 catch( IOException e )
                 {
-                    exceptionMonitor.exceptionCaught( DatagramAcceptorImpl.this,
+                    exceptionMonitor.exceptionCaught( DatagramAcceptorDelegate.this,
                             e );
 
                     try
@@ -317,7 +317,7 @@
             DatagramChannel ch = ( DatagramChannel ) key.channel();
 
             RegistrationRequest req = ( RegistrationRequest ) key.attachment();
-            DatagramSession session = new DatagramSession(
+            DatagramSessionImpl session = new DatagramSessionImpl(
                     filters, ch, req.handler );
             session.setSelectionKey( key );
             
@@ -342,7 +342,7 @@
         }
     }
 
-    private void readSession( DatagramSession session )
+    private void readSession( DatagramSessionImpl session )
     {
 
         ByteBuffer readBuf = ByteBuffer.allocate( 2048 );
@@ -380,11 +380,11 @@
 
         for( ;; )
         {
-            DatagramSession session;
+            DatagramSessionImpl session;
 
             synchronized( flushingSessions )
             {
-                session = ( DatagramSession ) flushingSessions.pop();
+                session = ( DatagramSessionImpl ) flushingSessions.pop();
             }
 
             if( session == null )
@@ -401,7 +401,7 @@
         }
     }
 
-    private void flush( DatagramSession session ) throws IOException
+    private void flush( DatagramSessionImpl session ) throws IOException
     {
         DatagramChannel ch = session.getChannel();
 

Copied: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java (from r326548, directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorImpl.java)
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java?p2=directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java&p1=directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorImpl.java&r1=326548&r2=326557&rev=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorImpl.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java Wed Oct 19 06:40:07 2005
@@ -43,7 +43,7 @@
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
-public class DatagramConnectorImpl extends BaseIoConnector implements DatagramSessionManager
+public class DatagramConnectorDelegate extends BaseIoConnector implements DatagramSessionManager
 {
     private static volatile int nextId = 0;
 
@@ -65,7 +65,7 @@
     /**
      * Creates a new instance.
      */
-    public DatagramConnectorImpl()
+    public DatagramConnectorDelegate()
     {
     }
 
@@ -137,7 +137,7 @@
         }
     }
 
-    public void closeSession( DatagramSession session )
+    public void closeSession( DatagramSessionImpl session )
     {
         synchronized( this )
         {
@@ -164,13 +164,13 @@
         selector.wakeup();
     }
 
-    public void flushSession( DatagramSession session )
+    public void flushSession( DatagramSessionImpl session )
     {
         scheduleFlush( session );
         selector.wakeup();
     }
 
-    private void scheduleFlush( DatagramSession session )
+    private void scheduleFlush( DatagramSessionImpl session )
     {
         synchronized( flushingSessions )
         {
@@ -205,7 +205,7 @@
 
                     if( selector.keys().isEmpty() )
                     {
-                        synchronized( DatagramConnectorImpl.this )
+                        synchronized( DatagramConnectorDelegate.this )
                         {
                             if( selector.keys().isEmpty() &&
                                 registerQueue.isEmpty() &&
@@ -218,7 +218,7 @@
                                 }
                                 catch( IOException e )
                                 {
-                                    exceptionMonitor.exceptionCaught( DatagramConnectorImpl.this, e );
+                                    exceptionMonitor.exceptionCaught( DatagramConnectorDelegate.this, e );
                                 }
                                 finally
                                 {
@@ -231,7 +231,7 @@
                 }
                 catch( IOException e )
                 {
-                    exceptionMonitor.exceptionCaught( DatagramConnectorImpl.this,
+                    exceptionMonitor.exceptionCaught( DatagramConnectorDelegate.this,
                             e );
 
                     try
@@ -254,7 +254,7 @@
             SelectionKey key = ( SelectionKey ) it.next();
             it.remove();
 
-            DatagramSession session = ( DatagramSession ) key.attachment();
+            DatagramSessionImpl session = ( DatagramSessionImpl ) key.attachment();
 
             if( key.isReadable() )
             {
@@ -268,7 +268,7 @@
         }
     }
 
-    private void readSession( DatagramSession session )
+    private void readSession( DatagramSessionImpl session )
     {
 
         ByteBuffer readBuf = ByteBuffer.allocate( 2048 );
@@ -303,11 +303,11 @@
 
         for( ;; )
         {
-            DatagramSession session;
+            DatagramSessionImpl session;
 
             synchronized( flushingSessions )
             {
-                session = ( DatagramSession ) flushingSessions.pop();
+                session = ( DatagramSessionImpl ) flushingSessions.pop();
             }
 
             if( session == null )
@@ -324,7 +324,7 @@
         }
     }
 
-    private void flush( DatagramSession session ) throws IOException
+    private void flush( DatagramSessionImpl session ) throws IOException
     {
         DatagramChannel ch = session.getChannel();
 
@@ -400,7 +400,7 @@
             if( req == null )
                 break;
 
-            DatagramSession session = new DatagramSession(
+            DatagramSessionImpl session = new DatagramSessionImpl(
                     filters, req.channel, req.handler );
 
             boolean success = false;
@@ -444,10 +444,10 @@
 
         for( ;; )
         {
-            DatagramSession session;
+            DatagramSessionImpl session;
             synchronized( cancelQueue )
             {
-                session = ( DatagramSession ) cancelQueue.pop();
+                session = ( DatagramSessionImpl ) cancelQueue.pop();
             }
 
             if( session == null )

Copied: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionImpl.java (from r326541, directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSession.java)
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionImpl.java?p2=directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionImpl.java&p1=directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSession.java&r1=326541&r2=326557&rev=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionImpl.java Wed Oct 19 06:40:07 2005
@@ -19,6 +19,7 @@
 package org.apache.mina.transport.socket.nio.support;
 
 import java.net.SocketAddress;
+import java.net.SocketException;
 import java.nio.channels.DatagramChannel;
 import java.nio.channels.SelectionKey;
 
@@ -26,7 +27,6 @@
 import org.apache.mina.common.IoFilterChain;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IoSessionConfig;
 import org.apache.mina.common.IoSessionManager;
 import org.apache.mina.common.TransportType;
 import org.apache.mina.common.WriteFuture;
@@ -34,6 +34,7 @@
 import org.apache.mina.common.support.BaseIoSession;
 import org.apache.mina.common.support.IoSessionFilterChain;
 import org.apache.mina.common.support.IoSessionManagerFilterChain;
+import org.apache.mina.transport.socket.nio.DatagramSession;
 import org.apache.mina.util.Queue;
 
 /**
@@ -42,7 +43,7 @@
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
-class DatagramSession extends BaseIoSession implements IoSession
+class DatagramSessionImpl extends BaseIoSession implements DatagramSession
 {
     private final IoSessionManagerFilterChain managerFilterChain;
     
@@ -50,8 +51,6 @@
 
     private final DatagramChannel ch;
 
-    private final DatagramSessionConfigImpl config;
-
     private final Queue writeRequestQueue;
 
     private final IoHandler handler;
@@ -67,13 +66,12 @@
     /**
      * Creates a new instance.
      */
-    DatagramSession( IoSessionManagerFilterChain managerFilterChain,
+    DatagramSessionImpl( IoSessionManagerFilterChain managerFilterChain,
                      DatagramChannel ch, IoHandler defaultHandler )
     {
         this.managerFilterChain = managerFilterChain;
         this.filterChain = new IoSessionFilterChain( this, managerFilterChain );
         this.ch = ch;
-        this.config = new DatagramSessionConfigImpl( ch );
         this.writeRequestQueue = new Queue();
         this.handler = defaultHandler;
         this.remoteAddress = ch.socket().getRemoteSocketAddress();
@@ -120,9 +118,9 @@
         if( !closeFuture.isReady() )
         {
             IoSessionManager manager = managerFilterChain.getManager();
-            if( manager instanceof DatagramConnectorImpl )
+            if( manager instanceof DatagramConnectorDelegate )
             {
-                ( ( DatagramConnectorImpl ) manager ).closeSession( this );
+                ( ( DatagramConnectorDelegate ) manager ).closeSession( this );
             }
             else
             {
@@ -162,11 +160,6 @@
         return ch.isConnected();
     }
 
-    public IoSessionConfig getConfig()
-    {
-        return config;
-    }
-
     public SocketAddress getRemoteAddress()
     {
         return remoteAddress;
@@ -180,5 +173,25 @@
     public SocketAddress getLocalAddress()
     {
         return localAddress;
+    }
+
+    public boolean getReuseAddress() throws SocketException
+    {
+        return ch.socket().getReuseAddress();
+    }
+
+    public void setReuseAddress( boolean on ) throws SocketException
+    {
+        ch.socket().setReuseAddress( on );
+    }
+
+    public int getTrafficClass() throws SocketException
+    {
+        return ch.socket().getTrafficClass();
+    }
+
+    public void setTrafficClass( int tc ) throws SocketException
+    {
+        ch.socket().setTrafficClass( tc );
     }
 }

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionManager.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionManager.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionManager.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionManager.java Wed Oct 19 06:40:07 2005
@@ -21,7 +21,7 @@
 import org.apache.mina.common.IoSessionManager;
 
 /**
- * A base interface for {@link DatagramAcceptorImpl} and {@link DatagramConnectorImpl}.
+ * A base interface for {@link DatagramAcceptorDelegate} and {@link DatagramConnectorDelegate}.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
@@ -32,11 +32,11 @@
      * Requests this processor to flush the write buffer of the specified
      * session.  This method is invoked by MINA internally.
      */
-    void flushSession( DatagramSession session );
+    void flushSession( DatagramSessionImpl session );
 
     /**
      * Requests this processor to close the specified session.
      * This method is invoked by MINA internally.
      */
-    void closeSession( DatagramSession session );
+    void closeSession( DatagramSessionImpl session );
 }

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionManagerFilterChain.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionManagerFilterChain.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramSessionManagerFilterChain.java Wed Oct 19 06:40:07 2005
@@ -20,7 +20,7 @@
     
     protected void doWrite( IoSession session, WriteRequest writeRequest )
     {
-        DatagramSession s = ( DatagramSession ) session;
+        DatagramSessionImpl s = ( DatagramSessionImpl ) session;
         Queue writeRequestQueue = s.getWriteRequestQueue();
         
         synchronized( writeRequestQueue )

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java Wed Oct 19 06:40:07 2005
@@ -28,10 +28,8 @@
 
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoSessionConfig;
 import org.apache.mina.common.WriteTimeoutException;
 import org.apache.mina.common.IoFilter.WriteRequest;
-import org.apache.mina.transport.socket.nio.SocketSessionConfig;
 import org.apache.mina.util.Queue;
 
 /**
@@ -88,7 +86,7 @@
         return instance;
     }
 
-    public void addSession( SocketSession session )
+    public void addSession( SocketSessionImpl session )
     {
         synchronized( this )
         {
@@ -102,7 +100,7 @@
         selector.wakeup();
     }
 
-    void removeSession( SocketSession session )
+    void removeSession( SocketSessionImpl session )
     {
         scheduleRemove( session );
         startupWorker();
@@ -118,13 +116,13 @@
         }
     }
 
-    void flushSession( SocketSession session )
+    void flushSession( SocketSessionImpl session )
     {
         scheduleFlush( session );
         selector.wakeup();
     }
 
-    void addReadableSession( SocketSession session )
+    void addReadableSession( SocketSessionImpl session )
     {
         synchronized( readableSessions )
         {
@@ -138,13 +136,13 @@
         if( newSessions.isEmpty() )
             return;
 
-        SocketSession session;
+        SocketSessionImpl session;
 
         for( ;; )
         {
             synchronized( newSessions )
             {
-                session = ( SocketSession ) newSessions.pop();
+                session = ( SocketSessionImpl ) newSessions.pop();
             }
 
             if( session == null )
@@ -181,11 +179,11 @@
 
         for( ;; )
         {
-            SocketSession session;
+            SocketSessionImpl session;
 
             synchronized( removingSessions )
             {
-                session = ( SocketSession ) removingSessions.pop();
+                session = ( SocketSessionImpl ) removingSessions.pop();
             }
 
             if( session == null )
@@ -233,7 +231,7 @@
         while( it.hasNext() )
         {
             SelectionKey key = ( SelectionKey ) it.next();
-            SocketSession session = ( SocketSession ) key.attachment();
+            SocketSessionImpl session = ( SocketSessionImpl ) key.attachment();
 
             if( key.isReadable() )
             {
@@ -249,10 +247,9 @@
         selectedKeys.clear();
     }
 
-    private void read( SocketSession session )
+    private void read( SocketSessionImpl session )
     {
-        ByteBuffer buf = ByteBuffer.allocate(
-                (( SocketSessionConfig ) session.getConfig()).getSessionReceiveBufferSize() ); 
+        ByteBuffer buf = ByteBuffer.allocate( session.getSessionReceiveBufferSize() ); 
         SocketChannel ch = session.getChannel();
 
         try
@@ -302,7 +299,7 @@
         }
     }
 
-    private void scheduleRemove( SocketSession session )
+    private void scheduleRemove( SocketSessionImpl session )
     {
         synchronized( removingSessions )
         {
@@ -310,7 +307,7 @@
         }
     }
 
-    private void scheduleFlush( SocketSession session )
+    private void scheduleFlush( SocketSessionImpl session )
     {
         synchronized( flushingSessions )
         {
@@ -322,7 +319,7 @@
     {
         Set keys = selector.keys();
         Iterator it;
-        SocketSession session;
+        SocketSessionImpl session;
 
         // process idle sessions
         long currentTime = System.currentTimeMillis();
@@ -335,38 +332,36 @@
             while( it.hasNext() )
             {
                 SelectionKey key = ( SelectionKey ) it.next();
-                session = ( SocketSession ) key.attachment();
+                session = ( SocketSessionImpl ) key.attachment();
 
                 notifyIdleSession( session, currentTime );
             }
         }
     }
 
-    private void notifyIdleSession( SocketSession session, long currentTime )
+    private void notifyIdleSession( SocketSessionImpl session, long currentTime )
     {
-        IoSessionConfig config = session.getConfig();
-
         notifyIdleSession0(
                 session, currentTime,
-                config.getIdleTimeInMillis( IdleStatus.BOTH_IDLE ),
+                session.getIdleTimeInMillis( IdleStatus.BOTH_IDLE ),
                 IdleStatus.BOTH_IDLE,
                 Math.max( session.getLastIoTime(), session.getLastIdleTime( IdleStatus.BOTH_IDLE ) ) );
         notifyIdleSession0(
                 session, currentTime,
-                config.getIdleTimeInMillis( IdleStatus.READER_IDLE ),
+                session.getIdleTimeInMillis( IdleStatus.READER_IDLE ),
                 IdleStatus.READER_IDLE,
                 Math.max( session.getLastReadTime(), session.getLastIdleTime( IdleStatus.READER_IDLE ) ) );
         notifyIdleSession0(
                 session, currentTime,
-                config.getIdleTimeInMillis( IdleStatus.WRITER_IDLE ),
+                session.getIdleTimeInMillis( IdleStatus.WRITER_IDLE ),
                 IdleStatus.WRITER_IDLE,
                 Math.max( session.getLastWriteTime(), session.getLastIdleTime( IdleStatus.WRITER_IDLE ) ) );
 
-        notifyWriteTimeoutSession( session, currentTime, config
+        notifyWriteTimeoutSession( session, currentTime, session
                 .getWriteTimeoutInMillis(), session.getLastWriteTime() );
     }
 
-    private void notifyIdleSession0( SocketSession session, long currentTime,
+    private void notifyIdleSession0( SocketSessionImpl session, long currentTime,
                                     long idleTime, IdleStatus status,
                                     long lastIoTime )
     {
@@ -378,7 +373,7 @@
         }
     }
 
-    private void notifyWriteTimeoutSession( SocketSession session,
+    private void notifyWriteTimeoutSession( SocketSessionImpl session,
                                            long currentTime,
                                            long writeTimeout, long lastIoTime )
     {
@@ -400,11 +395,11 @@
 
         for( ;; )
         {
-            SocketSession session;
+            SocketSessionImpl session;
 
             synchronized( flushingSessions )
             {
-                session = ( SocketSession ) flushingSessions.pop();
+                session = ( SocketSessionImpl ) flushingSessions.pop();
             }
 
             if( session == null )
@@ -444,7 +439,7 @@
         }
     }
     
-    private void releaseWriteBuffers( SocketSession session )
+    private void releaseWriteBuffers( SocketSessionImpl session )
     {
         Queue writeRequestQueue = session.getWriteRequestQueue();
         WriteRequest req;
@@ -466,7 +461,7 @@
         }
     }
 
-    private void flush( SocketSession session ) throws IOException
+    private void flush( SocketSessionImpl session ) throws IOException
     {
         SocketChannel ch = session.getChannel();
 

Copied: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java (from r326541, directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSession.java)
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java?p2=directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java&p1=directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSession.java&r1=326541&r2=326557&rev=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSessionImpl.java Wed Oct 19 06:40:07 2005
@@ -19,6 +19,7 @@
 package org.apache.mina.transport.socket.nio.support;
 
 import java.net.SocketAddress;
+import java.net.SocketException;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.SocketChannel;
 
@@ -26,14 +27,13 @@
 import org.apache.mina.common.IoFilterChain;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IoSessionConfig;
 import org.apache.mina.common.TransportType;
 import org.apache.mina.common.WriteFuture;
 import org.apache.mina.common.IoFilter.WriteRequest;
 import org.apache.mina.common.support.BaseIoSession;
 import org.apache.mina.common.support.IoSessionFilterChain;
 import org.apache.mina.common.support.IoSessionManagerFilterChain;
-import org.apache.mina.transport.socket.nio.SocketSessionConfig;
+import org.apache.mina.transport.socket.nio.SocketSession;
 import org.apache.mina.util.Queue;
 
 /**
@@ -42,38 +42,30 @@
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
-public class SocketSession extends BaseIoSession implements IoSession
+public class SocketSessionImpl extends BaseIoSession implements SocketSession
 {
+    private static final int DEFAULT_READ_BUFFER_SIZE = 1024;
+
     private final IoSessionManagerFilterChain managerFilterChain;
-    
     private final IoSessionFilterChain filterChain;
-
     private final SocketChannel ch;
-
-    private final SocketSessionConfig config;
-
     private final Queue writeRequestQueue;
-
     private final IoHandler handler;
-
     private final SocketAddress remoteAddress;
-
     private final SocketAddress localAddress;
-
     private SelectionKey key;
-    
     private CloseFuture closeFuture = new CloseFuture();
+    private int readBufferSize = DEFAULT_READ_BUFFER_SIZE;
 
     /**
      * Creates a new instance.
      */
-    public SocketSession( IoSessionManagerFilterChain managerFilterChain,
+    public SocketSessionImpl( IoSessionManagerFilterChain managerFilterChain,
                    SocketChannel ch, IoHandler defaultHandler )
     {
         this.managerFilterChain = managerFilterChain;
         this.filterChain = new IoSessionFilterChain( this, managerFilterChain );
         this.ch = ch;
-        this.config = new SocketSessionConfigImpl( this );
         this.writeRequestQueue = new Queue();
         this.handler = defaultHandler;
         this.remoteAddress = ch.socket().getRemoteSocketAddress();
@@ -155,11 +147,6 @@
         return ch.isConnected();
     }
 
-    public IoSessionConfig getConfig()
-    {
-        return config;
-    }
-
     public SocketAddress getRemoteAddress()
     {
         return remoteAddress;
@@ -168,5 +155,100 @@
     public SocketAddress getLocalAddress()
     {
         return localAddress;
+    }
+
+    public boolean getKeepAlive() throws SocketException
+    {
+        return ch.socket().getKeepAlive();
+    }
+
+    public void setKeepAlive( boolean on ) throws SocketException
+    {
+        ch.socket().setKeepAlive( on );
+    }
+
+    public boolean getOOBInline() throws SocketException
+    {
+        return ch.socket().getOOBInline();
+    }
+
+    public void setOOBInline( boolean on ) throws SocketException
+    {
+        ch.socket().setOOBInline( on );
+    }
+
+    public boolean getReuseAddress() throws SocketException
+    {
+        return ch.socket().getReuseAddress();
+    }
+
+    public void setReuseAddress( boolean on ) throws SocketException
+    {
+        ch.socket().setReuseAddress( on );
+    }
+
+    public int getSoLinger() throws SocketException
+    {
+        return ch.socket().getSoLinger();
+    }
+
+    public void setSoLinger( boolean on, int linger ) throws SocketException
+    {
+        ch.socket().setSoLinger( on, linger );
+    }
+
+    public boolean getTcpNoDelay() throws SocketException
+    {
+        return ch.socket().getTcpNoDelay();
+    }
+
+    public void setTcpNoDelay( boolean on ) throws SocketException
+    {
+        ch.socket().setTcpNoDelay( on );
+    }
+
+    public int getTrafficClass() throws SocketException
+    {
+        return ch.socket().getTrafficClass();
+    }
+
+    public void setTrafficClass( int tc ) throws SocketException
+    {
+        ch.socket().setTrafficClass( tc );
+    }
+
+    public int getSendBufferSize() throws SocketException
+    {
+        return ch.socket().getSendBufferSize();
+    }
+
+    public void setSendBufferSize( int size ) throws SocketException
+    {
+        ch.socket().setSendBufferSize( size );
+    }
+
+    public int getReceiveBufferSize() throws SocketException
+    {
+        return ch.socket().getReceiveBufferSize();
+    }
+
+    public void setReceiveBufferSize( int size ) throws SocketException
+    {
+        ch.socket().setReceiveBufferSize( size );
+    }
+    
+    public int getSessionReceiveBufferSize()
+    {
+        return readBufferSize;
+    }
+    
+    public void setSessionReceiveBufferSize( int size )
+    {
+        if( size <= 0 )
+        {
+            throw new IllegalArgumentException( "Invalid session receive buffer size: " + size );
+        }
+        
+        this.readBufferSize = size;
     }
 }

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSessionManagerFilterChain.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSessionManagerFilterChain.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketSessionManagerFilterChain.java Wed Oct 19 06:40:07 2005
@@ -22,7 +22,7 @@
 
     protected void doWrite( IoSession session, WriteRequest writeRequest )
     {
-        SocketSession s = ( SocketSession ) session;
+        SocketSessionImpl s = ( SocketSessionImpl ) session;
         Queue writeRequestQueue = s.getWriteRequestQueue();
         
         ( ( ByteBuffer ) writeRequest.getMessage() ).mark();

Modified: directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeConnector.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeConnector.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeConnector.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeConnector.java Wed Oct 19 06:40:07 2005
@@ -13,7 +13,7 @@
 import org.apache.mina.transport.vmpipe.support.VmPipe;
 import org.apache.mina.transport.vmpipe.support.VmPipeFilter;
 import org.apache.mina.transport.vmpipe.support.VmPipeIdleStatusChecker;
-import org.apache.mina.transport.vmpipe.support.VmPipeSession;
+import org.apache.mina.transport.vmpipe.support.VmPipeSessionImpl;
 import org.apache.mina.transport.vmpipe.support.VmPipeSessionManagerFilterChain;
 import org.apache.mina.util.AnonymousSocketAddress;
 
@@ -68,7 +68,7 @@
         if( entry == null )
             throw new IOException( "Endpoint unavailable: " + address );
 
-        VmPipeSession session = new VmPipeSession( new Object(), // lock
+        VmPipeSessionImpl session = new VmPipeSessionImpl( new Object(), // lock
                                                    AnonymousSocketAddress.INSTANCE,
                                                    filterChain,
                                                    handler,

Added: directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeSession.java?rev=326557&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeSession.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeSession.java Wed Oct 19 06:40:07 2005
@@ -0,0 +1,16 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.mina.transport.vmpipe;
+
+import org.apache.mina.common.IoSession;
+
+/**
+ * A {@link IoSession} for in-VM transport (VM_PIPE).
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface VmPipeSession extends IoSession
+{
+}
\ No newline at end of file

Propchange: directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/VmPipeSession.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeFilter.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeFilter.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeFilter.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeFilter.java Wed Oct 19 06:40:07 2005
@@ -8,7 +8,7 @@
 import org.apache.mina.common.IoSession;
 
 /**
- * Sets last(Read|Write)Time for {@link VmPipeSession}s. 
+ * Sets last(Read|Write)Time for {@link VmPipeSessionImpl}s. 
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
@@ -18,7 +18,7 @@
     public void messageReceived( NextFilter nextFilter,
                                  IoSession session, Object message )
     {
-        VmPipeSession vps = ( VmPipeSession ) session;
+        VmPipeSessionImpl vps = ( VmPipeSessionImpl ) session;
 
         vps.resetIdleCount( IdleStatus.BOTH_IDLE );
         vps.resetIdleCount( IdleStatus.READER_IDLE );
@@ -34,7 +34,7 @@
     public void messageSent( NextFilter nextFilter,
                              IoSession session, Object message )
     {
-        VmPipeSession vps = ( VmPipeSession ) session;
+        VmPipeSessionImpl vps = ( VmPipeSessionImpl ) session;
         vps.resetIdleCount( IdleStatus.BOTH_IDLE );
         vps.resetIdleCount( IdleStatus.WRITER_IDLE );
         vps.increaseWrittenBytes( 1 );

Modified: directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java Wed Oct 19 06:40:07 2005
@@ -8,7 +8,6 @@
 import java.util.Map;
 
 import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoSessionConfig;
 
 /**
  * Dectects idle sessions and fires <tt>sessionIdle</tt> events to them. 
@@ -34,7 +33,7 @@
         worker.start();
     }
 
-    public void addSession( VmPipeSession session )
+    public void addSession( VmPipeSessionImpl session )
     {
         synchronized( sessions )
         {
@@ -69,7 +68,7 @@
                     Iterator it = sessions.keySet().iterator();
                     while( it.hasNext() )
                     {
-                        VmPipeSession session = ( VmPipeSession ) it.next();
+                        VmPipeSessionImpl session = ( VmPipeSessionImpl ) it.next();
                         if( !session.isConnected() )
                         {
                             it.remove();
@@ -84,28 +83,26 @@
         }
     }
     
-    private void notifyIdleSession( VmPipeSession session, long currentTime )
+    private void notifyIdleSession( VmPipeSessionImpl session, long currentTime )
     {
-        IoSessionConfig config = session.getConfig();
-
         notifyIdleSession0(
                 session, currentTime,
-                config.getIdleTimeInMillis( IdleStatus.BOTH_IDLE ),
+                session.getIdleTimeInMillis( IdleStatus.BOTH_IDLE ),
                 IdleStatus.BOTH_IDLE,
                 Math.max( session.getLastIoTime(), session.getLastIdleTime( IdleStatus.BOTH_IDLE ) ) );
         notifyIdleSession0(
                 session, currentTime,
-                config.getIdleTimeInMillis( IdleStatus.READER_IDLE ),
+                session.getIdleTimeInMillis( IdleStatus.READER_IDLE ),
                 IdleStatus.READER_IDLE,
                 Math.max( session.getLastReadTime(), session.getLastIdleTime( IdleStatus.READER_IDLE ) ) );
         notifyIdleSession0(
                 session, currentTime,
-                config.getIdleTimeInMillis( IdleStatus.WRITER_IDLE ),
+                session.getIdleTimeInMillis( IdleStatus.WRITER_IDLE ),
                 IdleStatus.WRITER_IDLE,
                 Math.max( session.getLastWriteTime(), session.getLastIdleTime( IdleStatus.WRITER_IDLE ) ) );
     }
 
-    private void notifyIdleSession0( VmPipeSession session, long currentTime,
+    private void notifyIdleSession0( VmPipeSessionImpl session, long currentTime,
                                     long idleTime, IdleStatus status,
                                     long lastIoTime )
     {

Copied: directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java (from r326541, directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSession.java)
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java?p2=directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java&p1=directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSession.java&r1=326541&r2=326557&rev=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java Wed Oct 19 06:40:07 2005
@@ -10,7 +10,6 @@
 import org.apache.mina.common.IoFilterChain;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IoSessionConfig;
 import org.apache.mina.common.TransportType;
 import org.apache.mina.common.WriteFuture;
 import org.apache.mina.common.IoFilter.WriteRequest;
@@ -18,7 +17,7 @@
 import org.apache.mina.common.support.IoSessionFilterChain;
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
-import org.apache.mina.transport.vmpipe.VmPipeSessionConfig;
+import org.apache.mina.transport.vmpipe.VmPipeSession;
 import org.apache.mina.util.ExceptionUtil;
 
 /**
@@ -27,7 +26,7 @@
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
-public class VmPipeSession extends BaseIoSession implements IoSession
+public class VmPipeSessionImpl extends BaseIoSession implements VmPipeSession
 {
     private final SocketAddress localAddress;
 
@@ -35,13 +34,11 @@
 
     private final IoHandler handler;
     
-    private final VmPipeSessionConfig config = new VmPipeSessionConfig();
-
     private final IoSessionFilterChain filterChain;
     
     private final VmPipeSessionManagerFilterChain managerFilterChain;
 
-    final VmPipeSession remoteSession;
+    final VmPipeSessionImpl remoteSession;
 
     final Object lock;
 
@@ -50,7 +47,7 @@
     /**
      * Constructor for client-side session.
      */
-    public VmPipeSession( Object lock, SocketAddress localAddress,
+    public VmPipeSessionImpl( Object lock, SocketAddress localAddress,
                    VmPipeSessionManagerFilterChain managerFilterChain,
                    IoHandler handler,
                    VmPipe remoteEntry ) throws IOException
@@ -62,7 +59,7 @@
         this.filterChain = new IoSessionFilterChain( this, managerFilterChain );
         this.managerFilterChain = managerFilterChain;
 
-        remoteSession = new VmPipeSession( this, remoteEntry );
+        remoteSession = new VmPipeSessionImpl( this, remoteEntry );
         
         // initialize remote session
         try
@@ -94,7 +91,7 @@
     /**
      * Constructor for server-side session.
      */
-    private VmPipeSession( VmPipeSession remoteSession, VmPipe entry )
+    private VmPipeSessionImpl( VmPipeSessionImpl remoteSession, VmPipe entry )
     {
         this.lock = remoteSession.lock;
         this.localAddress = remoteSession.remoteAddress;
@@ -167,11 +164,6 @@
     public boolean isConnected()
     {
         return !closed;
-    }
-
-    public IoSessionConfig getConfig()
-    {
-        return config;
     }
 
     public SocketAddress getRemoteAddress()

Modified: directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionManagerFilterChain.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionManagerFilterChain.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionManagerFilterChain.java Wed Oct 19 06:40:07 2005
@@ -14,7 +14,7 @@
 
     protected void doWrite( IoSession session, WriteRequest writeRequest )
     {
-        VmPipeSession s = ( VmPipeSession ) session;
+        VmPipeSessionImpl s = ( VmPipeSessionImpl ) session;
         synchronized( s.lock )
         {
             if( s.closed )

Modified: directory/network/trunk/src/java/org/apache/mina/util/SessionUtil.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/util/SessionUtil.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/util/SessionUtil.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/util/SessionUtil.java Wed Oct 19 06:40:07 2005
@@ -21,9 +21,8 @@
 import java.net.SocketException;
 
 import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IoSessionConfig;
-import org.apache.mina.transport.socket.nio.DatagramSessionConfig;
-import org.apache.mina.transport.socket.nio.SocketSessionConfig;
+import org.apache.mina.transport.socket.nio.DatagramSession;
+import org.apache.mina.transport.socket.nio.SocketSession;
 
 /**
  * Exception utility.
@@ -36,17 +35,16 @@
 {
     public static void initialize( IoSession session ) throws SocketException
     {
-        IoSessionConfig config = session.getConfig();
-        if( config instanceof SocketSessionConfig )
+        if( session instanceof SocketSession )
         {
-            SocketSessionConfig ssc = ( SocketSessionConfig ) config;
-            ssc.setReuseAddress( true );
-            ssc.setKeepAlive( true );
+            SocketSession ss = ( SocketSession ) session;
+            ss.setReuseAddress( true );
+            ss.setKeepAlive( true );
         }
-        else if( config instanceof DatagramSessionConfig )
+        else if( session instanceof DatagramSession )
         {
-            DatagramSessionConfig dsc = ( DatagramSessionConfig ) config;
-            dsc.setReuseAddress( true );
+            DatagramSession ds = ( DatagramSession ) session;
+            ds.setReuseAddress( true );
         }
     }
 

Modified: directory/network/trunk/src/test/org/apache/mina/common/FutureTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/common/FutureTest.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/common/FutureTest.java (original)
+++ directory/network/trunk/src/test/org/apache/mina/common/FutureTest.java Wed Oct 19 06:40:07 2005
@@ -103,11 +103,6 @@
                 return false;
             }
 
-            public IoSessionConfig getConfig()
-            {
-                return null;
-            }
-
             public SocketAddress getRemoteAddress()
             {
                 return null;

Modified: directory/network/trunk/src/test/org/apache/mina/common/IoFilterChainTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/common/IoFilterChainTest.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/common/IoFilterChainTest.java (original)
+++ directory/network/trunk/src/test/org/apache/mina/common/IoFilterChainTest.java Wed Oct 19 06:40:07 2005
@@ -164,10 +164,6 @@
             return false;
         }
 
-        public IoSessionConfig getConfig() {
-            return null;
-        }
-
         public SocketAddress getRemoteAddress() {
             return null;
         }

Modified: directory/network/trunk/src/test/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java (original)
+++ directory/network/trunk/src/test/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java Wed Oct 19 06:40:07 2005
@@ -10,7 +10,6 @@
 import org.apache.mina.common.IoFilterChain;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IoSessionConfig;
 import org.apache.mina.common.TransportType;
 import org.apache.mina.common.WriteFuture;
 import org.apache.mina.common.IoFilter.NextFilter;
@@ -122,11 +121,6 @@
         public boolean isConnected()
         {
             return false;
-        }
-
-        public IoSessionConfig getConfig()
-        {
-            return null;
         }
 
         public SocketAddress getRemoteAddress()

Modified: directory/network/trunk/src/test/org/apache/mina/filter/codec/CumulativeProtocolDecoderTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/filter/codec/CumulativeProtocolDecoderTest.java?rev=326557&r1=326556&r2=326557&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/filter/codec/CumulativeProtocolDecoderTest.java (original)
+++ directory/network/trunk/src/test/org/apache/mina/filter/codec/CumulativeProtocolDecoderTest.java Wed Oct 19 06:40:07 2005
@@ -30,7 +30,6 @@
 import org.apache.mina.common.IoFilterChain;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IoSessionConfig;
 import org.apache.mina.common.TransportType;
 import org.apache.mina.common.WriteFuture;
 import org.apache.mina.common.support.BaseIoSession;
@@ -208,10 +207,6 @@
 
         public boolean isConnected() {
             return false;
-        }
-
-        public IoSessionConfig getConfig() {
-            return null;
         }
 
         public SocketAddress getRemoteAddress() {



Mime
View raw message