The following diagram shows a typical usage of the SSLTube, where
the SSLTube wraps a SocketTube on the right hand side, and is connected
to an HttpConnection on the left hand side.
+---------- SSLTube -------------------------+
| |
| +---SSLFlowDelegate---+ |
HttpConnection | | | | SocketTube
read sink <- SSLSubscriberW. <- Reader <- upstreamR.() <---- read source
(a subscriber) | | \ / | | (a publisher)
| | SSLEngine | |
HttpConnection | | / \ | | SocketTube
write source -> SSLSubscriptionW. -> upstreamW.() -> Writer ----> write sink
(a publisher) | | | | (a subscriber)
| +---------------------+ |
| |
+---------------------------------------------+
Modifier and Type | Class and Description |
---|---|
pack-priv static class | |
pack-priv class | |
pack-priv class | |
pack-priv class |
Modifier and Type | Field and Description |
---|---|
pack-priv final Logger | |
private final SSLEngine | |
private volatile boolean | |
private final SSLTube. | |
private volatile Flow. | |
private final SSLFlowDelegate | |
private final FlowTube | |
private final Demand | writeDemand
Outstanding write demand from the SSL Flow Delegate. |
private final SSLTube. |
Access | Constructor and Description |
---|---|
public | |
public |
Modifier and Type | Method and Description |
---|---|
pack-priv Throwable | Returns: t or an SSLHandshakeException wrapping t, or null.an exception from upstream, or null. t)If the stream is completed before the handshake is finished, we want to forward an SSLHandshakeException downstream. |
public void | connectFlows(FlowTube.
A new publisher for writing to the bidirectional flow. writePub,A new subscriber for reading from the bidirectional
flow. readSubOverrides default jdk. Connects the bidirectional flows to a write |
pack-priv final String | |
public CompletableFuture | |
private String | |
private boolean | |
public boolean | Returns: true when one of this FlowTube Subscriber's OnError or onComplete methods have been invokedImplements jdk. Tells whether, or not, this FlowTube has finished receiving data. |
public void | onComplete()
Implements java. Method invoked when it is known that no additional Subscriber method invocations will occur for a Subscription that is not already terminated by error, after which no other Subscriber methods are invoked by the Subscription. |
public void | onError(Throwable
the exception throwable)Implements java. Method invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription. |
public void | onNext(List<ByteBuffer>
the item item)Implements java. Method invoked with a Subscription's next item. |
public void | onSubscribe(Flow.
a new subscription subscriptionImplements java. Method invoked prior to invoking any other Subscriber methods for the given Subscription. |
public void | subscribe(Flow.
the subscriber sImplements java. Adds the given Subscriber if possible. |
public String |
debug | back to summary |
---|---|
pack-priv final Logger debug |
engine | back to summary |
---|---|
private final SSLEngine engine |
finished | back to summary |
---|---|
private volatile boolean finished |
readSubscriber | back to summary |
---|---|
private final SSLTube. |
readSubscription | back to summary |
---|---|
private volatile Flow. |
sslDelegate | back to summary |
---|---|
private final SSLFlowDelegate sslDelegate |
tube | back to summary |
---|---|
private final FlowTube tube |
writeDemand | back to summary |
---|---|
private final Demand writeDemand Outstanding write demand from the SSL Flow Delegate. |
writeSubscription | back to summary |
---|---|
private final SSLTube. |
SSLTube | back to summary |
---|---|
public SSLTube(SSLEngine engine, Executor executor, FlowTube tube) |
SSLTube | back to summary |
---|---|
public SSLTube(SSLEngine engine, Executor executor, Consumer<ByteBuffer> recycler, FlowTube tube) |
checkForHandshake | back to summary |
---|---|
pack-priv Throwable checkForHandshake(Throwable t) If the stream is completed before the handshake is finished, we want to forward an SSLHandshakeException downstream. If t is not null an exception will always be returned. If t is null an exception will be returned if the engine is handshaking. |
connectFlows | back to summary |
---|---|
public void connectFlows(FlowTube. Overrides default jdk. Doc from jdk. Connects the bidirectional flows to a write
|
dbgString | back to summary |
---|---|
pack-priv final String dbgString() |
getALPN | back to summary |
---|---|
public CompletableFuture |
handshakeFailed | back to summary |
---|---|
private String handshakeFailed() |
handshaking | back to summary |
---|---|
private boolean handshaking() |
isFinished | back to summary |
---|---|
public boolean isFinished() Implements jdk. Tells whether, or not, this FlowTube has finished receiving data.
|
onComplete | back to summary |
---|---|
public void onComplete() Implements java. Doc from java. Method invoked when it is known that no additional Subscriber method invocations will occur for a Subscription that is not already terminated by error, after which no other Subscriber methods are invoked by the Subscription. If this method throws an exception, resulting behavior is undefined.
|
onError | back to summary |
---|---|
public void onError(Throwable throwable) Implements java. Doc from java. Method invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription. If this method itself throws an exception, resulting behavior is undefined. |
onNext | back to summary |
---|---|
public void onNext(List<ByteBuffer> item) Implements java. Doc from java. Method invoked with a Subscription's next item. If this method throws an exception, resulting behavior is not guaranteed, but may cause the Subscription to be cancelled.
|
onSubscribe | back to summary |
---|---|
public void onSubscribe(Flow. Implements java. Doc from java. Method invoked prior to invoking any other Subscriber methods for the given Subscription. If this method throws an exception, resulting behavior is not guaranteed, but may cause the Subscription not to be established or to be cancelled. Typically, implementations of this method invoke
|
subscribe | back to summary |
---|---|
public void subscribe(Flow. Implements java. Doc from java. Adds the given Subscriber if possible. If already
subscribed, or the attempt to subscribe fails due to policy
violations or errors, the Subscriber's
|
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- |
Modifier and Type | Field and Description |
---|---|
pack-priv volatile boolean | |
private final Logger | |
private final FlowTube. | |
pack-priv volatile Throwable | |
pack-priv volatile boolean | |
pack-priv volatile boolean |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public void | dropSubscription()
Overrides default jdk. Called when the flow is connected again, and the subscription is handed over to a new subscriber. |
public void | onComplete()
Implements java. Method invoked when it is known that no additional Subscriber method invocations will occur for a Subscription that is not already terminated by error, after which no other Subscriber methods are invoked by the Subscription. |
public void | onError(Throwable
the exception t)Implements java. Method invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription. |
public void | onNext(List<ByteBuffer>
the item item)Implements java. Method invoked with a Subscription's next item. |
public void | onSubscribe(Flow.
a new subscription subscriptionImplements java. Method invoked prior to invoking any other Subscriber methods for the given Subscription. |
private void | |
public String |
completed | back to summary |
---|---|
pack-priv volatile boolean completed |
debug | back to summary |
---|---|
private final Logger debug |
delegate | back to summary |
---|---|
private final FlowTube. |
error | back to summary |
---|---|
pack-priv volatile Throwable error |
subscribedCalled | back to summary |
---|---|
pack-priv volatile boolean subscribedCalled |
subscribedDone | back to summary |
---|---|
pack-priv volatile boolean subscribedDone |
DelegateWrapper | back to summary |
---|---|
pack-priv DelegateWrapper(Flow. |
dropSubscription | back to summary |
---|---|
public void dropSubscription() Overrides default jdk. Doc from jdk. Called when the flow is connected again, and the subscription
is handed over to a new subscriber.
Once
|
onComplete | back to summary |
---|---|
public void onComplete() Implements java. Doc from java. Method invoked when it is known that no additional Subscriber method invocations will occur for a Subscription that is not already terminated by error, after which no other Subscriber methods are invoked by the Subscription. If this method throws an exception, resulting behavior is undefined.
|
onError | back to summary |
---|---|
public void onError(Throwable t) Implements java. Doc from java. Method invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription. If this method itself throws an exception, resulting behavior is undefined. |
onNext | back to summary |
---|---|
public void onNext(List<ByteBuffer> item) Implements java. Doc from java. Method invoked with a Subscription's next item. If this method throws an exception, resulting behavior is not guaranteed, but may cause the Subscription to be cancelled.
|
onSubscribe | back to summary |
---|---|
public void onSubscribe(Flow. Implements java. Doc from java. Method invoked prior to invoking any other Subscriber methods for the given Subscription. If this method throws an exception, resulting behavior is not guaranteed, but may cause the Subscription not to be established or to be cancelled. Typically, implementations of this method invoke
|
onSubscribe | back to summary |
---|---|
private void onSubscribe(Consumer<Flow. |
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- |
Modifier and Type | Field and Description |
---|---|
private final AtomicReference | |
private volatile boolean | |
private AtomicReference | |
private volatile SSLTube. |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
private void | |
public void | dropSubscription()
Overrides default jdk. Called when the flow is connected again, and the subscription is handed over to a new subscriber. |
public void | onComplete()
Implements java. Method invoked when it is known that no additional Subscriber method invocations will occur for a Subscription that is not already terminated by error, after which no other Subscriber methods are invoked by the Subscription. |
public void | onError(Throwable
the exception throwable)Implements java. Method invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription. |
public void | |
private void | |
public void | onNext(List<ByteBuffer>
the item item)Implements java. Method invoked with a Subscription's next item. |
public void | onSubscribe(Flow.
a new subscription subscriptionImplements java. Method invoked prior to invoking any other Subscriber methods for the given Subscription. |
private void | |
pack-priv void | |
pack-priv void | |
public String |
errorRef | back to summary |
---|---|
private final AtomicReference<Throwable> errorRef |
onCompleteReceived | back to summary |
---|---|
private volatile boolean onCompleteReceived |
pendingDelegate | back to summary |
---|---|
private AtomicReference<SSLTube. |
subscribed | back to summary |
---|---|
private volatile SSLTube. |
SSLSubscriberWrapper | back to summary |
---|---|
pack-priv SSLSubscriberWrapper() |
complete | back to summary |
---|---|
private void complete(SSLTube. |
dropSubscription | back to summary |
---|---|
public void dropSubscription() Overrides default jdk. Doc from jdk. Called when the flow is connected again, and the subscription
is handed over to a new subscriber.
Once
|
onComplete | back to summary |
---|---|
public void onComplete() Implements java. Doc from java. Method invoked when it is known that no additional Subscriber method invocations will occur for a Subscription that is not already terminated by error, after which no other Subscriber methods are invoked by the Subscription. If this method throws an exception, resulting behavior is undefined.
|
onError | back to summary |
---|---|
public void onError(Throwable throwable) Implements java. Doc from java. Method invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription. If this method itself throws an exception, resulting behavior is undefined. |
onErrorImpl | back to summary |
---|---|
public void onErrorImpl(Throwable throwable) |
onNewSubscription | back to summary |
---|---|
private void onNewSubscription(SSLTube. |
onNext | back to summary |
---|---|
public void onNext(List<ByteBuffer> item) Implements java. Doc from java. Method invoked with a Subscription's next item. If this method throws an exception, resulting behavior is not guaranteed, but may cause the Subscription to be cancelled.
|
onSubscribe | back to summary |
---|---|
public void onSubscribe(Flow. Implements java. Doc from java. Method invoked prior to invoking any other Subscriber methods for the given Subscription. If this method throws an exception, resulting behavior is not guaranteed, but may cause the Subscription not to be established or to be cancelled. Typically, implementations of this method invoke
|
onSubscribeImpl | back to summary |
---|---|
private void onSubscribeImpl(Flow. |
processPendingSubscriber | back to summary |
---|---|
pack-priv void processPendingSubscriber() |
setDelegate | back to summary |
---|---|
pack-priv void setDelegate(Flow. |
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- |
Modifier and Type | Field and Description |
---|---|
private volatile boolean | |
pack-priv volatile Flow. |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public void | cancel()
Implements java. Causes the Subscriber to (eventually) stop receiving messages. |
public void | request(long
the increment of demand; a value of n)Long.MAX_VALUE may be considered as effectively unboundedImplements java. Adds the given number |
pack-priv void |
cancelled | back to summary |
---|---|
private volatile boolean cancelled |
delegate | back to summary |
---|---|
pack-priv volatile Flow. |
SSLSubscriptionWrapper | back to summary |
---|---|
pack-priv SSLSubscriptionWrapper() |
cancel | back to summary |
---|---|
public void cancel() Implements java. Doc from java. Causes the Subscriber to (eventually) stop receiving
messages. Implementation is best-effort -- additional
messages may be received after invoking this method.
A cancelled subscription need not ever receive an
|
request | back to summary |
---|---|
public void request(long n) Implements java. Doc from java. Adds the given number
|
setSubscription | back to summary |
---|---|
pack-priv void setSubscription(Flow. |
Access | Constructor and Description |
---|---|
pack-priv | SSLTubeFlowDelegate(SSLEngine engine, Executor executor, Consumer<ByteBuffer> recycler, SSLTube.
|
Modifier and Type | Method and Description |
---|---|
protected Throwable | |
pack-priv void | connect(Flow.
The left hand side read sink (typically, the
HttpConnection read subscriber). downReader,The right hand side write sink (typically
the SocketTube write subscriber). downWriterOverrides jdk. Connects the read sink (downReader) to the SSLFlowDelegate Reader, and the write sink (downWriter) to the SSLFlowDelegate Writer. |
protected SubscriberWrapper. |
SSLTubeFlowDelegate | back to summary |
---|---|
pack-priv SSLTubeFlowDelegate(SSLEngine engine, Executor executor, Consumer<ByteBuffer> recycler, SSLTube. |
checkForHandshake | back to summary |
---|---|
protected Throwable checkForHandshake(Throwable t) Overrides jdk.
|
connect | back to summary |
---|---|
pack-priv void connect(Flow. Overrides jdk. Doc from jdk. Connects the read sink (downReader) to the SSLFlowDelegate Reader, and the write sink (downWriter) to the SSLFlowDelegate Writer. Called from within the constructor. Overwritten by SSLTube.
|
enterReadScheduling | back to summary |
---|---|
protected SubscriberWrapper. Overrides jdk. |