All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.jetty.server.HttpInput_async.puml Maven / Gradle / Ivy

There is a newer version: 12.1.0.alpha0
Show newest version
@startuml
title "HttpInput"

participant AsyncContentDelivery as "[async\ncontent\ndelivery]"
participant HttpChannel as "Http\nChannel\n"
participant HttpChannelState as "Http\nChannel\nState"
participant HttpInputInterceptor as "Http\nInput.\nInterceptor"
participant AsyncContentProducer as "Async\nContent\nProducer"
participant HttpInput as "Http\nInput\n"
participant Application as "\nApplication\n"

autoactivate on

== Async Read ==

Application->HttpInput: read
activate Application
    HttpInput->AsyncContentProducer: nextContent
        AsyncContentProducer->AsyncContentProducer: next\nTransformed\nContent
            AsyncContentProducer->HttpChannel: produceContent
            return raw content or null
            alt if raw content is not null
                AsyncContentProducer->HttpInputInterceptor: readFrom
                return transformed content
            end 
        return
        alt if transformed content is not null
            AsyncContentProducer->HttpChannelState: onReadIdle
            return
        end
    return content or null
    note over HttpInput
        throw ISE
        if content
        is null
    end note
    HttpInput->HttpInput: copy content\ninto byte[]
    return
    alt content is empty
        HttpInput->AsyncContentProducer: reclaim
        return
    end
return
deactivate Application

== isReady ==

Application->HttpInput: isReady
activate Application
    HttpInput->AsyncContentProducer: isReady
        AsyncContentProducer->AsyncContentProducer: next\nTransformed\nContent
            AsyncContentProducer->HttpChannel: produceContent
            return raw content or null
            alt if raw content is not null
                AsyncContentProducer->HttpInputInterceptor: readFrom
                return transformed content
            end 
        return
            AsyncContentProducer->HttpChannelState: onReadUnready
            return
        loop
            AsyncContentProducer->HttpChannel: needContent
            return
            alt if needContent returns true
                AsyncContentProducer->AsyncContentProducer: next\nTransformed\nContent
                return
                alt if transformed content is not null
                    AsyncContentProducer->HttpChannelState: onContentAdded
                    return
                    note over AsyncContentProducer
                        break loop
                    end note
                end
            else
                    note over AsyncContentProducer
                        break loop
                    end note
            end
        end
    return boolean\n[transformed\ncontent is not null]
return
deactivate Application

alt if content arrives
    AsyncContentDelivery->HttpInput: onContentProducible
        HttpInput->AsyncContentProducer: onContentProducible
            AsyncContentProducer->HttpChannelState: onReadReady
            return true if woken
        return true if woken
    return true if woken
    alt onContentProducible returns true
        AsyncContentDelivery->HttpChannel: handle()
        return
    end
end

|||

== available ==

Application->HttpInput: available
activate Application
    HttpInput->AsyncContentProducer: available
        AsyncContentProducer->AsyncContentProducer: next\nTransformed\nContent
            AsyncContentProducer->HttpChannel: produceContent
            return raw content or null
            alt if raw content is not null
                AsyncContentProducer->HttpInputInterceptor: readFrom
                return transformed content
            end 
        return
    return content size or\n0 if content is null
return
deactivate Application

|||
@enduml




© 2015 - 2024 Weber Informatics LLC | Privacy Policy