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 StreamEndPoint
s, so that protocols on top of QUIC
can view QUIC streams as if they were an EndPoint
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
A factory for protocol specific instances ofProtocolSession
.Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer, Dumpable.DumpAppendable
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionProtocolSession
(Executor executor, ByteBufferPool byteBufferPool, Session session) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(ConnectionCloseFrame frame, Promise.Invocable<ProtocolSession> promise) Performs an inward close upon sending aCONNECTION_CLOSE
frame.createStreamEndPoint
(Stream stream, Consumer<StreamEndPoint> initializer) void
disconnect
(ConnectionCloseFrame frame, Throwable failure, Promise.Invocable<ProtocolSession> promise) Performs an outward disconnection.protected void
doStart()
Starts the managed lifecycle beans in the order they were added.protected void
doStop()
Stops the managed lifecycle beans in the reverse order they were added.void
dump
(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 Connection
newConnection
(StreamEndPoint endPoint) void
void
onClose
(ConnectionCloseFrame frame) Performs an inward close upon receiving aCONNECTION_CLOSE
frame.boolean
onIdleTimeout
(TimeoutException timeout) protected void
onStart()
protected void
onStop()
void
onStreamFailure
(long streamId, Throwable failure) void
openStreamEndPoint
(StreamEndPoint endPoint) boolean
removeStreamEndPoint
(StreamEndPoint endPoint) shutdown()
Methods inherited from class org.eclipse.jetty.util.component.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, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListeners
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
ProtocolSession
-
-
Method Details
-
getExecutor
-
getByteBufferPool
-
getSession
-
doStart
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in 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:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in 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_CLOSE
frame.This method closes all the
Connection
s associated with theStreamEndPoint
s managed by this class. In turn, theConnection
typically 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
- aPromise
that completes when the frame send completes- See Also:
-
onClose
Performs an inward close upon receiving a
CONNECTION_CLOSE
frame.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, ornull
promise
- thePromise
that gets notified when the disconnect is complete- See Also:
-
offerTask
-
dump
Description copied from interface:Dumpable
Dump 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:
dump
in interfaceDumpable
- Overrides:
dump
in classContainerLifeCycle
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
IOException
- if unable to write to Appendable
-