directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r123320 - in incubator/directory/network/trunk/mina/src: examples/org/apache/mina/examples/echoserver examples/org/apache/mina/examples/netcat examples/org/apache/mina/examples/reverser java/org/apache/mina/common java/org/apache/mina/io java/org/apache/mina/io/datagram java/org/apache/mina/io/filter java/org/apache/mina/io/socket java/org/apache/mina/protocol java/org/apache/mina/util
Date Sat, 25 Dec 2004 06:15:34 GMT
Author: trustin
Date: Fri Dec 24 22:15:33 2004
New Revision: 123320

URL: http://svn.apache.org/viewcvs?view=rev&rev=123320
Log:
Merged ByteBufferPool and ByteBuffer for convenience
Removed:
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/ByteBufferPool.java
Modified:
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/ByteBuffer.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java
(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java
Fri Dec 24 22:15:33 2004
@@ -19,8 +19,6 @@
 package org.apache.mina.examples.echoserver;
 
 import org.apache.mina.common.ByteBuffer;
-
-import org.apache.mina.common.ByteBufferPool;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoSession;
@@ -60,7 +58,7 @@
 
     public void dataRead( IoSession session, ByteBuffer rb )
     {
-        ByteBuffer wb = ByteBufferPool.allocate( rb.remaining() );
+        ByteBuffer wb = ByteBuffer.allocate( rb.remaining() );
         wb.put( rb );
         wb.flip();
         System.out.println( Thread.currentThread().getName() + ' '

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java
(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java
Fri Dec 24 22:15:33 2004
@@ -19,7 +19,6 @@
 package org.apache.mina.examples.netcat;
 
 import org.apache.mina.common.ByteBuffer;
-
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.io.IoHandlerAdapter;
 import org.apache.mina.io.IoSession;

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java
(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java
Fri Dec 24 22:15:33 2004
@@ -19,7 +19,6 @@
 package org.apache.mina.examples.reverser;
 
 import org.apache.mina.common.ByteBuffer;
-
 import org.apache.mina.protocol.ProtocolDecoder;
 import org.apache.mina.protocol.ProtocolDecoderOutput;
 import org.apache.mina.protocol.ProtocolSession;

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java
(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java
Fri Dec 24 22:15:33 2004
@@ -19,8 +19,6 @@
 package org.apache.mina.examples.reverser;
 
 import org.apache.mina.common.ByteBuffer;
-
-import org.apache.mina.common.ByteBufferPool;
 import org.apache.mina.protocol.ProtocolEncoder;
 import org.apache.mina.protocol.ProtocolEncoderOutput;
 import org.apache.mina.protocol.ProtocolSession;
@@ -49,7 +47,7 @@
 
         val += "\r\n";
 
-        ByteBuffer buf = ByteBufferPool.allocate( val.length() );
+        ByteBuffer buf = ByteBuffer.allocate( val.length() );
         for( int i = 0; i < val.length(); i++ )
         {
             buf.put( ( byte ) val.charAt( i ) );

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/ByteBuffer.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/ByteBuffer.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/ByteBuffer.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/ByteBuffer.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/ByteBuffer.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/ByteBuffer.java
Fri Dec 24 22:15:33 2004
@@ -11,6 +11,8 @@
 import java.nio.LongBuffer;
 import java.nio.ShortBuffer;
 
+import org.apache.mina.util.Stack;
+
 /**
  * A byte buffer used by MINA applications.
  * <p>
@@ -21,9 +23,96 @@
  * @version $Rev$, $Date$,
  */
 public final class ByteBuffer {
-	private final java.nio.ByteBuffer buf;
+    private static final int[] bufferStackSizes = new int[] {
+    		16,
+			32,
+			64,
+			128,
+			256,
+			512,
+			1024,
+			2048,
+			3072,
+			4096,
+			6144,
+			8192,
+    };
+    
+    private static final Stack[] bufferStacks = new Stack[] {
+    		new Stack(),
+    		new Stack(),
+    		new Stack(),
+    		new Stack(),
+    		new Stack(),
+    		new Stack(),
+    		new Stack(),
+    		new Stack(),
+    		new Stack(),
+    		new Stack(),
+    		new Stack(),
+    		new Stack(),
+    };
+    
+    public static ByteBuffer allocate(int size)
+    {
+    	int idx = getBufferStackIndex(size);
+    	Stack stack = bufferStacks[idx];
+    	
+    	ByteBuffer buf;
+		synchronized (stack)
+		{
+			buf = (ByteBuffer) stack.pop();
+    		if (buf == null)
+    		{
+    			buf = new ByteBuffer(java.nio.ByteBuffer.allocateDirect( bufferStackSizes[ idx ] ));
+    		}
+		}
+		
+		buf.clear();
+		return buf;
+    }
+
+    public static void release( ByteBuffer buf )
+    {
+    	Stack stack = bufferStacks[ getBufferStackIndex( buf.capacity() ) ];
+    	synchronized (stack)
+		{
+    		stack.push( buf );
+		}
+    }
+    
+    private static int getBufferStackIndex(int size) {
+    	if (size <= 16)
+    		return 0;
+    	if (size <= 32)
+    		return 1;
+    	if (size <= 64)
+    		return 2;
+    	if (size <= 128)
+    		return 3;
+    	if (size <= 256)
+    		return 4;
+    	if (size <= 512)
+    		return 5;
+    	if (size <= 1024)
+    		return 6;
+    	if (size <= 2048)
+    		return 7;
+    	if (size <= 3072)
+    		return 8;
+    	if (size <= 4096)
+    		return 9;
+    	if (size <= 6144)
+    		return 10;
+    	if (size <= 8192)
+    		return 11;
+    	
+    	throw new IllegalArgumentException("Buffer size cannot exceed 8192: " + size);
+    }
+
+    private final java.nio.ByteBuffer buf;
 
-	ByteBuffer(java.nio.ByteBuffer buf) {
+	private ByteBuffer(java.nio.ByteBuffer buf) {
 		this.buf = buf;
 	}
 	

Deleted: /incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/ByteBufferPool.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/ByteBufferPool.java?view=auto&rev=123319
==============================================================================

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java
Fri Dec 24 22:15:33 2004
@@ -19,7 +19,6 @@
 package org.apache.mina.io;
 
 import org.apache.mina.common.ByteBuffer;
-
 import org.apache.mina.common.IdleStatus;
 
 /**

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java
Fri Dec 24 22:15:33 2004
@@ -19,7 +19,6 @@
 package org.apache.mina.io;
 
 import org.apache.mina.common.ByteBuffer;
-
 import org.apache.mina.common.IdleStatus;
 
 /**

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java
Fri Dec 24 22:15:33 2004
@@ -31,7 +31,6 @@
 import java.util.Set;
 
 import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.ByteBufferPool;
 import org.apache.mina.io.Acceptor;
 import org.apache.mina.io.ExceptionMonitor;
 import org.apache.mina.io.IoHandler;
@@ -245,7 +244,7 @@
     private void readSession( DatagramSession session )
     {
 
-        ByteBuffer readBuf = ByteBufferPool.allocate( 2048 );
+        ByteBuffer readBuf = ByteBuffer.allocate( 2048 );
         try
         {
             SocketAddress remoteAddress = session.getChannel()
@@ -320,7 +319,7 @@
                     writeMarkerQueue.pop();
                 }
                 
-                ByteBufferPool.release( buf );
+                ByteBuffer.release( buf );
                 session.getFilterManager().fireDataWritten( session, marker );
                 continue;
             }

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java
Fri Dec 24 22:15:33 2004
@@ -21,7 +21,6 @@
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
-import org.apache.mina.common.ByteBuffer;
 import java.nio.channels.ClosedChannelException;
 import java.nio.channels.DatagramChannel;
 import java.nio.channels.SelectionKey;
@@ -29,7 +28,7 @@
 import java.util.Iterator;
 import java.util.Set;
 
-import org.apache.mina.common.ByteBufferPool;
+import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.io.Connector;
 import org.apache.mina.io.ExceptionMonitor;
 import org.apache.mina.io.IoHandler;
@@ -239,7 +238,7 @@
     private void readSession( DatagramSession session )
     {
 
-        ByteBuffer readBuf = ByteBufferPool.allocate( 2048 );
+        ByteBuffer readBuf = ByteBuffer.allocate( 2048 );
         try
         {
             int readBytes = session.getChannel().read( readBuf.buf() );
@@ -311,7 +310,7 @@
                     writeBufferQueue.pop();
                     writeMarkerQueue.pop();
                 }
-                ByteBufferPool.release( buf );
+                ByteBuffer.release( buf );
                 session.getFilterManager().fireDataWritten( session, marker );
                 continue;
             }

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java
Fri Dec 24 22:15:33 2004
@@ -19,10 +19,10 @@
 package org.apache.mina.io.datagram;
 
 import java.net.SocketAddress;
-import org.apache.mina.common.ByteBuffer;
 import java.nio.channels.DatagramChannel;
 import java.nio.channels.SelectionKey;
 
+import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.SessionConfig;
 import org.apache.mina.io.IoHandler;

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java
Fri Dec 24 22:15:33 2004
@@ -21,10 +21,10 @@
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
-import org.apache.mina.common.ByteBuffer;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerFilterAdapter;
 import org.apache.mina.io.IoSession;

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/IoThreadPoolFilter.java
Fri Dec 24 22:15:33 2004
@@ -18,13 +18,13 @@
  */
 package org.apache.mina.io.filter;
 
-import org.apache.mina.common.ByteBuffer;
 import java.util.HashSet;
 import java.util.IdentityHashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerFilter;

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
Fri Dec 24 22:15:33 2004
@@ -19,14 +19,13 @@
 package org.apache.mina.io.socket;
 
 import java.io.IOException;
-import org.apache.mina.common.ByteBuffer;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
 import java.nio.channels.SocketChannel;
 import java.util.Iterator;
 import java.util.Set;
 
-import org.apache.mina.common.ByteBufferPool;
+import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.SessionConfig;
 import org.apache.mina.io.WriteTimeoutException;
@@ -417,7 +416,7 @@
                     writeBufferQueue.pop();
                     writeMarkerQueue.pop();
                 }
-                ByteBufferPool.release( buf );
+                ByteBuffer.release( buf );
                 session.getFilterManager().fireDataWritten( session, marker );
                 continue;
             }

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java
Fri Dec 24 22:15:33 2004
@@ -19,11 +19,10 @@
 package org.apache.mina.io.socket;
 
 import java.net.SocketAddress;
-import org.apache.mina.common.ByteBuffer;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.SocketChannel;
 
-import org.apache.mina.common.ByteBufferPool;
+import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.SessionConfig;
 import org.apache.mina.io.IoHandler;
@@ -84,7 +83,7 @@
         this.filterManager = filterManager;
         this.ch = ch;
         this.config = new SocketSessionConfig( ch );
-        this.readBuf = ByteBufferPool.allocate( 4096 ).limit( 0 );
+        this.readBuf = ByteBuffer.allocate( 4096 ).limit( 0 );
         this.writeBufferQueue = new Queue();
         this.writeMarkerQueue = new Queue();
         this.handler = defaultHandler;
@@ -114,7 +113,7 @@
 
     void dispose()
     {
-        ByteBufferPool.release( readBuf );
+        ByteBuffer.release( readBuf );
     }
 
     public IoHandler getHandler()

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java
Fri Dec 24 22:15:33 2004
@@ -19,9 +19,8 @@
 package org.apache.mina.protocol;
 
 import java.net.SocketAddress;
-import org.apache.mina.common.ByteBuffer;
 
-import org.apache.mina.common.ByteBufferPool;
+import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.SessionConfig;
 import org.apache.mina.io.IoHandler;
@@ -138,7 +137,7 @@
             
             if (session.isStateless())
             {
-            	ByteBufferPool.release( in );
+            	ByteBuffer.release( in );
             }
         }
 

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java
Fri Dec 24 22:15:33 2004
@@ -19,7 +19,6 @@
 package org.apache.mina.protocol;
 
 import org.apache.mina.common.ByteBuffer;
-
 import org.apache.mina.util.ByteBuffers;
 
 /**

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java?view=diff&rev=123320&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java&r1=123319&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java&r2=123320
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java
Fri Dec 24 22:15:33 2004
@@ -19,8 +19,6 @@
 package org.apache.mina.util;
 
 import org.apache.mina.common.ByteBuffer;
-
-import org.apache.mina.common.ByteBufferPool;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerFilter;
@@ -66,7 +64,7 @@
         	IoHandler handler = session.getHandler();
             handler.dataRead( session, buf );
             if (session.isStateless() && !IoAdapter.IO_HANDLER_TYPE.isAssignableFrom(
handler.getClass() )) {
-            	ByteBufferPool.release( buf );
+            	ByteBuffer.release( buf );
             }
         }
 

Mime
View raw message