Top Description Inners Fields Constructors Methods
org.eclipse.jetty.quic.common

public abstract Class QuicConnection

extends AbstractConnection
Class Inheritance
Imports
java.io.IOException, java.net.SocketAddress, java.nio.ByteBuffer, java.util.ArrayDeque, .Collection, .EventListener, .List, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, .CopyOnWriteArrayList, .Executor, .TimeoutException, java.util.concurrent.atomic.AtomicBoolean, org.eclipse.jetty.io.AbstractConnection, .ByteBufferPool, .Connection, .DatagramChannelEndPoint, .EndPoint, .RetainableByteBuffer, org.eclipse.jetty.quic.quiche.QuicheConnectionId, org.eclipse.jetty.util.BufferUtil, .Callback, .IteratingCallback, org.eclipse.jetty.util.component.LifeCycle, org.eclipse.jetty.util.thread.AutoLock, .ExecutionStrategy, .Scheduler, org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy, org.slf4j.Logger, .LoggerFactory

A Connection implementation that receives and sends datagram packets via its associated DatagramChannelEndPoint.

The received bytes are peeked to obtain the QUIC connection ID; each QUIC connection ID has an associated QuicSession, and the received bytes are then passed to the QuicSession for processing.

On the receive side, one QuicConnection fans-out to multiple QuicSessions.

On the send side, many QuicSessions fan-in to one QuicConnection.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
private class

Field Summary

Modifier and TypeField and Description
private final ByteBufferPool
private final AtomicBoolean
private final Callback
private final QuicConnection.Flusher
private final List<QuicSession.Listener>
private static final Logger
private int
private final Scheduler
private final ConcurrentMap<QuicheConnectionId, QuicSession>
private final AdaptiveExecutionStrategy
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
protected
QuicConnection(Executor executor, Scheduler scheduler, ByteBufferPool bufferPool, EndPoint endPoint)

Method Summary

Modifier and TypeMethod and Description
public void
public void
close()

Overrides org.eclipse.jetty.io.AbstractConnection.close.

Implements org.eclipse.jetty.io.Connection.close.

Performs a logical close of this connection.

protected abstract QuicSession
createSession(SocketAddress remoteAddress, ByteBuffer cipherBuffer)

public void
fillInterested()

Overrides org.eclipse.jetty.io.AbstractConnection.fillInterested.

Utility method to be called to register read interest.

public ByteBufferPool
public DatagramChannelEndPoint
public int
public Collection<QuicSession>
public Scheduler
public boolean
public boolean
public void
onClose(Throwable cause)

Overrides org.eclipse.jetty.io.AbstractConnection.onClose.

Implements org.eclipse.jetty.io.Connection.onClose.

Callback method invoked when this connection is closed.

protected void
public void
onFillable()

Implements abstract org.eclipse.jetty.io.AbstractConnection.onFillable.

Callback method invoked when the endpoint is ready to be read.

public abstract boolean
onIdleExpired(TimeoutException timeoutException)

Redeclares org.eclipse.jetty.io.Connection.onIdleExpired.

Overrides org.eclipse.jetty.io.AbstractConnection.onIdleExpired.

Callback method invoked upon an idle timeout event.

public void
onOpen()

Overrides org.eclipse.jetty.io.AbstractConnection.onOpen.

Implements org.eclipse.jetty.io.Connection.onOpen.

Callback method invoked when this connection is opened.

public void
private Runnable
process(QuicSession session, SocketAddress remoteAddress, ByteBuffer cipherBuffer)

private Runnable
public void
public void
setOutputBufferSize(int outputBufferSize)

public void
setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)

public void
setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)

public void
write(Callback callback, SocketAddress remoteAddress, ByteBuffer... buffers)

Inherited from org.eclipse.jetty.io.AbstractConnection:
failedCallbackgetBytesIngetBytesOutgetCreatedTimeStampgetExecutorgetInputBufferSizegetInvocationTypegetMessagesIngetMessagesOutisFillInterestedonFillInterestedFailedonReadTimeoutsetInputBufferSizetoConnectionStringtoStringtryFillInterested

Field Detail

bufferPoolback to summary
private final ByteBufferPool bufferPool
closedback to summary
private final AtomicBoolean closed
fillableCallbackback to summary
private final Callback fillableCallback
flusherback to summary
private final QuicConnection.Flusher flusher
listenersback to summary
private final List<QuicSession.Listener> listeners
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.io.AbstractConnection.LOG.

outputBufferSizeback to summary
private int outputBufferSize
schedulerback to summary
private final Scheduler scheduler
sessionsback to summary
private final ConcurrentMap<QuicheConnectionId, QuicSession> sessions
strategyback to summary
private final AdaptiveExecutionStrategy strategy
useInputDirectByteBuffersback to summary
private boolean useInputDirectByteBuffers
useOutputDirectByteBuffersback to summary
private boolean useOutputDirectByteBuffers

Constructor Detail

QuicConnectionback to summary
protected QuicConnection(Executor executor, Scheduler scheduler, ByteBufferPool bufferPool, EndPoint endPoint)

Method Detail

addEventListenerback to summary
public void addEventListener(EventListener listener)

Overrides org.eclipse.jetty.io.AbstractConnection.addEventListener.

Implements org.eclipse.jetty.io.Connection.addEventListener.

Doc from org.eclipse.jetty.io.Connection.addEventListener.

Adds a listener of connection events.

Annotations
@Override
closeback to summary
public void close()

Overrides org.eclipse.jetty.io.AbstractConnection.close.

Implements org.eclipse.jetty.io.Connection.close.

Doc from org.eclipse.jetty.io.Connection.close.

Performs a logical close of this connection.

For simple connections, this may just mean to delegate the close to the associated EndPoint but, for example, SSL connections should write the SSL close message before closing the associated EndPoint.

Annotations
@Override
createSessionback to summary
protected abstract QuicSession createSession(SocketAddress remoteAddress, ByteBuffer cipherBuffer) throws IOException
fillInterestedback to summary
public void fillInterested()

Overrides org.eclipse.jetty.io.AbstractConnection.fillInterested.

Doc from org.eclipse.jetty.io.AbstractConnection.fillInterested.

Utility method to be called to register read interest.

After a call to this method, onFillable() or onFillInterestedFailed(Throwable) will be called back as appropriate.

Annotations
@Override
getByteBufferPoolback to summary
public ByteBufferPool getByteBufferPool()
getEndPointback to summary
public DatagramChannelEndPoint getEndPoint()

Overrides org.eclipse.jetty.io.AbstractConnection.getEndPoint.

Implements org.eclipse.jetty.io.Connection.getEndPoint.

Annotations
@Override
getOutputBufferSizeback to summary
public int getOutputBufferSize()
getQuicSessionsback to summary
public Collection<QuicSession> getQuicSessions()
getSchedulerback to summary
public Scheduler getScheduler()
isUseInputDirectByteBuffersback to summary
public boolean isUseInputDirectByteBuffers()
isUseOutputDirectByteBuffersback to summary
public boolean isUseOutputDirectByteBuffers()
onCloseback to summary
public void onClose(Throwable cause)

Overrides org.eclipse.jetty.io.AbstractConnection.onClose.

Implements org.eclipse.jetty.io.Connection.onClose.

Doc from org.eclipse.jetty.io.Connection.onClose.

Callback method invoked when this connection is closed.

Creators of the connection implementation are responsible for calling this method.

Annotations
@Override
onFailureback to summary
protected void onFailure(Throwable failure)
onFillableback to summary
public void onFillable()

Implements abstract org.eclipse.jetty.io.AbstractConnection.onFillable.

Doc from org.eclipse.jetty.io.AbstractConnection.onFillable.

Callback method invoked when the endpoint is ready to be read.

Annotations
@Override
onIdleExpiredback to summary
public abstract boolean onIdleExpired(TimeoutException timeoutException)

Redeclares org.eclipse.jetty.io.Connection.onIdleExpired.

Overrides org.eclipse.jetty.io.AbstractConnection.onIdleExpired.

Doc from org.eclipse.jetty.io.Connection.onIdleExpired.

Callback 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.

Annotations
@Override
onOpenback to summary
public void onOpen()

Overrides org.eclipse.jetty.io.AbstractConnection.onOpen.

Implements org.eclipse.jetty.io.Connection.onOpen.

Doc from org.eclipse.jetty.io.Connection.onOpen.

Callback method invoked when this connection is opened.

Creators of the connection implementation are responsible for calling this method.

Annotations
@Override
outwardCloseback to summary
public void outwardClose(QuicSession session, Throwable failure)
processback to summary
private Runnable process(QuicSession session, SocketAddress remoteAddress, ByteBuffer cipherBuffer)
receiveAndProcessback to summary
private Runnable receiveAndProcess()
removeEventListenerback to summary
public void removeEventListener(EventListener listener)

Overrides org.eclipse.jetty.io.AbstractConnection.removeEventListener.

Implements org.eclipse.jetty.io.Connection.removeEventListener.

Doc from org.eclipse.jetty.io.Connection.removeEventListener.

Removes a listener of connection events.

Annotations
@Override
setOutputBufferSizeback to summary
public void setOutputBufferSize(int outputBufferSize)
setUseInputDirectByteBuffersback to summary
public void setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)
setUseOutputDirectByteBuffersback to summary
public void setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)
writeback to summary
public void write(Callback callback, SocketAddress remoteAddress, ByteBuffer... buffers)
org.eclipse.jetty.quic.common back to summary

private Class QuicConnection.FillableCallback

extends Object
implements Callback
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.quic.common.QuicConnection.FillableCallback
All Implemented Interfaces
org.eclipse.jetty.util.Callback, org.eclipse.jetty.util.thread.Invocable

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
failed(Throwable x)

Overrides default org.eclipse.jetty.util.Callback.failed.

Callback invoked when the operation fails.

public Invocable.InvocationType
public void
succeeded()

Overrides default org.eclipse.jetty.util.Callback.succeeded.

Callback invoked when the operation completes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FillableCallbackback to summary
private FillableCallback()

Method Detail

failedback to summary
public void failed(Throwable x)

Overrides default org.eclipse.jetty.util.Callback.failed.

Doc from org.eclipse.jetty.util.Callback.failed.

Callback invoked when the operation fails.

Annotations
@Override
getInvocationTypeback to summary
public Invocable.InvocationType getInvocationType()

Overrides default org.eclipse.jetty.util.thread.Invocable.getInvocationType.

Annotations
@Override
succeededback to summary
public void succeeded()

Overrides default org.eclipse.jetty.util.Callback.succeeded.

Doc from org.eclipse.jetty.util.Callback.succeeded.

Callback invoked when the operation completes.

Annotations
@Override
org.eclipse.jetty.quic.common back to summary

private Class QuicConnection.Flusher

extends IteratingCallback
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private QuicConnection.Flusher.Entry
private final AutoLock
private final ArrayDeque<QuicConnection.Flusher.Entry>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
failed(Throwable x)

Overrides org.eclipse.jetty.util.IteratingCallback.failed.

Overrides default org.eclipse.jetty.util.Callback.failed.

Method to invoke when the asynchronous sub-task fails, or to fail the overall asynchronous task and therefore terminate the iteration.

public Invocable.InvocationType
public void
offer(Callback callback, SocketAddress address, ByteBuffer[] buffers)

protected void
onCompleteFailure(Throwable cause)

Overrides org.eclipse.jetty.util.IteratingCallback.onCompleteFailure.

Invoked when the overall task has completed with a failure.

protected IteratingCallback.Action
process()

Implements abstract org.eclipse.jetty.util.IteratingCallback.process.

Method called by iterate() to process the asynchronous sub-task.

public void
succeeded()

Overrides org.eclipse.jetty.util.IteratingCallback.succeeded.

Overrides default org.eclipse.jetty.util.Callback.succeeded.

Method to invoke when the asynchronous sub-task succeeds.

Inherited from org.eclipse.jetty.util.IteratingCallback:
abortcloseisAbortedisClosedisFailedisSucceedediterateonCompleteSuccessresettoString

Field Detail

entryback to summary
private QuicConnection.Flusher.Entry entry
lockback to summary
private final AutoLock lock
queueback to summary
private final ArrayDeque<QuicConnection.Flusher.Entry> queue

Constructor Detail

Flusherback to summary
private Flusher()

Method Detail

failedback to summary
public void failed(Throwable x)

Overrides org.eclipse.jetty.util.IteratingCallback.failed.

Overrides default org.eclipse.jetty.util.Callback.failed.

Doc from org.eclipse.jetty.util.IteratingCallback.failed.

Method to invoke when the asynchronous sub-task fails, or to fail the overall asynchronous task and therefore terminate the iteration.

Subclasses that override this method must always remember to call super.failed(Throwable).

Eventually, onCompleteFailure(Throwable) is called, either by the caller thread or by the processing thread.

Annotations
@Override
getInvocationTypeback to summary
public Invocable.InvocationType getInvocationType()

Overrides default org.eclipse.jetty.util.thread.Invocable.getInvocationType.

Annotations
@Override
offerback to summary
public void offer(Callback callback, SocketAddress address, ByteBuffer[] buffers)
onCompleteFailureback to summary
protected void onCompleteFailure(Throwable cause)

Overrides org.eclipse.jetty.util.IteratingCallback.onCompleteFailure.

Doc from org.eclipse.jetty.util.IteratingCallback.onCompleteFailure.

Invoked when the overall task has completed with a failure.

Annotations
@Override
processback to summary
protected IteratingCallback.Action process()

Implements abstract org.eclipse.jetty.util.IteratingCallback.process.

Doc from org.eclipse.jetty.util.IteratingCallback.process.

Method called by iterate() to process the asynchronous sub-task.

Implementations must initiate the asynchronous execution of the sub-task (if any) and return an appropriate action:

  • Action#IDLE when no sub tasks are available for execution but the overall job is not completed yet
  • Action#SCHEDULED when the sub task asynchronous execution has been started
  • Action#SUCCEEDED when the overall job is completed
Annotations
@Override
succeededback to summary
public void succeeded()

Overrides org.eclipse.jetty.util.IteratingCallback.succeeded.

Overrides default org.eclipse.jetty.util.Callback.succeeded.

Doc from org.eclipse.jetty.util.IteratingCallback.succeeded.

Method to invoke when the asynchronous sub-task succeeds.

Subclasses that override this method must always remember to call super.succeeded().

Annotations
@Override
org.eclipse.jetty.quic.common back to summary

private Class QuicConnection.Flusher.Entry

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final SocketAddress
private final ByteBuffer[]
private final Callback

Constructor Summary

AccessConstructor and Description
private
Entry(Callback callback, SocketAddress address, ByteBuffer[] buffers)

Field Detail

addressback to summary
private final SocketAddress address
buffersback to summary
private final ByteBuffer[] buffers
callbackback to summary
private final Callback callback

Constructor Detail

Entryback to summary
private Entry(Callback callback, SocketAddress address, ByteBuffer[] buffers)
org.eclipse.jetty.quic.common back to summary

private Class QuicConnection.QuicProducer

extends Object
implements Producer
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.thread.ExecutionStrategy.Producer

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Runnable
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

QuicProducerback to summary
private QuicProducer()

Method Detail

produceback to summary
public Runnable produce()

Implements org.eclipse.jetty.util.thread.ExecutionStrategy.Producer.produce.

Doc from org.eclipse.jetty.util.thread.ExecutionStrategy.Producer.produce.

Produces a task to be executed.

Annotations
@Override