Class ProtocolSession
- All Implemented Interfaces:
 Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
- Direct Known Subclasses:
 ClientProtocolSession, ServerProtocolSession
Represents an established stateful connection with a remote peer for a specific QUIC connection.
ProtocolSession is created only when the connection is established, and it is protocol specific,
depending on the protocol negotiated during the connection establishment, or explicitly configured.
ProtocolSession creates and manages StreamEndPoints, so that protocols on top of QUIC
can view QUIC streams as if they were an EndPoint.
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA factory for protocol specific instances ofProtocolSession.Nested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainer, Dumpable.DumpAppendableNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener - 
Field Summary
 - 
Constructor Summary
ConstructorsConstructorDescriptionProtocolSession(Executor executor, ByteBufferPool byteBufferPool, Session session)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidclose(ConnectionCloseFrame frame, Promise.Invocable<ProtocolSession> promise) Performs an inward close upon sending aCONNECTION_CLOSEframe.createStreamEndPoint(Stream stream, Consumer<StreamEndPoint> initializer) voiddisconnect(ConnectionCloseFrame frame, Throwable failure, Promise.Invocable<ProtocolSession> promise) Performs an outward disconnection.protected voiddoStart()Starts the managed lifecycle beans in the order they were added.protected voiddoStop()Stops the managed lifecycle beans in the reverse order they were added.voiddump(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.getStreamEndPoint(long streamId) protected abstract ConnectionnewConnection(StreamEndPoint endPoint) voidvoidonClose(ConnectionCloseFrame frame) Performs an inward close upon receiving aCONNECTION_CLOSEframe.booleanonIdleTimeout(TimeoutException timeout) protected voidonStart()protected voidonStop()voidonStreamFailure(long streamId, Throwable failure) voidopenStreamEndPoint(StreamEndPoint endPoint) booleanremoveStreamEndPoint(StreamEndPoint endPoint) shutdown()Methods inherited from class ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Container
getCachedBeans, getEventListenersMethods inherited from interface Dumpable.DumpableContainer
isDumpable 
- 
Constructor Details
- 
ProtocolSession
 
 - 
 - 
Method Details
- 
getExecutor
 - 
getByteBufferPool
 - 
getSession
 - 
doStart
Description copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
 doStartin classContainerLifeCycle- Throws:
 Exception- If there was a problem starting. Will cause a transition to FAILED state
 - 
onStart
protected void onStart() - 
doStop
Description copied from class:ContainerLifeCycleStops the managed lifecycle beans in the reverse order they were added.- Overrides:
 doStopin classContainerLifeCycle- Throws:
 Exception- If there was a problem stopping. Will cause a transition to FAILED state
 - 
onStop
protected void onStop() - 
getStreamEndPoint
 - 
createStreamEndPoint
 - 
removeStreamEndPoint
 - 
getStreamEndPoints
 - 
openStreamEndPoint
 - 
newConnection
- Throws:
 IOException
 - 
shutdown
 - 
onIdleTimeout
 - 
onStreamFailure
 - 
close
Performs an inward close upon sending a
CONNECTION_CLOSEframe.This method closes all the
Connections associated with theStreamEndPoints managed by this class. In turn, theConnectiontypically closes its associatedStreamEndPoint, causing it to be removed from this class. Lastly, it callsdisconnect(ConnectionCloseFrame, Throwable, Promise.Invocable).- Parameters:
 frame- the frame carrying the error code and reasonpromise- aPromisethat completes when the frame send completes- See Also:
 
 - 
onClose
Performs an inward close upon receiving a
CONNECTION_CLOSEframe.The behavior is identical to
close(ConnectionCloseFrame, Promise.Invocable).- Parameters:
 frame- the frame carrying the error code and reason
 - 
disconnect
public void disconnect(ConnectionCloseFrame frame, Throwable failure, Promise.Invocable<ProtocolSession> promise) Performs an outward disconnection.
- Parameters:
 frame- the frame carrying the error code and reasonfailure- the failure that caused the disconnect, ornullpromise- thePromisethat gets notified when the disconnect is complete- See Also:
 
 - 
offerTask
- Parameters:
 task- The task to offer to the execution strategy.dispatch-trueto dispatch the task,falseto produce in the calling thread. Callers from application threads should usetrue, otherwise they may be arbitrarily delayed. Callers from I/O threads should usefalseto avoid thread hops.
 - 
dump
Description copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
 dumpin interfaceDumpable- Overrides:
 dumpin classContainerLifeCycle- Parameters:
 out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
 IOException- if unable to write to Appendable
 
 -