Package org.mortbay.jetty

Examples of org.mortbay.jetty.EofException


        input = fs.open(source);
        FSDataInputStream spyinput = Mockito.spy(input);

        Mockito.doAnswer(Mockito.CALLS_REAL_METHODS)
               .doThrow(new EofException())
               .when(spyinput)
               .read();

        Mockito.doReturn(spyinput).doReturn(input).when(spyfs).open(source);
View Full Code Here


            catch (IOException e)
            {
                // This is normal in AJP since the socket closes on timeout only
                Log.debug(e);
                reset(true);
                throw (e instanceof EofException) ? e : new EofException(e);
            }
        }
       
        if (filled < 0)
        {
            if (_state > STATE_END)
            {
                _state = STATE_END;
                _handler.messageComplete(_contentPosition);
                return filled;
            }
            reset(true);
            throw new EofException();
        }
   
        return filled;
    }
View Full Code Here

            catch (IOException e)
            {
                // This is normal in AJP since the socket closes on timeout only
                Log.debug(e);
                reset(true);
                throw (e instanceof EofException) ? e : new EofException(e);
            }
        }
       
        if (filled < 0)
        {
            if (_state > STATE_END)
            {
                _state = STATE_END;
                _handler.messageComplete(_contentPosition);
                return filled;
            }
            reset(true);
            throw new EofException();
        }
   
        return filled;
    }
View Full Code Here

        if (total_filled==0 && _inNIOBuffer.length()==0)
        {
            if(!isOpen())
            {
                _outNIOBuffer.clear();
                throw new EofException();
            }
            return false;
        }

        try
        {
            _inBuffer.position(_inNIOBuffer.getIndex());
            _inBuffer.limit(_inNIOBuffer.putIndex());
            _result=null;
            _result=_engine.unwrap(_inBuffer,buffer);
            _inNIOBuffer.skip(_result.bytesConsumed());
        }
        finally
        {
            _inBuffer.position(0);
            _inBuffer.limit(_inBuffer.capacity());
        }
       
        switch(_result.getStatus())
        {
            case BUFFER_OVERFLOW:
                throw new IllegalStateException(_result.toString());                       
               
            case BUFFER_UNDERFLOW:
                if (Log.isDebugEnabled())
                    Log.debug("unwrap {}",_result);
                if(!isOpen())
                {
                    _inNIOBuffer.clear();
                    _outNIOBuffer.clear();
                    throw new EofException();
                }
                return (total_filled > 0);
               
            case CLOSED:
                _closing=true;
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.EofException

Copyright © 2018 www.massapicom. 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.