Examples of ExpiringStack


Examples of org.apache.mina.util.ExpiringStack

            containerStack.clear();
        }
       
        for( int i = directBufferStacks.length - 1; i >= 0; i -- )
        {
            ExpiringStack stack = directBufferStacks[i];
            synchronized( stack )
            {
                stack.clear();
            }
        }
        for( int i = heapBufferStacks.length - 1; i >= 0; i -- )
        {
            ExpiringStack stack = heapBufferStacks[i];
            synchronized( stack )
            {
                stack.clear();
            }
        }
        disposed = true;
    }
View Full Code Here

Examples of org.apache.mina.util.ExpiringStack

   
    private UnexpandableByteBuffer allocate0( int capacity, boolean direct )
    {
        ExpiringStack[] bufferStacks = direct? directBufferStacks : heapBufferStacks;
        int idx = getBufferStackIndex( bufferStacks, capacity );
        ExpiringStack stack = bufferStacks[ idx ];

        UnexpandableByteBuffer buf;
        synchronized( stack )
        {
            buf = ( UnexpandableByteBuffer ) stack.pop();
        }

        if( buf == null )
        {
            java.nio.ByteBuffer nioBuf =
View Full Code Here

Examples of org.apache.mina.util.ExpiringStack

    }
   
    private void release0( UnexpandableByteBuffer buf )
    {
        ExpiringStack[] bufferStacks = buf.buf().isDirect()? directBufferStacks : heapBufferStacks;
        ExpiringStack stack = bufferStacks[ getBufferStackIndex( bufferStacks, buf.buf().capacity() ) ];
       
        synchronized( stack )
        {
            // push back
            stack.push( buf );
        }
    }
View Full Code Here

Examples of org.apache.mina.util.ExpiringStack

                    containerStack.expireBefore( expirationTime );
                }
               
                for( int i = directBufferStacks.length - 1; i >= 0; i -- )
                {
                    ExpiringStack stack = directBufferStacks[ i ];
                    synchronized( stack )
                    {
                        stack.expireBefore( expirationTime );
                    }
                }

                for( int i = heapBufferStacks.length - 1; i >= 0; i -- )
                {
                    ExpiringStack stack = heapBufferStacks[ i ];
                    synchronized( stack )
                    {
                        stack.expireBefore( expirationTime );
                    }
                }
            }
        }
View Full Code Here

Examples of org.apache.mina.util.ExpiringStack

        }

        expirer.shutdown();

        for (int i = directBufferStacks.length - 1; i >= 0; i--) {
            ExpiringStack stack = directBufferStacks[i];
            synchronized (stack) {
                stack.clear();
            }
        }
        for (int i = heapBufferStacks.length - 1; i >= 0; i--) {
            ExpiringStack stack = heapBufferStacks[i];
            synchronized (stack) {
                stack.clear();
            }
        }
        disposed = true;
    }
View Full Code Here

Examples of org.apache.mina.util.ExpiringStack

    private UnexpandableByteBuffer allocate0(int capacity, boolean direct) {
        ExpiringStack[] bufferStacks = direct ? directBufferStacks
                : heapBufferStacks;
        int idx = getBufferStackIndex(bufferStacks, capacity);
        ExpiringStack stack = bufferStacks[idx];

        UnexpandableByteBuffer buf;
        synchronized (stack) {
            buf = (UnexpandableByteBuffer) stack.pop();
        }

        if (buf == null) {
            java.nio.ByteBuffer nioBuf = direct ? java.nio.ByteBuffer
                    .allocateDirect(MINIMUM_CAPACITY << idx)
View Full Code Here

Examples of org.apache.mina.util.ExpiringStack

    }

    private void release0(UnexpandableByteBuffer buf) {
        ExpiringStack[] bufferStacks = buf.buf().isDirect() ? directBufferStacks
                : heapBufferStacks;
        ExpiringStack stack = bufferStacks[getBufferStackIndex(bufferStacks,
                buf.buf().capacity())];

        synchronized (stack) {
            // push back
            stack.push(buf);
        }
    }
View Full Code Here

Examples of org.apache.mina.util.ExpiringStack

                // Expire old buffers
                long expirationTime = System.currentTimeMillis() - timeout;

                for (int i = directBufferStacks.length - 1; i >= 0; i--) {
                    ExpiringStack stack = directBufferStacks[i];
                    synchronized (stack) {
                        stack.expireBefore(expirationTime);
                    }
                }

                for (int i = heapBufferStacks.length - 1; i >= 0; i--) {
                    ExpiringStack stack = heapBufferStacks[i];
                    synchronized (stack) {
                        stack.expireBefore(expirationTime);
                    }
                }
            }
        }
View Full Code Here

Examples of org.apache.mina.util.ExpiringStack

    synchronized (containerStack) {
      containerStack.clear();
    }

    for (int i = directBufferStacks.length - 1; i >= 0; i--) {
      ExpiringStack stack = directBufferStacks[i];
      synchronized (stack) {
        stack.clear();
      }
    }
    for (int i = heapBufferStacks.length - 1; i >= 0; i--) {
      ExpiringStack stack = heapBufferStacks[i];
      synchronized (stack) {
        stack.clear();
      }
    }
    disposed = true;
  }
View Full Code Here

Examples of org.apache.mina.util.ExpiringStack

    count++;

    ExpiringStack[] bufferStacks = direct ? directBufferStacks
        : heapBufferStacks;
    int idx = getBufferStackIndex(bufferStacks, capacity);
    ExpiringStack stack = bufferStacks[idx];

    UnexpandableByteBuffer buf;
    synchronized (stack) {
      buf = (UnexpandableByteBuffer) stack.pop();
    }

    if (buf == null) {
      java.nio.ByteBuffer nioBuf = direct ? java.nio.ByteBuffer
          .allocateDirect(MINIMUM_CAPACITY << idx)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.