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

public Class MessageQueue

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, .CharBuffer, java.util.concurrent.CompletableFuture, java.util.concurrent.atomic.AtomicInteger, java.util.function.BiConsumer, .Supplier

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static interface
private static enum

Field Summary

Modifier and TypeField and Description
private final MessageQueue.Message[]
private volatile int
private final AtomicInteger

Constructor Summary

AccessConstructor and Description
public
MessageQueue(int capacity)

Method Summary

Modifier and TypeMethod and Description
private <T> void
add(MessageQueue.Type type, Supplier<? extends ByteBuffer> binarySupplier, ByteBuffer binary, CharBuffer text, boolean isLast, int statusCode, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future)

public <T> void
addBinary(ByteBuffer message, boolean isLast, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future)

public <T> void
addClose(int statusCode, CharBuffer reason, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future)

public <T> void
addPing(ByteBuffer message, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future)

public <T> void
addPong(ByteBuffer message, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future)

public <T> void
addPong(Supplier<? extends ByteBuffer> message, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future)

public <T> void
addText(CharBuffer message, boolean isLast, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<T> future)

protected static int
public boolean
public <R, E extends Throwable> R
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

elementsback to summary
private final MessageQueue.Message[] elements
tailback to summary
private final AtomicInteger tail

Constructor Detail

MessageQueueback to summary
public MessageQueue(int capacity)

Method Detail

addback to summary
private <T> void add(MessageQueue.Type type, Supplier<? extends ByteBuffer> binarySupplier, ByteBuffer binary, CharBuffer text, boolean isLast, int statusCode, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future) throws IOException
addBinaryback to summary
public <T> void addBinary(ByteBuffer message, boolean isLast, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future) throws IOException
addCloseback to summary
public <T> void addClose(int statusCode, CharBuffer reason, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future) throws IOException
addPingback to summary
public <T> void addPing(ByteBuffer message, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future) throws IOException
addPongback to summary
public <T> void addPong(ByteBuffer message, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future) throws IOException
addPongback to summary
public <T> void addPong(Supplier<? extends ByteBuffer> message, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future) throws IOException
addTextback to summary
public <T> void addText(CharBuffer message, boolean isLast, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<T> future) throws IOException
effectiveCapacityOfback to summary
protected static int effectiveCapacityOf(int n)
isEmptyback to summary
public boolean isEmpty()
peekback to summary
public <R, E extends Throwable> R peek(MessageQueue.QueueCallback<R, E> callback) throws QueueCallback-:E
Annotations
@SuppressWarnings:unchecked
removeback to summary
public void remove()
jdk.internal.net.http.websocket back to summary

private Class MessageQueue.Message

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private BiConsumer<T, U>
private Object
private ByteBuffer
private Supplier<? extends ByteBuffer>
private CompletableFuture<T>
private boolean
private volatile boolean
private int
private CharBuffer
private MessageQueue.Type

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

actionback to summary
private BiConsumer<T, U> action
Annotations
@SuppressWarnings:rawtypes
attachmentback to summary
private Object attachment
binaryback to summary
private ByteBuffer binary
binarySupplierback to summary
private Supplier<? extends ByteBuffer> binarySupplier
futureback to summary
private CompletableFuture<T> future
Annotations
@SuppressWarnings:rawtypes
isLastback to summary
private boolean isLast
readyback to summary
private volatile boolean ready
statusCodeback to summary
private int statusCode
textback to summary
private CharBuffer text
typeback to summary
private MessageQueue.Type type

Constructor Detail

Messageback to summary
private Message()
jdk.internal.net.http.websocket back to summary

public Interface MessageQueue.QueueCallback<R, E extends Throwable>


Method Summary

Modifier and TypeMethod and Description
public <T> R
onBinary(ByteBuffer message, boolean isLast, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future)

public <T> R
onClose(int statusCode, CharBuffer reason, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future)

public R
public <T> R
onPing(ByteBuffer message, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future)

public <T> R
onPong(ByteBuffer message, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future)

public <T> R
onPong(Supplier<? extends ByteBuffer> message, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future)

public <T> R
onText(CharBuffer message, boolean isLast, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future)

Method Detail

onBinaryback to summary
public <T> R onBinary(ByteBuffer message, boolean isLast, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future) throws QueueCallback:E
onCloseback to summary
public <T> R onClose(int statusCode, CharBuffer reason, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future) throws QueueCallback:E
onEmptyback to summary
public R onEmpty() throws QueueCallback:E
onPingback to summary
public <T> R onPing(ByteBuffer message, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future) throws QueueCallback:E
onPongback to summary
public <T> R onPong(ByteBuffer message, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future) throws QueueCallback:E
onPongback to summary
public <T> R onPong(Supplier<? extends ByteBuffer> message, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future) throws QueueCallback:E
onTextback to summary
public <T> R onText(CharBuffer message, boolean isLast, T attachment, BiConsumer<? super T, ? super Throwable> action, CompletableFuture<? super T> future) throws QueueCallback:E
jdk.internal.net.http.websocket back to summary

private final Enum MessageQueue.Type

extends Enum<MessageQueue.Type>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final MessageQueue.Type
public static final MessageQueue.Type
public static final MessageQueue.Type
public static final MessageQueue.Type
public static final MessageQueue.Type

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public static MessageQueue.Type
public static MessageQueue.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BINARYback to summary
public static final MessageQueue.Type BINARY
CLOSEback to summary
public static final MessageQueue.Type CLOSE
PINGback to summary
public static final MessageQueue.Type PING
PONGback to summary
public static final MessageQueue.Type PONG
TEXTback to summary
public static final MessageQueue.Type TEXT

Constructor Detail

Typeback to summary
private Type()

Method Detail

valueOfback to summary
public static MessageQueue.Type valueOf(String name)
valuesback to summary
public static MessageQueue.Type[] values()