Class HttpConnectionOverFCGI
- All Implemented Interfaces:
Closeable, AutoCloseable, Connection, Connection, Attachable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static final classprivate classNested classes/interfaces inherited from interface Connection
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Integer, HttpChannelOverFCGI> private Objectprivate final AtomicBooleanprivate final HttpConnectionOverFCGI.Delegateprivate final HttpDestinationprivate final Flusherprivate final Queue<HttpChannelOverFCGI> private static final Loggerprivate final booleanprivate RetainableByteBufferprivate final ClientParserprivate final Promise<Connection> private final LinkedList<Integer> -
Constructor Summary
ConstructorsConstructorDescriptionHttpConnectionOverFCGI(EndPoint endPoint, HttpDestination destination, Promise<Connection> promise, boolean multiplexed) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected HttpChannelOverFCGIacquireHttpChannel(int id, Request request) private intvoidclose()Performs a logical close of this connection.protected voidprotected booleancloseByHTTP(HttpFields fields) private voidfailAndClose(Throwable failure) protected FlusherbooleanisClosed()protected HttpChannelOverFCGInewHttpChannel(Request request) private RetainableByteBuffervoidCallback method invoked when the endpoint is ready to be read.booleanCallback method invoked upon an idle timeout event.voidonOpen()Callback method invoked when this connection is opened.private booleanparse(ByteBuffer buffer) (package private) voidprocess()private voidprotected voidrelease(HttpChannelOverFCGI channel) private voidprivate voidreleaseRequest(int request) voidsend(Request request, Response.CompleteListener listener) Sends a request with an associated response listener.protected SendFailuresend(HttpExchange exchange) voidsetAttachment(Object obj) Attaches the given object to this stream for later retrieval.private voidshutdown()Methods inherited from class AbstractConnection
addListener, failedCallback, fillInterested, getBytesIn, getBytesOut, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getMessagesIn, getMessagesOut, isFillInterested, onClose, onFillInterestedFailed, onReadTimeout, removeListener, setInputBufferSize, toString, tryFillInterested, tryFillInterested
-
Field Details
-
LOG
-
requests
-
activeChannels
-
idleChannels
-
closed
-
destination
-
promise
-
multiplexed
private final boolean multiplexed -
flusher
-
delegate
-
parser
-
networkBuffer
-
attachment
-
-
Constructor Details
-
HttpConnectionOverFCGI
public HttpConnectionOverFCGI(EndPoint endPoint, HttpDestination destination, Promise<Connection> promise, boolean multiplexed)
-
-
Method Details
-
getHttpDestination
-
getFlusher
-
send
Description copied from interface:ConnectionSends a request with an associated response listener.Request.send(Response.CompleteListener)will eventually call this method to send the request. It is exposed to allow applications to send requests via unpooled connections.- Specified by:
sendin interfaceConnection- Parameters:
request- the request to sendlistener- the response listener
-
send
-
onOpen
public void onOpen()Description copied from interface:ConnectionCallback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onOpenin interfaceConnection- Overrides:
onOpenin classAbstractConnection
-
onFillable
public void onFillable()Description copied from class:AbstractConnectionCallback method invoked when the endpoint is ready to be read.
- Specified by:
onFillablein classAbstractConnection- See Also:
-
reacquireNetworkBuffer
private void reacquireNetworkBuffer() -
newNetworkBuffer
-
releaseNetworkBuffer
private void releaseNetworkBuffer() -
process
void process() -
parse
-
shutdown
private void shutdown() -
onIdleExpired
public boolean onIdleExpired()Description copied from interface:ConnectionCallback method invoked upon an idle timeout event.
Implementations of this method may return true to indicate that the idle timeout handling should proceed normally, typically failing the EndPoint and causing it to be closed.
When false is returned, the handling of the idle timeout event is halted immediately and the EndPoint left in the state it was before the idle timeout event.
- Specified by:
onIdleExpiredin interfaceConnection- Overrides:
onIdleExpiredin classAbstractConnection- Returns:
- true to let the EndPoint handle the idle timeout, false to tell the EndPoint to halt the handling of the idle timeout.
-
release
-
close
public void close()Description copied from interface:ConnectionPerforms a logical close of this connection.
For simple connections, this may just mean to delegate the close to the associated
EndPointbut, for example, SSL connections should write the SSL close message before closing the associatedEndPoint.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceConnection- Specified by:
closein interfaceConnection- Overrides:
closein classAbstractConnection
-
close
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceConnection- Returns:
- whether this connection has been closed
- See Also:
-
setAttachment
Description copied from interface:AttachableAttaches the given object to this stream for later retrieval.- Specified by:
setAttachmentin interfaceAttachable- Parameters:
obj- the object to attach to this instance
-
getAttachment
- Specified by:
getAttachmentin interfaceAttachable- Returns:
- the object attached to this instance
- See Also:
-
closeByHTTP
-
abort
-
failAndClose
-
acquireRequest
private int acquireRequest() -
releaseRequest
private void releaseRequest(int request) -
acquireHttpChannel
-
newHttpChannel
-
toConnectionString
- Overrides:
toConnectionStringin classAbstractConnection
-