Top Description Inners Fields Constructors Methods
org.springframework.web.reactive.socket.adapter

public Class JettyWebSocketHandlerAdapter

extends Object
Class Inheritance
Annotations
@org.eclipse.jetty.websocket.api.annotations.WebSocket
Imports
java.nio.ByteBuffer, java.nio.charset.Charset, .StandardCharsets, java.util.function.Function, .IntPredicate, org.eclipse.jetty.websocket.api.Callback, .Frame, .Session, org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose, .OnWebSocketError, .OnWebSocketFrame, .OnWebSocketMessage, .OnWebSocketOpen, .WebSocket, org.eclipse.jetty.websocket.core.OpCode, org.springframework.core.io.buffer.CloseableDataBuffer, .DataBuffer, .DataBufferFactory, org.springframework.lang.Nullable, org.springframework.util.Assert, org.springframework.web.reactive.socket.CloseStatus, .WebSocketHandler, .WebSocketMessage, .WebSocketMessage.Type

Jetty @WebSocket handler that delegates events to a reactive WebSocketHandler and its session.
Authors
Violeta Georgieva, Rossen Stoyanchev
Since
5.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final WebSocketHandler
private JettyWebSocketSession
private static final ByteBuffer
private final Function<Session, JettyWebSocketSession>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
onWebSocketBinary(ByteBuffer byteBuffer, Callback callback)

public void
onWebSocketClose(int statusCode, String reason)

public void
public void
onWebSocketFrame(Frame frame, Callback callback)

public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateHandlerback to summary
private final WebSocketHandler delegateHandler
delegateSessionback to summary
private JettyWebSocketSession delegateSession
Annotations
@Nullable
EMPTY_PAYLOADback to summary
private static final ByteBuffer EMPTY_PAYLOAD
sessionFactoryback to summary
private final Function<Session, JettyWebSocketSession> sessionFactory

Constructor Detail

JettyWebSocketHandlerAdapterback to summary
public JettyWebSocketHandlerAdapter(WebSocketHandler handler, Function<Session, JettyWebSocketSession> sessionFactory)

Method Detail

onWebSocketBinaryback to summary
public void onWebSocketBinary(ByteBuffer byteBuffer, Callback callback)
Annotations
@org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage
onWebSocketCloseback to summary
public void onWebSocketClose(int statusCode, String reason)
Annotations
@org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose
onWebSocketErrorback to summary
public void onWebSocketError(Throwable cause)
Annotations
@org.eclipse.jetty.websocket.api.annotations.OnWebSocketError
onWebSocketFrameback to summary
public void onWebSocketFrame(Frame frame, Callback callback)
Annotations
@org.eclipse.jetty.websocket.api.annotations.OnWebSocketFrame
onWebSocketOpenback to summary
public void onWebSocketOpen(Session session)
Annotations
@org.eclipse.jetty.websocket.api.annotations.OnWebSocketOpen
onWebSocketTextback to summary
public void onWebSocketText(String message)
Annotations
@org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage
org.springframework.web.reactive.socket.adapter back to summary

private final Class JettyWebSocketHandlerAdapter.JettyDataBuffer

extends Object
implements CloseableDataBuffer
Class Inheritance
  • java.lang.Object
  • org.springframework.web.reactive.socket.adapter.JettyWebSocketHandlerAdapter.JettyDataBuffer
All Implemented Interfaces
org.springframework.core.io.buffer.CloseableDataBuffer, java.lang.AutoCloseable, org.springframework.core.io.buffer.DataBuffer

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record

Field Summary

Modifier and TypeField and Description
private final Callback
private final DataBuffer

Constructor Summary

AccessConstructor and Description
public
JettyDataBuffer(DataBuffer delegate, Callback callback)

Method Summary

Modifier and TypeMethod and Description
public ByteBuffer
asByteBuffer()

Implements org.springframework.core.io.buffer.DataBuffer.asByteBuffer.

Deprecated

Expose this buffer's bytes as a ByteBuffer.

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.springframework.core.io.buffer.DataBuffer.asByteBuffer.

Deprecated

Expose a subsequence of this buffer's bytes as a ByteBuffer.

public int
capacity()

Implements org.springframework.core.io.buffer.DataBuffer.capacity.

Return the number of bytes that this buffer can contain.

public DataBuffer
capacity(int
the new capacity
capacity
)

Implements org.springframework.core.io.buffer.DataBuffer.capacity.

Deprecated

Set the number of bytes that this buffer can contain.

public void
close()

Implements org.springframework.core.io.buffer.CloseableDataBuffer.close.

Closes this data buffer, freeing any resources.

public DataBuffer
ensureWritable(int
the writable capacity to check for
capacity
)

Implements org.springframework.core.io.buffer.DataBuffer.ensureWritable.

Ensure that the current buffer has enough writableByteCount() to write the amount of data given as an argument.

public DataBufferFactory
factory()

Implements org.springframework.core.io.buffer.DataBuffer.factory.

Return the DataBufferFactory that created this buffer.

public byte
getByte(int
the index at which the byte will be read
index
)

Implements org.springframework.core.io.buffer.DataBuffer.getByte.

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.springframework.core.io.buffer.DataBuffer.indexOf.

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.springframework.core.io.buffer.DataBuffer.lastIndexOf.

Return the index of the last byte in this buffer that matches the given predicate.

public byte
read()

Implements org.springframework.core.io.buffer.DataBuffer.read.

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.springframework.core.io.buffer.DataBuffer.read.

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 destination of the first byte to be written
offset
,
int
the maximum number of bytes to be written in destination
length
)

Implements org.springframework.core.io.buffer.DataBuffer.read.

Read at most length bytes of this buffer into the specified destination, starting at the current reading position of this buffer.

public DataBuffer.ByteBufferIterator
readableByteBuffers()

Implements org.springframework.core.io.buffer.DataBuffer.readableByteBuffers.

Returns a closeable iterator over each ByteBuffer in this data buffer that can be read.

public int
readableByteCount()

Implements org.springframework.core.io.buffer.DataBuffer.readableByteCount.

Return the number of bytes that can be read from this data buffer.

public int
readPosition()

Implements org.springframework.core.io.buffer.DataBuffer.readPosition.

Return the position from which this buffer will read.

public DataBuffer
readPosition(int
the new read position
readPosition
)

Implements org.springframework.core.io.buffer.DataBuffer.readPosition.

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.springframework.core.io.buffer.DataBuffer.slice.

Deprecated

Create a new DataBuffer whose contents is a shared subsequence of this data buffer's content.

public DataBuffer
split(int
the index at which it should be split
index
)

Implements org.springframework.core.io.buffer.DataBuffer.split.

Splits this data buffer into two at the given index.

public ByteBuffer
toByteBuffer(int index, int length)

Implements org.springframework.core.io.buffer.DataBuffer.toByteBuffer.

Deprecated

Returns a ByteBuffer representation of a subsequence of this buffer's bytes.

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 dest to where copying should start
destPos
,
int
the amount of data to copy
length
)

Implements org.springframework.core.io.buffer.DataBuffer.toByteBuffer.

Copies the given length from this data buffer into the given destination ByteBuffer, beginning at the given source position, and the given destination position in the destination byte buffer.

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.springframework.core.io.buffer.DataBuffer.toString.

Return a part of this buffer's data as a String using the specified charset.

public DataBuffer.ByteBufferIterator
writableByteBuffers()

Implements org.springframework.core.io.buffer.DataBuffer.writableByteBuffers.

Returns a closeable iterator over each ByteBuffer in this data buffer that can be written to.

public int
writableByteCount()

Implements org.springframework.core.io.buffer.DataBuffer.writableByteCount.

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.springframework.core.io.buffer.DataBuffer.write.

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.springframework.core.io.buffer.DataBuffer.write.

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 source to start writing from
offset
,
int
the maximum number of bytes to be written from source
length
)

Implements org.springframework.core.io.buffer.DataBuffer.write.

Write at most length bytes of the given source into this buffer, starting at the current writing position of this buffer.

public DataBuffer
write(DataBuffer...
the byte buffers to write into this buffer
buffers
)

Implements org.springframework.core.io.buffer.DataBuffer.write.

Write one or more DataBuffers to this buffer, starting at the current writing position.

public DataBuffer
write(ByteBuffer...
the byte buffers to write into this buffer
buffers
)

Implements org.springframework.core.io.buffer.DataBuffer.write.

Write one or more ByteBuffer to this buffer, starting at the current writing position.

public int
writePosition()

Implements org.springframework.core.io.buffer.DataBuffer.writePosition.

Return the position to which this buffer will write.

public DataBuffer
writePosition(int
the new write position
writePosition
)

Implements org.springframework.core.io.buffer.DataBuffer.writePosition.

Set the position to which this buffer will write.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callbackback to summary
private final Callback callback
delegateback to summary
private final DataBuffer delegate

Constructor Detail

JettyDataBufferback to summary
public JettyDataBuffer(DataBuffer delegate, Callback callback)

Method Detail

asByteBufferback to summary
public ByteBuffer asByteBuffer()

Implements org.springframework.core.io.buffer.DataBuffer.asByteBuffer.

Doc from org.springframework.core.io.buffer.DataBuffer.asByteBuffer.

Deprecated

Expose this buffer's bytes as a ByteBuffer. Data between this DataBuffer and the returned ByteBuffer is shared; though changes in the returned buffer's position will not be reflected in the reading nor writing position of this data buffer.

Returns:ByteBuffer

this data buffer as a byte buffer

Annotations
@Override
@Deprecated
asByteBufferback to summary
public ByteBuffer asByteBuffer(int index, int length)

Implements org.springframework.core.io.buffer.DataBuffer.asByteBuffer.

Doc from org.springframework.core.io.buffer.DataBuffer.asByteBuffer.

Deprecated

Expose a subsequence of this buffer's bytes as a ByteBuffer. Data between this DataBuffer and the returned ByteBuffer is shared; though changes in the returned buffer's position will not be reflected in the reading nor writing position of this data buffer.

Parameters
index:int

the index at which to start the byte buffer

length:int

the length of the returned byte buffer

Returns:ByteBuffer

this data buffer as a byte buffer

Annotations
@Override
@Deprecated
capacityback to summary
public int capacity()

Implements org.springframework.core.io.buffer.DataBuffer.capacity.

Doc from org.springframework.core.io.buffer.DataBuffer.capacity.

Return the number of bytes that this buffer can contain.

Returns:int

the capacity

Annotations
@Override
capacityback to summary
public DataBuffer capacity(int capacity)

Implements org.springframework.core.io.buffer.DataBuffer.capacity.

Doc from org.springframework.core.io.buffer.DataBuffer.capacity.

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.

Parameters
capacity:int

the new capacity

Returns:DataBuffer

this buffer

Annotations
@Override
@Deprecated
closeback to summary
public void close()

Implements org.springframework.core.io.buffer.CloseableDataBuffer.close.

Doc from org.springframework.core.io.buffer.CloseableDataBuffer.close.

Closes this data buffer, freeing any resources.

Annotations
@Override
ensureWritableback to summary
public DataBuffer ensureWritable(int capacity)

Implements org.springframework.core.io.buffer.DataBuffer.ensureWritable.

Doc from org.springframework.core.io.buffer.DataBuffer.ensureWritable.

Ensure that the current buffer has enough writableByteCount() to write the amount of data given as an argument. If not, the missing capacity will be added to the buffer.

Parameters
capacity:int

the writable capacity to check for

Returns:DataBuffer

this buffer

Annotations
@Override
factoryback to summary
public DataBufferFactory factory()

Implements org.springframework.core.io.buffer.DataBuffer.factory.

Doc from org.springframework.core.io.buffer.DataBuffer.factory.

Return the DataBufferFactory that created this buffer.

Returns:DataBufferFactory

the creating buffer factory

Annotations
@Override
getByteback to summary
public byte getByte(int index)

Implements org.springframework.core.io.buffer.DataBuffer.getByte.

Doc from org.springframework.core.io.buffer.DataBuffer.getByte.

Read a single byte at the given index from this data buffer.

Parameters
index:int

the index at which the byte will be read

Returns:byte

the byte at the given index

Annotations
@Override
indexOfback to summary
public int indexOf(IntPredicate predicate, int fromIndex)

Implements org.springframework.core.io.buffer.DataBuffer.indexOf.

Doc from org.springframework.core.io.buffer.DataBuffer.indexOf.

Return the index of the first byte in this buffer that matches the given predicate.

Parameters
predicate:IntPredicate

the predicate to match

fromIndex:int

the index to start the search from

Returns:int

the index of the first byte that matches predicate; or -1 if none match

Annotations
@Override
lastIndexOfback to summary
public int lastIndexOf(IntPredicate predicate, int fromIndex)

Implements org.springframework.core.io.buffer.DataBuffer.lastIndexOf.

Doc from org.springframework.core.io.buffer.DataBuffer.lastIndexOf.

Return the index of the last byte in this buffer that matches the given predicate.

Parameters
predicate:IntPredicate

the predicate to match

fromIndex:int

the index to start the search from

Returns:int

the index of the last byte that matches predicate; or -1 if none match

Annotations
@Override
readback to summary
public byte read()

Implements org.springframework.core.io.buffer.DataBuffer.read.

Doc from org.springframework.core.io.buffer.DataBuffer.read.

Read a single byte from the current reading position from this data buffer.

Returns:byte

the byte at this buffer's current reading position

Annotations
@Override
readback to summary
public DataBuffer read(byte[] destination)

Implements org.springframework.core.io.buffer.DataBuffer.read.

Doc from org.springframework.core.io.buffer.DataBuffer.read.

Read this buffer's data into the specified destination, starting at the current reading position of this buffer.

Parameters
destination:byte[]

the array into which the bytes are to be written

Returns:DataBuffer

this buffer

Annotations
@Override
readback to summary
public DataBuffer read(byte[] destination, int offset, int length)

Implements org.springframework.core.io.buffer.DataBuffer.read.

Doc from org.springframework.core.io.buffer.DataBuffer.read.

Read at most length bytes of this buffer into the specified destination, starting at the current reading position of this buffer.

Parameters
destination:byte[]

the array into which the bytes are to be written

offset:int

the index within destination of the first byte to be written

length:int

the maximum number of bytes to be written in destination

Returns:DataBuffer

this buffer

Annotations
@Override
readableByteBuffersback to summary
public DataBuffer.ByteBufferIterator readableByteBuffers()

Implements org.springframework.core.io.buffer.DataBuffer.readableByteBuffers.

Doc from org.springframework.core.io.buffer.DataBuffer.readableByteBuffers.

Returns a closeable iterator over each ByteBuffer in this data buffer that can be read. Calling this method is more efficient than toByteBuffer(), as no data is copied. However, the byte buffers provided can only be used during the iteration.

Note

that the returned iterator must be used in a try-with-resources clause or explicitly closed.

Returns:DataBuffer.ByteBufferIterator

a closeable iterator over the readable byte buffers contained in this data buffer

Annotations
@Override
readableByteCountback to summary
public int readableByteCount()

Implements org.springframework.core.io.buffer.DataBuffer.readableByteCount.

Doc from org.springframework.core.io.buffer.DataBuffer.readableByteCount.

Return the number of bytes that can be read from this data buffer.

Returns:int

the readable byte count

Annotations
@Override
readPositionback to summary
public int readPosition()

Implements org.springframework.core.io.buffer.DataBuffer.readPosition.

Doc from org.springframework.core.io.buffer.DataBuffer.readPosition.

Return the position from which this buffer will read.

Returns:int

the read position

Annotations
@Override
readPositionback to summary
public DataBuffer readPosition(int readPosition)

Implements org.springframework.core.io.buffer.DataBuffer.readPosition.

Doc from org.springframework.core.io.buffer.DataBuffer.readPosition.

Set the position from which this buffer will read.

Parameters
readPosition:int

the new read position

Returns:DataBuffer

this buffer

Annotations
@Override
sliceback to summary
public DataBuffer slice(int index, int length)

Implements org.springframework.core.io.buffer.DataBuffer.slice.

Doc from org.springframework.core.io.buffer.DataBuffer.slice.

Deprecated

Create a new DataBuffer whose contents is a shared subsequence of this data buffer's content. Data between this data buffer and the returned buffer is shared; though changes in the returned buffer's position will not be reflected in the reading nor writing position of this data buffer.

Note

that this method will not call DataBufferUtils#retain(DataBuffer) on the resulting slice: the reference count will not be increased.

Parameters
index:int

the index at which to start the slice

length:int

the length of the slice

Returns:DataBuffer

the specified slice of this data buffer

Annotations
@Override
@Deprecated
splitback to summary
public DataBuffer split(int index)

Implements org.springframework.core.io.buffer.DataBuffer.split.

Doc from org.springframework.core.io.buffer.DataBuffer.split.

Splits this data buffer into two at the given index.

Data that precedes the index will be returned in a new buffer, while this buffer will contain data that follows after index. Memory between the two buffers is shared, but independent and cannot overlap (unlike slice).

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 0 if they are smaller than index.

Parameters
index:int

the index at which it should be split

Returns:DataBuffer

a new data buffer, containing the bytes from index 0 to index

Annotations
@Override
toByteBufferback to summary
public ByteBuffer toByteBuffer(int index, int length)

Implements org.springframework.core.io.buffer.DataBuffer.toByteBuffer.

Doc from org.springframework.core.io.buffer.DataBuffer.toByteBuffer.

Deprecated

Returns a ByteBuffer representation of a subsequence of this buffer's bytes. Data between this DataBuffer and the returned ByteBuffer is not shared.

Returns:ByteBuffer

this data buffer as a byte buffer

Annotations
@Override
@Deprecated
toByteBufferback to summary
public void toByteBuffer(int srcPos, ByteBuffer dest, int destPos, int length)

Implements org.springframework.core.io.buffer.DataBuffer.toByteBuffer.

Doc from org.springframework.core.io.buffer.DataBuffer.toByteBuffer.

Copies the given length from this data buffer into the given destination ByteBuffer, beginning at the given source position, and the given destination position in the destination byte buffer.

Parameters
srcPos:int

the position of this data buffer from where copying should start

dest:ByteBuffer

the destination byte buffer

destPos:int

the position in dest to where copying should start

length:int

the amount of data to copy

Annotations
@Override
toStringback to summary
public String toString(int index, int length, Charset charset)

Implements org.springframework.core.io.buffer.DataBuffer.toString.

Doc from org.springframework.core.io.buffer.DataBuffer.toString.

Return a part of this buffer's data as a String using the specified charset.

Parameters
index:int

the index at which to start the string

length:int

the number of bytes to use for the string

charset:Charset

the charset to use

Returns:String

a string representation of a part of this buffers data

Annotations
@Override
writableByteBuffersback to summary
public DataBuffer.ByteBufferIterator writableByteBuffers()

Implements org.springframework.core.io.buffer.DataBuffer.writableByteBuffers.

Doc from org.springframework.core.io.buffer.DataBuffer.writableByteBuffers.

Returns a closeable iterator over each ByteBuffer in this data buffer that can be written to. The byte buffers provided can only be used during the iteration.

Note

that the returned iterator must be used in a try-with-resources clause or explicitly closed.

Returns:DataBuffer.ByteBufferIterator

a closeable iterator over the writable byte buffers contained in this data buffer

Annotations
@Override
writableByteCountback to summary
public int writableByteCount()

Implements org.springframework.core.io.buffer.DataBuffer.writableByteCount.

Doc from org.springframework.core.io.buffer.DataBuffer.writableByteCount.

Return the number of bytes that can be written to this data buffer.

Returns:int

the writable byte count

Annotations
@Override
writeback to summary
public DataBuffer write(byte b)

Implements org.springframework.core.io.buffer.DataBuffer.write.

Doc from org.springframework.core.io.buffer.DataBuffer.write.

Write a single byte into this buffer at the current writing position.

Parameters
b:byte

the byte to be written

Returns:DataBuffer

this buffer

Annotations
@Override
writeback to summary
public DataBuffer write(byte[] source)

Implements org.springframework.core.io.buffer.DataBuffer.write.

Doc from org.springframework.core.io.buffer.DataBuffer.write.

Write the given source into this buffer, starting at the current writing position of this buffer.

Parameters
source:byte[]

the bytes to be written into this buffer

Returns:DataBuffer

this buffer

Annotations
@Override
writeback to summary
public DataBuffer write(byte[] source, int offset, int length)

Implements org.springframework.core.io.buffer.DataBuffer.write.

Doc from org.springframework.core.io.buffer.DataBuffer.write.

Write at most length bytes of the given source into this buffer, starting at the current writing position of this buffer.

Parameters
source:byte[]

the bytes to be written into this buffer

offset:int

the index within source to start writing from

length:int

the maximum number of bytes to be written from source

Returns:DataBuffer

this buffer

Annotations
@Override
writeback to summary
public DataBuffer write(DataBuffer... buffers)

Implements org.springframework.core.io.buffer.DataBuffer.write.

Doc from org.springframework.core.io.buffer.DataBuffer.write.

Write one or more DataBuffers to this buffer, starting at the current writing position. It is the responsibility of the caller to release the given data buffers.

Parameters
buffers:DataBuffer[]

the byte buffers to write into this buffer

Returns:DataBuffer

this buffer

Annotations
@Override
writeback to summary
public DataBuffer write(ByteBuffer... buffers)

Implements org.springframework.core.io.buffer.DataBuffer.write.

Doc from org.springframework.core.io.buffer.DataBuffer.write.

Write one or more ByteBuffer to this buffer, starting at the current writing position.

Parameters
buffers:ByteBuffer[]

the byte buffers to write into this buffer

Returns:DataBuffer

this buffer

Annotations
@Override
writePositionback to summary
public int writePosition()

Implements org.springframework.core.io.buffer.DataBuffer.writePosition.

Doc from org.springframework.core.io.buffer.DataBuffer.writePosition.

Return the position to which this buffer will write.

Returns:int

the write position

Annotations
@Override
writePositionback to summary
public DataBuffer writePosition(int writePosition)

Implements org.springframework.core.io.buffer.DataBuffer.writePosition.

Doc from org.springframework.core.io.buffer.DataBuffer.writePosition.

Set the position to which this buffer will write.

Parameters
writePosition:int

the new write position

Returns:DataBuffer

this buffer

Annotations
@Override
org.springframework.web.reactive.socket.adapter back to summary

private final Record JettyWebSocketHandlerAdapter.JettyDataBuffer.JettyByteBufferIterator

extends Record
implements ByteBufferIterator
Class Inheritance
All Implemented Interfaces
org.springframework.core.io.buffer.DataBuffer.ByteBufferIterator, java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator
Record Components
delegate:DataBuffer.ByteBufferIterator 

Field Summary

Modifier and TypeField and Description
private final DataBuffer.ByteBufferIterator
delegate

Record Component accessed by delegate().

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements org.springframework.core.io.buffer.DataBuffer.ByteBufferIterator.close.

Closes this stream and releases any system resources associated with it.

public DataBuffer.ByteBufferIterator
delegate()

Record Component getter of delegate.

public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public ByteBuffer
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

delegateback to summary
private final DataBuffer.ByteBufferIterator delegate

Record Component accessed by delegate().

Constructor Detail

JettyByteBufferIteratorback to summary
private JettyByteBufferIterator(DataBuffer.ByteBufferIterator delegate)

Method Detail

closeback to summary
public void close()

Implements org.springframework.core.io.buffer.DataBuffer.ByteBufferIterator.close.

Doc from java.io.Closeable.close.

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 AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
delegateback to summary
public DataBuffer.ByteBufferIterator delegate()

Record Component getter of delegate.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public ByteBuffer next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:ByteBuffer

the next element in the iteration

Annotations
@Override
toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

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.

Returns:String

a string representation of the object.