Top Inners Fields Constructors Methods
io.rsocket.keepalive

public abstract Class KeepAliveSupport

extends Object
implements KeepAliveFramesAcceptor
Class Inheritance
All Implemented Interfaces
io.rsocket.keepalive.KeepAliveFramesAcceptor, reactor.core.Disposable
Known Direct Subclasses
io.rsocket.keepalive.KeepAliveSupport.ClientKeepAliveSupport
Imports
io.netty.buffer.ByteBuf, .ByteBufAllocator, .Unpooled, io.rsocket.frame.KeepAliveFrameCodec, io.rsocket.resume.ResumeStateHolder, java.time.Duration, java.util.concurrent.TimeUnit, java.util.concurrent.atomic.AtomicIntegerFieldUpdater, java.util.function.Consumer, reactor.core.Disposable, reactor.core.publisher.Flux, reactor.core.scheduler.Scheduler, .Schedulers

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Field Summary

Modifier and TypeField and Description
pack-priv final ByteBufAllocator
pack-priv static final int
pack-priv final Duration
pack-priv final Duration
pack-priv final long
pack-priv volatile long
pack-priv volatile Consumer<ByteBuf>
pack-priv volatile Consumer<KeepAliveSupport.KeepAlive>
pack-priv volatile ResumeStateHolder
pack-priv final Scheduler
pack-priv static final int
pack-priv static final int
pack-priv volatile int
pack-priv static final AtomicIntegerFieldUpdater<KeepAliveSupport>
pack-priv static final int
pack-priv Disposable

Constructor Summary

AccessConstructor and Description
private
KeepAliveSupport(ByteBufAllocator allocator, int keepAliveInterval, int keepAliveTimeout)

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Implements reactor.core.Disposable.dispose.

Cancel or dispose the underlying task or resource.
public boolean
isDisposed()

Overrides default reactor.core.Disposable.isDisposed.

Optionally return true when the resource or task is disposed.
pack-priv long
pack-priv abstract void
public KeepAliveSupport
public KeepAliveSupport
public void
public KeepAliveSupport
resumeState(ResumeStateHolder resumeStateHolder)

pack-priv void
send(ByteBuf frame)

public KeepAliveSupport
public void
stop()

pack-priv void
terminate(int terminationState)

pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allocatorback to summary
pack-priv final ByteBufAllocator allocator
DISPOSED_STATEback to summary
pack-priv static final int DISPOSED_STATE
keepAliveIntervalback to summary
pack-priv final Duration keepAliveInterval
keepAliveTimeoutback to summary
pack-priv final Duration keepAliveTimeout
keepAliveTimeoutMillisback to summary
pack-priv final long keepAliveTimeoutMillis
lastReceivedMillisback to summary
pack-priv volatile long lastReceivedMillis
onFrameSentback to summary
pack-priv volatile Consumer<ByteBuf> onFrameSent
onTimeoutback to summary
pack-priv volatile Consumer<KeepAliveSupport.KeepAlive> onTimeout
resumeStateHolderback to summary
pack-priv volatile ResumeStateHolder resumeStateHolder
schedulerback to summary
pack-priv final Scheduler scheduler
STARTED_STATEback to summary
pack-priv static final int STARTED_STATE
STARTING_STATEback to summary
pack-priv static final int STARTING_STATE
stateback to summary
pack-priv volatile int state
STATEback to summary
pack-priv static final AtomicIntegerFieldUpdater<KeepAliveSupport> STATE
STOPPED_STATEback to summary
pack-priv static final int STOPPED_STATE
ticksDisposableback to summary
pack-priv Disposable ticksDisposable

Constructor Detail

KeepAliveSupportback to summary
private KeepAliveSupport(ByteBufAllocator allocator, int keepAliveInterval, int keepAliveTimeout)

Method Detail

disposeback to summary
public void dispose()

Implements reactor.core.Disposable.dispose.

Doc from reactor.core.Disposable.dispose.

Cancel or dispose the underlying task or resource.

Implementations are required to make this method idempotent.

Annotations
@Override
isDisposedback to summary
public boolean isDisposed()

Overrides default reactor.core.Disposable.isDisposed.

Doc from reactor.core.Disposable.isDisposed.

Optionally return true when the resource or task is disposed.

Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.

Returns:boolean

true when there's a guarantee the resource or task is disposed.

Annotations
@Override
localLastReceivedPositionback to summary
pack-priv long localLastReceivedPosition()
onIntervalTickback to summary
pack-priv abstract void onIntervalTick()
onSendKeepAliveFrameback to summary
public KeepAliveSupport onSendKeepAliveFrame(Consumer<ByteBuf> onFrameSent)
onTimeoutback to summary
public KeepAliveSupport onTimeout(Consumer<KeepAliveSupport.KeepAlive> onTimeout)
receiveback to summary
public void receive(ByteBuf keepAliveFrame)

Implements io.rsocket.keepalive.KeepAliveFramesAcceptor.receive.

Annotations
@Override
resumeStateback to summary
public KeepAliveSupport resumeState(ResumeStateHolder resumeStateHolder)
sendback to summary
pack-priv void send(ByteBuf frame)
startback to summary
public KeepAliveSupport start()
stopback to summary
public void stop()
terminateback to summary
pack-priv void terminate(int terminationState)
tryTimeoutback to summary
pack-priv void tryTimeout()
io.rsocket.keepalive back to summary

public final Class KeepAliveSupport.ClientKeepAliveSupport

extends KeepAliveSupport
Class Inheritance

Field Summary

Inherited from io.rsocket.keepalive.KeepAliveSupport:
allocatorDISPOSED_STATEkeepAliveIntervalkeepAliveTimeoutkeepAliveTimeoutMillislastReceivedMillisonFrameSentonTimeoutresumeStateHolderschedulerSTARTED_STATESTARTING_STATEstateSTATESTOPPED_STATEticksDisposable

Constructor Summary

AccessConstructor and Description
public
ClientKeepAliveSupport(ByteBufAllocator allocator, int keepAliveInterval, int keepAliveTimeout)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
Inherited from io.rsocket.keepalive.KeepAliveSupport:
disposeisDisposedlocalLastReceivedPositiononSendKeepAliveFrameonTimeoutreceiveresumeStatesendstartstopterminatetryTimeout

Constructor Detail

ClientKeepAliveSupportback to summary
public ClientKeepAliveSupport(ByteBufAllocator allocator, int keepAliveInterval, int keepAliveTimeout)

Method Detail

onIntervalTickback to summary
pack-priv void onIntervalTick()

Implements abstract io.rsocket.keepalive.KeepAliveSupport.onIntervalTick.

Annotations
@Override
io.rsocket.keepalive back to summary

public final Class KeepAliveSupport.KeepAlive

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Duration
private final Duration

Constructor Summary

AccessConstructor and Description
public
KeepAlive(Duration tickPeriod, Duration timeoutMillis)

Method Summary

Modifier and TypeMethod and Description
public Duration
public Duration
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

tickPeriodback to summary
private final Duration tickPeriod
timeoutMillisback to summary
private final Duration timeoutMillis

Constructor Detail

KeepAliveback to summary
public KeepAlive(Duration tickPeriod, Duration timeoutMillis)

Method Detail

getTickPeriodback to summary
public Duration getTickPeriod()
getTimeoutback to summary
public Duration getTimeout()