@WebSocket handler that delegates events to a
reactive WebSocketHandler and its session.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final WebSocketHandler | |
| private JettyWebSocketSession | |
| private static final ByteBuffer | |
| private final Function |
| Access | Constructor and Description |
|---|---|
| public | JettyWebSocketHandlerAdapter(WebSocketHandler handler, Function<Session, JettyWebSocketSession> sessionFactory)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void |
| delegateHandler | back to summary |
|---|---|
| private final WebSocketHandler delegateHandler | |
| delegateSession | back to summary |
|---|---|
| private JettyWebSocketSession delegateSession
| |
| EMPTY_PAYLOAD | back to summary |
|---|---|
| private static final ByteBuffer EMPTY_PAYLOAD | |
| sessionFactory | back to summary |
|---|---|
| private final Function<Session, JettyWebSocketSession> sessionFactory | |
| JettyWebSocketHandlerAdapter | back to summary |
|---|---|
| public JettyWebSocketHandlerAdapter(WebSocketHandler handler, Function<Session, JettyWebSocketSession> sessionFactory) | |
| onWebSocketBinary | back to summary |
|---|---|
public void onWebSocketBinary(ByteBuffer byteBuffer, Callback callback)
| |
| onWebSocketClose | back to summary |
|---|---|
public void onWebSocketClose(int statusCode, String reason)
| |
| onWebSocketError | back to summary |
|---|---|
public void onWebSocketError(Throwable cause)
| |
| onWebSocketFrame | back to summary |
|---|---|
public void onWebSocketFrame(Frame frame, Callback callback)
| |
| onWebSocketOpen | back to summary |
|---|---|
public void onWebSocketOpen(Session session)
| |
| onWebSocketText | back to summary |
|---|---|
public void onWebSocketText(String message)
| |
| Modifier and Type | Class and Description |
|---|---|
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private final Callback | |
| private final DataBuffer |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ByteBuffer | asByteBuffer()
Implements org.
Deprecated
Expose this buffer's bytes as a |
| public ByteBuffer | asByteBuffer(int
the index at which to start the byte buffer index, int the length of the returned byte buffer length)Implements org.
Deprecated
Expose a subsequence of this buffer's bytes as a |
| public int | capacity()
Implements org. Return the number of bytes that this buffer can contain. |
| public DataBuffer | capacity(int
the new capacity capacity)Implements org.
Deprecated
Set the number of bytes that this buffer can contain. |
| public void | close()
Implements org. Closes this data buffer, freeing any resources. |
| public DataBuffer | ensureWritable(int
the writable capacity to check for capacity)Implements org. Ensure that the current buffer has enough |
| public DataBufferFactory | factory()
Implements org. Return the |
| public byte | getByte(int
the index at which the byte will be read index)Implements org. Read a single byte at the given index from this data buffer. |
| public int | indexOf(IntPredicate
the predicate to match predicate, int the index to start the search from fromIndex)Implements org. Return the index of the first byte in this buffer that matches the given predicate. |
| public int | lastIndexOf(IntPredicate
the predicate to match predicate, int the index to start the search from fromIndex)Implements org. Return the index of the last byte in this buffer that matches the given predicate. |
| public byte | read()
Implements org. Read a single byte from the current reading position from this data buffer. |
| public DataBuffer | read(byte[]
the array into which the bytes are to be written destination)Implements org. Read this buffer's data into the specified destination, starting at the current reading position of this buffer. |
| public DataBuffer | read(byte[]
the array into which the bytes are to be written destination, int the index within offset, int destination of the first byte to be writtenthe maximum number of bytes to be written in length)destinationImplements org. Read at most |
| public DataBuffer. | readableByteBuffers()
Implements org. Returns a closeable iterator over each |
| public int | readableByteCount()
Implements org. Return the number of bytes that can be read from this data buffer. |
| public int | readPosition()
Implements org. Return the position from which this buffer will read. |
| public DataBuffer | readPosition(int
the new read position readPosition)Implements org. Set the position from which this buffer will read. |
| public DataBuffer | slice(int
the index at which to start the slice index, int the length of the slice length)Implements org.
Deprecated
Create a new |
| public DataBuffer | split(int
the index at which it should be split index)Implements org. Splits this data buffer into two at the given index. |
| public ByteBuffer | toByteBuffer(int index, int length)
Implements org.
Deprecated
Returns a |
| public void | toByteBuffer(int
the position of this data buffer from where copying should start srcPos, ByteBuffer the destination byte buffer dest, int the position in destPos, int dest to where copying should startthe amount of data to copy length)Implements org. Copies the given length from this data buffer into the given destination
|
| public String | toString(int
the index at which to start the string index, int the number of bytes to use for the string length, Charset the charset to use charset)Implements org. Return a part of this buffer's data as a String using the specified charset. |
| public DataBuffer. | writableByteBuffers()
Implements org. Returns a closeable iterator over each |
| public int | writableByteCount()
Implements org. Return the number of bytes that can be written to this data buffer. |
| public DataBuffer | write(byte
the byte to be written b)Implements org. Write a single byte into this buffer at the current writing position. |
| public DataBuffer | write(byte[]
the bytes to be written into this buffer source)Implements org. Write the given source into this buffer, starting at the current writing position of this buffer. |
| public DataBuffer | write(byte[]
the bytes to be written into this buffer source, int the index within offset, int source to start writing fromthe maximum number of bytes to be written from length)sourceImplements org. Write at most |
| public DataBuffer | write(DataBuffer...
the byte buffers to write into this buffer buffers)Implements org. Write one or more |
| public DataBuffer | write(ByteBuffer...
the byte buffers to write into this buffer buffers)Implements org. Write one or more |
| public int | writePosition()
Implements org. Return the position to which this buffer will write. |
| public DataBuffer | writePosition(int
the new write position writePosition)Implements org. Set the position to which this buffer will write. |
| callback | back to summary |
|---|---|
| private final Callback callback | |
| delegate | back to summary |
|---|---|
| private final DataBuffer delegate | |
| JettyDataBuffer | back to summary |
|---|---|
| public JettyDataBuffer(DataBuffer delegate, Callback callback) | |
| asByteBuffer | back to summary |
|---|---|
| public ByteBuffer asByteBuffer() Implements org. Doc from org. Deprecated
Expose this buffer's bytes as a
| |
| asByteBuffer | back to summary |
|---|---|
| public ByteBuffer asByteBuffer(int index, int length) Implements org. Doc from org. Deprecated
Expose a subsequence of this buffer's bytes as a
| |
| capacity | back to summary |
|---|---|
| public int capacity() Implements org. Doc from org. Return the number of bytes that this buffer can contain.
| |
| capacity | back to summary |
|---|---|
| public DataBuffer capacity(int capacity) Implements org. Doc from org. Deprecated
Set the number of bytes that this buffer can contain. If the new capacity is lower than the current capacity, the contents of this buffer will be truncated. If the new capacity is higher than the current capacity, it will be expanded.
| |
| close | back to summary |
|---|---|
| public void close() Implements org. Doc from org. Closes this data buffer, freeing any resources.
| |
| ensureWritable | back to summary |
|---|---|
| public DataBuffer ensureWritable(int capacity) Implements org. Doc from org. Ensure that the current buffer has enough
| |
| factory | back to summary |
|---|---|
| public DataBufferFactory factory() Implements org. Doc from org. Return the
| |
| getByte | back to summary |
|---|---|
| public byte getByte(int index) Implements org. Doc from org. Read a single byte at the given index from this data buffer.
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(IntPredicate predicate, int fromIndex) Implements org. Doc from org. Return the index of the first byte in this buffer that matches the given predicate.
| |
| lastIndexOf | back to summary |
|---|---|
| public int lastIndexOf(IntPredicate predicate, int fromIndex) Implements org. Doc from org. Return the index of the last byte in this buffer that matches the given predicate.
| |
| read | back to summary |
|---|---|
| public byte read() Implements org. Doc from org. Read a single byte from the current reading position from this data buffer.
| |
| read | back to summary |
|---|---|
| public DataBuffer read(byte[] destination) Implements org. Doc from org. Read this buffer's data into the specified destination, starting at the current reading position of this buffer.
| |
| read | back to summary |
|---|---|
| public DataBuffer read(byte[] destination, int offset, int length) Implements org. Doc from org. Read at most
| |
| readableByteBuffers | back to summary |
|---|---|
| public DataBuffer. Implements org. Doc from org. Returns a closeable iterator over each Note that the returned iterator must be used in a try-with-resources clause or explicitly closed.
| |
| readableByteCount | back to summary |
|---|---|
| public int readableByteCount() Implements org. Doc from org. Return the number of bytes that can be read from this data buffer.
| |
| readPosition | back to summary |
|---|---|
| public int readPosition() Implements org. Doc from org. Return the position from which this buffer will read.
| |
| readPosition | back to summary |
|---|---|
| public DataBuffer readPosition(int readPosition) Implements org. Doc from org. Set the position from which this buffer will read.
| |
| slice | back to summary |
|---|---|
| public DataBuffer slice(int index, int length) Implements org. Doc from org. Deprecated
Create a new Note that this method will not call
| |
| split | back to summary |
|---|---|
| public DataBuffer split(int index) Implements org. Doc from org. Splits this data buffer into two at the given index. Data that precedes the The read and
write position of the returned buffer are
truncated to fit within the buffers capacity if
necessary. The positions of this buffer are set to
| |
| toByteBuffer | back to summary |
|---|---|
| public ByteBuffer toByteBuffer(int index, int length) Implements org. Doc from org. Deprecated
Returns a
| |
| toByteBuffer | back to summary |
|---|---|
| public void toByteBuffer(int srcPos, ByteBuffer dest, int destPos, int length) Implements org. Doc from org. Copies the given length from this data buffer into the given destination
| |
| toString | back to summary |
|---|---|
| public String toString(int index, int length, Charset charset) Implements org. Doc from org. Return a part of this buffer's data as a String using the specified charset. | |
| writableByteBuffers | back to summary |
|---|---|
| public DataBuffer. Implements org. Doc from org. Returns a closeable iterator over each Note that the returned iterator must be used in a try-with-resources clause or explicitly closed.
| |
| writableByteCount | back to summary |
|---|---|
| public int writableByteCount() Implements org. Doc from org. Return the number of bytes that can be written to this data buffer.
| |
| write | back to summary |
|---|---|
| public DataBuffer write(byte b) Implements org. Doc from org. Write a single byte into this buffer at the current writing position.
| |
| write | back to summary |
|---|---|
| public DataBuffer write(byte[] source) Implements org. Doc from org. Write the given source into this buffer, starting at the current writing position of this buffer.
| |
| write | back to summary |
|---|---|
| public DataBuffer write(byte[] source, int offset, int length) Implements org. Doc from org. Write at most
| |
| write | back to summary |
|---|---|
| public DataBuffer write(DataBuffer... buffers) Implements org. Doc from org. Write one or more
| |
| write | back to summary |
|---|---|
| public DataBuffer write(ByteBuffer... buffers) Implements org. Doc from org. Write one or more
| |
| writePosition | back to summary |
|---|---|
| public int writePosition() Implements org. Doc from org. Return the position to which this buffer will write.
| |
| writePosition | back to summary |
|---|---|
| public DataBuffer writePosition(int writePosition) Implements org. Doc from org. Set the position to which this buffer will write.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final DataBuffer. | delegate
Record Component accessed by delegate(). |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements org. Closes this stream and releases any system resources associated with it. |
| public DataBuffer. | |
| public final boolean | equals(Object
the reference object with which to compare. o)Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public boolean | |
| public ByteBuffer | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| delegate | back to summary |
|---|---|
| private final DataBuffer. Record Component accessed by delegate(). | |
| JettyByteBufferIterator | back to summary |
|---|---|
| private JettyByteBufferIterator(DataBuffer. | |
| close | back to summary |
|---|---|
| public void close() Implements org. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| delegate | back to summary |
|---|---|
| public DataBuffer. Record Component getter of delegate. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public ByteBuffer next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.
| |