APIdia Launch Partner
Top Inners Fields Constructors Methods
jdk.internal.net.http

public Class RawChannelTube

extends Object
implements RawChannel
Class Inheritance
All Implemented Interfaces
jdk.internal.net.http.websocket.RawChannel, java.io.Closeable, java.lang.AutoCloseable
Imports
jdk.internal.net.http.common.Demand, .FlowTube, .Logger, .Utils, jdk.internal.net.http.websocket.RawChannel, java.io.EOFException, .IOException, java.lang.ref.Cleaner, java.nio.ByteBuffer, java.nio.channels.ClosedChannelException, .SelectionKey, java.util.ArrayList, .List, java.util.concurrent.ConcurrentLinkedQueue, .Flow, java.util.concurrent.atomic.AtomicBoolean, .AtomicReference, java.util.function.Supplier, java.lang.System.Logger.Level

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv class
pack-priv class
pack-priv class

Field Summary

Modifier and TypeField and Description
private static final Cleaner
pack-priv final AtomicBoolean
pack-priv final HttpConnection
pack-priv final String
pack-priv final Logger
pack-priv final AtomicBoolean
pack-priv final Supplier<ByteBuffer>
pack-priv final AtomicBoolean
pack-priv final AtomicBoolean
pack-priv final RawChannelTube.ReadSubscriber
pack-priv final FlowTube
pack-priv final RawChannelTube.WritePublisher

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements jdk.internal.net.http.websocket.RawChannel.close.

Closes this channel.

private void
private static List<ByteBuffer>
copy(ByteBuffer[] src, int offset, int len)

public ByteBuffer

Returns:

the initial bytes
initialByteBuffer
()

Implements jdk.internal.net.http.websocket.RawChannel.initialByteBuffer.

Hands over the initial bytes.

public ByteBuffer
public void
public void
shutdownInput()

Implements jdk.internal.net.http.websocket.RawChannel.shutdownInput.

Shutdown the connection for reading without closing the channel.

public void
shutdownOutput()

Implements jdk.internal.net.http.websocket.RawChannel.shutdownOutput.

Shutdown the connection for writing without closing the channel.

public long
write(ByteBuffer[] srcs, int offset, int length)

Implements jdk.internal.net.http.websocket.RawChannel.write.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cleanerback to summary
private static final Cleaner cleaner
closedback to summary
pack-priv final AtomicBoolean closed
connectionback to summary
pack-priv final HttpConnection connection
dbgTagback to summary
pack-priv final String dbgTag
debugback to summary
pack-priv final Logger debug
initedback to summary
pack-priv final AtomicBoolean inited
initialback to summary
pack-priv final Supplier<ByteBuffer> initial
inputClosedback to summary
pack-priv final AtomicBoolean inputClosed
outputClosedback to summary
pack-priv final AtomicBoolean outputClosed
readSubscriberback to summary
pack-priv final RawChannelTube.ReadSubscriber readSubscriber
tubeback to summary
pack-priv final FlowTube tube
writePublisherback to summary
pack-priv final RawChannelTube.WritePublisher writePublisher

Constructor Detail

RawChannelTubeback to summary
pack-priv RawChannelTube(HttpConnection connection, Supplier<ByteBuffer> initial)

Method Detail

closeback to summary
public void close()

Implements jdk.internal.net.http.websocket.RawChannel.close.

Closes this channel.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
connectFlowsback to summary
private void connectFlows()
copyback to summary
private static List<ByteBuffer> copy(ByteBuffer[] src, int offset, int len)
initialByteBufferback to summary
public ByteBuffer initialByteBuffer() throws IllegalStateException

Implements jdk.internal.net.http.websocket.RawChannel.initialByteBuffer.

Hands over the initial bytes. Once the bytes have been returned they are no longer available and the method will throw an IllegalStateException on each subsequent invocation.

Returns:ByteBuffer

the initial bytes

Exceptions
IllegalStateException:
if the method has been already invoked
readback to summary
public ByteBuffer read() throws IOException

Implements jdk.internal.net.http.websocket.RawChannel.read.

registerEventback to summary
public void registerEvent(RawChannel.RawEvent event) throws IOException

Implements jdk.internal.net.http.websocket.RawChannel.registerEvent.

shutdownInputback to summary
public void shutdownInput()

Implements jdk.internal.net.http.websocket.RawChannel.shutdownInput.

Shutdown the connection for reading without closing the channel.

Once shutdown for reading then further reads on the channel will return null, the end-of-stream indication. If the input side of the connection is already shutdown then invoking this method has no effect.

Exceptions
ClosedChannelException:
If this channel is closed
IOException:
If some other I/O error occurs
shutdownOutputback to summary
public void shutdownOutput()

Implements jdk.internal.net.http.websocket.RawChannel.shutdownOutput.

Shutdown the connection for writing without closing the channel.

Once shutdown for writing then further attempts to write to the channel will throw ClosedChannelException. If the output side of the connection is already shutdown then invoking this method has no effect.

Exceptions
ClosedChannelException:
If this channel is closed
IOException:
If some other I/O error occurs
writeback to summary
public long write(ByteBuffer[] srcs, int offset, int length) throws IOException

Implements jdk.internal.net.http.websocket.RawChannel.write.

jdk.internal.net.http back to summary

pack-priv final Class RawChannelTube.CleanupChecker

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
pack-priv final AtomicBoolean
pack-priv final System.Logger

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

closedback to summary
pack-priv final AtomicBoolean closed
debugback to summary
pack-priv final System.Logger debug

Constructor Detail

CleanupCheckerback to summary
pack-priv CleanupChecker(AtomicBoolean closed, System.Logger debug)

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
jdk.internal.net.http back to summary

pack-priv Class RawChannelTube.ReadSubscriber

extends Object
implements TubeSubscriber
Class Inheritance
All Implemented Interfaces
jdk.internal.net.http.common.FlowTube.TubeSubscriber, java.util.concurrent.Flow.Subscriber

Field Summary

Modifier and TypeField and Description
pack-priv final ConcurrentLinkedQueue<ByteBuffer>
pack-priv volatile boolean
pack-priv final AtomicReference<Throwable>
pack-priv final ConcurrentLinkedQueue<RawChannel.RawEvent>
pack-priv long
pack-priv volatile Flow.Subscription

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public void
onComplete()

Implements java.util.concurrent.Flow.Subscriber.onComplete.

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 throwable)

Implements java.util.concurrent.Flow.Subscriber.onError.

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> item)

Implements java.util.concurrent.Flow.Subscriber.onNext.

Method invoked with a Subscription's next item.

public void
onSubscribe(Flow.Subscription subscription)

Implements java.util.concurrent.Flow.Subscriber.onSubscribe.

Method invoked prior to invoking any other Subscriber methods for the given Subscription.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

buffersback to summary
pack-priv final ConcurrentLinkedQueue<ByteBuffer> buffers
completedback to summary
pack-priv volatile boolean completed
errorRefback to summary
pack-priv final AtomicReference<Throwable> errorRef
eventsback to summary
pack-priv final ConcurrentLinkedQueue<RawChannel.RawEvent> events
initialRequestback to summary
pack-priv long initialRequest
readSubscriptionback to summary
pack-priv volatile Flow.Subscription readSubscription

Constructor Detail

ReadSubscriberback to summary
pack-priv ReadSubscriber()

Method Detail

checkEventsback to summary
pack-priv void checkEvents()
onCompleteback to summary
public void onComplete()

Implements java.util.concurrent.Flow.Subscriber.onComplete.

Doc from java.util.concurrent.Flow.Subscriber.onComplete.

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.

Annotations
@Override
onErrorback to summary
public void onError(Throwable throwable)

Implements java.util.concurrent.Flow.Subscriber.onError.

Doc from java.util.concurrent.Flow.Subscriber.onError.

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.

Annotations
@Override
onNextback to summary
public void onNext(List<ByteBuffer> item)

Implements java.util.concurrent.Flow.Subscriber.onNext.

Doc from java.util.concurrent.Flow.Subscriber.onNext.

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.

Annotations
@Override
onSubscribeback to summary
public void onSubscribe(Flow.Subscription subscription)

Implements java.util.concurrent.Flow.Subscriber.onSubscribe.

Doc from java.util.concurrent.Flow.Subscriber.onSubscribe.

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 subscription.request to enable receiving items.

Annotations
@Override
jdk.internal.net.http back to summary

pack-priv Class RawChannelTube.WritePublisher

extends Object
implements TubePublisher
Class Inheritance
All Implemented Interfaces
jdk.internal.net.http.common.FlowTube.TubePublisher, java.util.concurrent.Flow.Publisher

Field Summary

Modifier and TypeField and Description
pack-priv final ConcurrentLinkedQueue<RawChannel.RawEvent>
pack-priv volatile RawChannelTube.WriteSubscription

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
subscribe(Flow.Subscriber<? super List<ByteBuffer>> subscriber)

Implements java.util.concurrent.Flow.Publisher.subscribe.

Adds the given Subscriber if possible.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

eventsback to summary
pack-priv final ConcurrentLinkedQueue<RawChannel.RawEvent> events
writeSubscriptionback to summary
pack-priv volatile RawChannelTube.WriteSubscription writeSubscription

Constructor Detail

WritePublisherback to summary
pack-priv WritePublisher()

Method Detail

subscribeback to summary
public void subscribe(Flow.Subscriber<? super List<ByteBuffer>> subscriber)

Implements java.util.concurrent.Flow.Publisher.subscribe.

Doc from java.util.concurrent.Flow.Publisher.subscribe.

Adds the given Subscriber if possible. If already subscribed, or the attempt to subscribe fails due to policy violations or errors, the Subscriber's onError method is invoked with an IllegalStateException. Otherwise, the Subscriber's onSubscribe method is invoked with a new Subscription. Subscribers may enable receiving items by invoking the request method of this Subscription, and may unsubscribe by invoking its cancel method.

Annotations
@Override
jdk.internal.net.http back to summary

pack-priv Class RawChannelTube.WriteSubscription

extends Object
implements Subscription
Class Inheritance
All Implemented Interfaces
java.util.concurrent.Flow.Subscription

Field Summary

Modifier and TypeField and Description
pack-priv volatile boolean
pack-priv final Demand
pack-priv final Flow.Subscriber<? super List<ByteBuffer>>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
cancel()

Implements java.util.concurrent.Flow.Subscription.cancel.

Causes the Subscriber to (eventually) stop receiving messages.

public void
request(long n)

Implements java.util.concurrent.Flow.Subscription.request.

Adds the given number n of items to the current unfulfilled demand for this subscription.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cancelledback to summary
pack-priv volatile boolean cancelled
demandback to summary
pack-priv final Demand demand
subscriberback to summary
pack-priv final Flow.Subscriber<? super List<ByteBuffer>> subscriber

Constructor Detail

WriteSubscriptionback to summary
pack-priv WriteSubscription(Flow.Subscriber<? super List<ByteBuffer>> subscriber)

Method Detail

cancelback to summary
public void cancel()

Implements java.util.concurrent.Flow.Subscription.cancel.

Doc from java.util.concurrent.Flow.Subscription.cancel.

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 onComplete or onError signal.

Annotations
@Override
requestback to summary
public void request(long n)

Implements java.util.concurrent.Flow.Subscription.request.

Doc from java.util.concurrent.Flow.Subscription.request.

Adds the given number n of items to the current unfulfilled demand for this subscription. If n is less than or equal to zero, the Subscriber will receive an onError signal with an IllegalArgumentException argument. Otherwise, the Subscriber will receive up to n additional onNext invocations (or fewer if terminated).

Annotations
@Override