Package org.apache.mina.common

Examples of org.apache.mina.common.ByteBuffer.release()


        buf.setAutoExpand(true);
        buf.putObject(message);

        int objectSize = buf.position() - 4;
        if (objectSize > maxObjectSize) {
            buf.release();
            throw new IllegalArgumentException(
                    "The encoded object is too big: " + objectSize + " (> "
                            + maxObjectSize + ')');
        }
View Full Code Here


        buf.putObject( message );
       
        int objectSize = buf.position() - 4;
        if( objectSize > maxObjectSize )
        {
            buf.release();
            throw new IllegalArgumentException( "The encoded object is too big: " + objectSize + " (> " + maxObjectSize + ')' );
        }
       
        buf.flip();
        out.write( buf );
View Full Code Here

            {
                disposeDecoder( session );
            }

            // Release the read buffer.
            in.release();

            decoderOut.flush();
        }
    }
View Full Code Here

        IoSession session = ( IoSession ) session0;
        if( type == EventType.READ )
        {
            ByteBuffer buf = ( ByteBuffer ) data;
            nextFilter.dataRead( session, buf );
            buf.release();
        }
        else if( type == EventType.WRITTEN )
        {
            nextFilter.dataWritten( session, data );
        }
View Full Code Here

                    writeMarkerQueue.pop();
                }

                try
                {
                    buf.release();
                }
                catch( IllegalStateException e )
                {
                    session.getManagerFilterChain().exceptionCaught( session, e );
                }
View Full Code Here

            {
                break;
            }
   
            newBuf.put( buf );
            buf.release();
        }
       
        // Push the new buffer finally.
        newBuf.flip();
        bufferQueue.push(newBuf);
View Full Code Here

                    writeMarkerQueue.pop();
                }

                try
                {
                    buf.release();
                }
                catch( IllegalStateException e )
                {
                    session.getManagerFilterChain().exceptionCaught( session, e );
                }
View Full Code Here

       
        while( ( buf = (ByteBuffer) writeBufferQueue.pop() ) != null )
        {
            try
            {
                buf.release();
            }
            catch( IllegalStateException e )
            {
                session.getManagerFilterChain().exceptionCaught( session, e );
            }
View Full Code Here

                    writeBufferQueue.pop();
                    writeMarkerQueue.pop();
                }
                try
                {
                    buf.release();
                }
                catch( IllegalStateException e )
                {
                    session.getManagerFilterChain().exceptionCaught( session, e );
                }
View Full Code Here

            if (e instanceof IOException)
                scheduleRemove(session);
            session.getFilterChain().fireExceptionCaught(session, e);
        } finally {
            if (buf != null)
                buf.release();
        }
    }

    private void notifyIdleness() {
        // process idle sessions
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.