public abstract class TLSClosing
extends java.lang.Object
When integrating a full-duplex transport medium that does not support
half-closing (which means ending one direction of data transfer without
ending the other) into a stream topology, there can be unexpected effects.
Feeding a finite Source into this medium will close the connection after
all elements have been sent, which means that possible replies may not
be received in full. To support this type of usage, the sending and
receiving of data on the same side (e.g. on the Client
) need to be
coordinated such that it is known when all replies have been received.
Only then should the transport be shut down.
To support these scenarios it is recommended that the full-duplex transport integration is configurable in terms of termination handling, which means that the user can optionally suppress the normal (closing) reaction to completion or cancellation events, as is expressed by the possible values of this type:
- EagerClose
means to not ignore signals
- IgnoreCancel
means to not react to cancellation of the receiving
side unless the sending side has already completed
- IgnoreComplete
means to not react to the completion of the sending
side unless the receiving side has already canceled
- IgnoreBoth
means to ignore the first termination signal—be that
cancellation or completion—and only act upon the second one
Constructor and Description |
---|
TLSClosing() |
Modifier and Type | Method and Description |
---|---|
static TLSClosing |
eagerClose()
Java API: obtain the
EagerClose singleton value. |
static TLSClosing |
ignoreBoth()
Java API: obtain the
IgnoreBoth singleton value. |
abstract boolean |
ignoreCancel() |
abstract boolean |
ignoreComplete() |
public static TLSClosing eagerClose()
EagerClose
singleton value.public static TLSClosing ignoreBoth()
IgnoreBoth
singleton value.public abstract boolean ignoreCancel()
public abstract boolean ignoreComplete()