Top Description Fields Constructors Methods
io.rsocket.transport.netty.server

public final Class CloseableChannel

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
io.rsocket.Closeable, reactor.core.Disposable
Imports
io.rsocket.Closeable, java.lang.reflect.Method, java.net.InetSocketAddress, java.util.Objects, reactor.core.publisher.Mono, reactor.netty.DisposableChannel

An implementation of Closeable that wraps a DisposableChannel, enabling close-ability and exposing the DisposableChannel's address.

Field Summary

Modifier and TypeField and Description
private final DisposableChannel
private static final Method
channelAddressMethod

For forward compatibility: remove when RSocket compiles against Reactor 1.0.

Constructor Summary

AccessConstructor and Description
pack-priv
CloseableChannel(DisposableChannel
the DisposableChannel to wrap
channel
)

Creates a new instance

Method Summary

Modifier and TypeMethod and Description
public InetSocketAddress

Returns:

local InetSocketAddress
address
()

Return local server selector channel address.

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.
public Mono<Void>
onClose()

Implements io.rsocket.Closeable.onClose.

Returns a Mono that terminates when the instance is terminated by any reason.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

channelback to summary
private final DisposableChannel channel
channelAddressMethodback to summary
private static final Method channelAddressMethod

For forward compatibility: remove when RSocket compiles against Reactor 1.0.

Constructor Detail

CloseableChannelback to summary
pack-priv CloseableChannel(DisposableChannel channel)

Creates a new instance

Parameters
channel:DisposableChannel

the DisposableChannel to wrap

Exceptions
NullPointerException:
if context is null

Method Detail

addressback to summary
public InetSocketAddress address()

Return local server selector channel address.

Returns:InetSocketAddress

local InetSocketAddress

See Also
DisposableChannel#address()
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
onCloseback to summary
public Mono<Void> onClose()

Implements io.rsocket.Closeable.onClose.

Doc from io.rsocket.Closeable.onClose.

Returns a Mono that terminates when the instance is terminated by any reason. Note, in case of error termination, the cause of error will be propagated as an error signal through org.reactivestreams.Subscriber#onError(Throwable). Otherwise, Subscriber#onComplete() will be called.

Returns:Mono<Void>

a Mono to track completion with success or error of the underlying resource. When the underlying resource is an `RSocket`, the Mono exposes stream 0 (i.e. connection level) errors.

Annotations
@Override