Top Fields Constructors Methods
io.rsocket.core

pack-priv Class RequesterResponderSupport

extends Object
Class Inheritance
Known Direct Subclasses
io.rsocket.core.RSocketRequester, io.rsocket.core.RSocketResponder
Imports
io.netty.buffer.ByteBufAllocator, io.netty.util.collection.IntObjectHashMap, .IntObjectMap, io.rsocket.DuplexConnection, .RSocket, io.rsocket.frame.decoder.PayloadDecoder, io.rsocket.plugins.RequestInterceptor, java.util.Objects, java.util.function.Function, reactor.util.annotation.Nullable

Field Summary

Modifier and TypeField and Description
pack-priv final IntObjectMap<FrameHandler>
private final ByteBufAllocator
private final DuplexConnection
private final int
private final int
private final int
private final PayloadDecoder
private final RequestInterceptor
pack-priv final StreamIdSupplier

Constructor Summary

AccessConstructor and Description
public
RequesterResponderSupport(int mtu, int maxFrameLength, int maxInboundPayloadSize, PayloadDecoder payloadDecoder, DuplexConnection connection, StreamIdSupplier streamIdSupplier, Function<RSocket, ? extends RequestInterceptor> requestInterceptorFunction)

Method Summary

Modifier and TypeMethod and Description
public synchronized boolean
add(int streamId, FrameHandler frameHandler)

public int

Returns:

issued streamId
addAndGetNextStreamId
(FrameHandler
to store
frameHandler
)

Adds frameHandler and returns issued streamId back

public synchronized FrameHandler

Returns:

FrameHandler or null
get
(int
used to resolve FrameHandler
streamId
)

Resolves FrameHandler by streamId

public ByteBufAllocator
public DuplexConnection
public int
public int
public int
public int

Returns:

issued streamId
getNextStreamId
()

Issues next streamId

public PayloadDecoder
public RequesterLeaseTracker
public RequestInterceptor
public synchronized boolean

Returns:

true if there is FrameHandler for the given streamId and the instance equals to the passed one
remove
(int
to lookup for FrameHandler
streamId
,
FrameHandler
instance to check with the found one
frameHandler
)

Removes FrameHandler if it is present and equals to the given one

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

activeStreamsback to summary
pack-priv final IntObjectMap<FrameHandler> activeStreams
allocatorback to summary
private final ByteBufAllocator allocator
connectionback to summary
private final DuplexConnection connection
maxFrameLengthback to summary
private final int maxFrameLength
maxInboundPayloadSizeback to summary
private final int maxInboundPayloadSize
mtuback to summary
private final int mtu
payloadDecoderback to summary
private final PayloadDecoder payloadDecoder
requestInterceptorback to summary
private final RequestInterceptor requestInterceptor
Annotations
@Nullable
streamIdSupplierback to summary
pack-priv final StreamIdSupplier streamIdSupplier
Annotations
@Nullable

Constructor Detail

RequesterResponderSupportback to summary
public RequesterResponderSupport(int mtu, int maxFrameLength, int maxInboundPayloadSize, PayloadDecoder payloadDecoder, DuplexConnection connection, StreamIdSupplier streamIdSupplier, Function<RSocket, ? extends RequestInterceptor> requestInterceptorFunction)

Method Detail

addback to summary
public synchronized boolean add(int streamId, FrameHandler frameHandler)
addAndGetNextStreamIdback to summary
public int addAndGetNextStreamId(FrameHandler frameHandler)

Adds frameHandler and returns issued streamId back

Parameters
frameHandler:FrameHandler

to store

Returns:int

issued streamId

Exceptions
RuntimeException:
if the RequesterResponderSupport is terminated for any reason
getback to summary
public synchronized FrameHandler get(int streamId)

Resolves FrameHandler by streamId

Parameters
streamId:int

used to resolve FrameHandler

Returns:FrameHandler

FrameHandler or null

Annotations
@Nullable
getAllocatorback to summary
public ByteBufAllocator getAllocator()
getDuplexConnectionback to summary
public DuplexConnection getDuplexConnection()
getMaxFrameLengthback to summary
public int getMaxFrameLength()
getMaxInboundPayloadSizeback to summary
public int getMaxInboundPayloadSize()
getMtuback to summary
public int getMtu()
getNextStreamIdback to summary
public int getNextStreamId()

Issues next streamId

Returns:int

issued streamId

Exceptions
RuntimeException:
if the RequesterResponderSupport is terminated for any reason
getPayloadDecoderback to summary
public PayloadDecoder getPayloadDecoder()
getRequesterLeaseTrackerback to summary
public RequesterLeaseTracker getRequesterLeaseTracker()
Annotations
@Nullable
getRequestInterceptorback to summary
public RequestInterceptor getRequestInterceptor()
Annotations
@Nullable
removeback to summary
public synchronized boolean remove(int streamId, FrameHandler frameHandler)

Removes FrameHandler if it is present and equals to the given one

Parameters
streamId:int

to lookup for FrameHandler

frameHandler:FrameHandler

instance to check with the found one

Returns:boolean

true if there is FrameHandler for the given streamId and the instance equals to the passed one