当前位置: 首页>>代码示例>>Java>>正文


Java Transport.END_OF_STREAM属性代码示例

本文整理汇总了Java中org.apache.qpid.proton.engine.Transport.END_OF_STREAM属性的典型用法代码示例。如果您正苦于以下问题:Java Transport.END_OF_STREAM属性的具体用法?Java Transport.END_OF_STREAM怎么用?Java Transport.END_OF_STREAM使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.qpid.proton.engine.Transport的用法示例。


在下文中一共展示了Transport.END_OF_STREAM属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: pourAll

/**
 * Pours the contents of {@code source} into {@code destinationTransportInput}, calling
 * the TransportInput many times if necessary.  If the TransportInput returns a {@link org.apache.qpid.proton.engine.TransportResult}
 * other than ok, data may remain in source.
 */
public static int pourAll(ByteBuffer source, TransportInput destinationTransportInput) throws TransportException
{
    int capacity = destinationTransportInput.capacity();
    if (capacity == Transport.END_OF_STREAM)
    {
        if (source.hasRemaining()) {
            throw new IllegalStateException("Destination has reached end of stream: " +
                                            destinationTransportInput);
        } else {
            return Transport.END_OF_STREAM;
        }
    }

    int total = source.remaining();

    while(source.hasRemaining() && destinationTransportInput.capacity() > 0)
    {
        pour(source, destinationTransportInput.tail());
        destinationTransportInput.process();
    }

    return total - source.remaining();
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:28,代码来源:ByteBufferUtils.java

示例2: recv

int recv(final byte[] bytes, int offset, int size)
{
    final int consumed;
    if (_data != null)
    {
        //TODO - should only be if no bytes left
        consumed = Math.min(size, _dataSize);

        System.arraycopy(_data, _offset, bytes, offset, consumed);
        _offset += consumed;
        _dataSize -= consumed;
    }
    else
    {
        _dataSize = consumed = 0;
    }

    return (_complete && consumed == 0) ? Transport.END_OF_STREAM : consumed;  //TODO - Implement
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:19,代码来源:DeliveryImpl.java

示例3: pending

@Override
public int pending()
{
    if (isOutputInSaslMode() || _outputBuffer.position() != 0)
    {
        fillOutputBuffer();
        _head.limit(_outputBuffer.position());

        if (_head_closed && _outputBuffer.position() == 0)
        {
            return Transport.END_OF_STREAM;
        }
        else
        {
            return _outputBuffer.position();
        }
    }
    else
    {
        return _underlyingOutput.pending();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:22,代码来源:SaslImpl.java

示例4: pending

@Override
public int pending()
{
    try {
        wrapOutput();
    } catch (SSLException e) {
        _logger.log(Level.WARNING, e.getMessage());
        _head_closed = true;
    }

    _head.limit(_outputBuffer.position());

    if (_head_closed && _outputBuffer.position() == 0) {
        return Transport.END_OF_STREAM;
    }

    return _outputBuffer.position();
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:18,代码来源:SimpleSslTransportWrapper.java

示例5: capacity

@Override
public int capacity()
{
    if (_tail_closed) {
        return Transport.END_OF_STREAM;
    } else {
        if (_inputBuffer != null) {
            return _inputBuffer.remaining();
        } else {
            return _inputBufferSize;
        }
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:13,代码来源:FrameParser.java

示例6: position

@Override
public int position() {
    if (_tail_closed) {
        return Transport.END_OF_STREAM;
    }
    return (_inputBuffer == null) ? 0 : _inputBuffer.position();
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:7,代码来源:FrameParser.java

示例7: capacity

@Override
public int capacity()
{
    if (_tail_closed) return Transport.END_OF_STREAM;
    if (isInputInSaslMode())
    {
        return _inputBuffer.remaining();
    }
    else
    {
        return _underlyingInput.capacity();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:13,代码来源:SaslImpl.java

示例8: position

@Override
public int position()
{
    if (_tail_closed) return Transport.END_OF_STREAM;
    if (isInputInSaslMode())
    {
        return _inputBuffer.position();
    }
    else
    {
        return _underlyingInput.position();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:13,代码来源:SaslImpl.java

示例9: reallyProcessInput

private void reallyProcessInput() throws TransportException
{
    if(isInputInSaslMode())
    {
        if(_logger.isLoggable(Level.FINER))
        {
            _logger.log(Level.FINER, SaslImpl.this + " about to call input.");
        }

        _frameParser.input(_inputBuffer);
    }

    if(!isInputInSaslMode())
    {
        if(_logger.isLoggable(Level.FINER))
        {
            _logger.log(Level.FINER, SaslImpl.this + " about to call plain input");
        }

        if (_inputBuffer.hasRemaining())
        {
            int bytes = pourAll(_inputBuffer, _underlyingInput);
            if (bytes == Transport.END_OF_STREAM)
            {
                _tail_closed = true;
            }

            _underlyingInput.process();
        }
        else
        {
            _underlyingInput.process();
        }
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:35,代码来源:SaslImpl.java

示例10: capacity

@Override
public int capacity()
{
    initTransportWrapperOnFirstIO();
    if (_initException == null) {
        return _transportWrapper.capacity();
    } else {
        return Transport.END_OF_STREAM;
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:10,代码来源:SslImpl.java

示例11: position

@Override
public int position()
{
    initTransportWrapperOnFirstIO();
    if (_initException == null) {
        return _transportWrapper.position();
    } else {
        return Transport.END_OF_STREAM;
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:10,代码来源:SslImpl.java

示例12: capacity

@Override
public int capacity()
{
    if (isDeterminationMade())
    {
        return _selectedTransportWrapper.capacity();
    }
    else
    {
        if (_tail_closed) { return Transport.END_OF_STREAM; }
        return _determinationBuffer.remaining();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:13,代码来源:HandshakeSniffingTransportWrapper.java

示例13: position

@Override
public int position()
{
    if (isDeterminationMade())
    {
        return _selectedTransportWrapper.position();
    }
    else
    {
        if (_tail_closed) { return Transport.END_OF_STREAM; }
        return _determinationBuffer.position();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:13,代码来源:HandshakeSniffingTransportWrapper.java

示例14: pending

@Override
public int pending()
{
    if (_head_closed) { return Transport.END_OF_STREAM; }

    if (isDeterminationMade()) {
        return _selectedTransportWrapper.pending();
    } else {
        return 0;
    }

}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:12,代码来源:HandshakeSniffingTransportWrapper.java

示例15: pending

@Override
public int pending()
{
    if (_head_closed) {
        return Transport.END_OF_STREAM;
    }

    if(_outputBuffer == null)
    {
        init_buffers();
    }

    _output_done = _transportOutputWriter.writeInto(_outputBuffer);
    _head.limit(_outputBuffer.position());

    if (_outputBuffer.position() == 0 && _outputBuffer.capacity() > TransportImpl.BUFFER_RELEASE_THRESHOLD)
    {
        release_buffers();
    }

    if (_output_done && (_outputBuffer == null || _outputBuffer.position() == 0))
    {
        return Transport.END_OF_STREAM;
    }
    else
    {
        return _outputBuffer == null ? 0 : _outputBuffer.position();
    }
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:29,代码来源:TransportOutputAdaptor.java


注:本文中的org.apache.qpid.proton.engine.Transport.END_OF_STREAM属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。