Top Description Fields Constructors Methods
io.rsocket.plugins

public Class InterceptorRegistry

extends Object
Class Inheritance
Known Direct Subclasses
io.rsocket.plugins.InitializingInterceptorRegistry
Imports
io.rsocket.RSocket, java.util.ArrayList, .List, java.util.function.Consumer, .Function

Provides support for registering interceptors at the following levels:

Field Summary

Modifier and TypeField and Description
private List<DuplexConnectionInterceptor>
private List<Function<RSocket, ? extends RequestInterceptor>>
private List<RSocketInterceptor>
private List<Function<RSocket, ? extends RequestInterceptor>>
private List<RSocketInterceptor>
private List<SocketAcceptorInterceptor>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public InterceptorRegistry
public InterceptorRegistry
forConnection(Consumer<List<DuplexConnectionInterceptor>> consumer)

Variant of forConnection(DuplexConnectionInterceptor) with access to the list of existing registrations.

public InterceptorRegistry
forRequester(RSocketInterceptor interceptor)

Add an RSocketInterceptor that will decorate the RSocket used for performing requests.

public InterceptorRegistry
forRequester(Consumer<List<RSocketInterceptor>> consumer)

Variant of forRequester(RSocketInterceptor) with access to the list of existing registrations.

public InterceptorRegistry
forRequestsInRequester(Function<RSocket, ? extends RequestInterceptor>
a function which accepts an RSocket and returns a new RequestInterceptor
interceptor
)

Add an RequestInterceptor that will hook into Requester RSocket requests' phases.

public InterceptorRegistry
forRequestsInResponder(Function<RSocket, ? extends RequestInterceptor>
a function which accepts an RSocket and returns a new RequestInterceptor
interceptor
)

Add an RequestInterceptor that will hook into Requester RSocket requests' phases.

public InterceptorRegistry
forResponder(RSocketInterceptor interceptor)

Add an RSocketInterceptor that will decorate the RSocket used for resonding to requests.

public InterceptorRegistry
forResponder(Consumer<List<RSocketInterceptor>> consumer)

Variant of forResponder(RSocketInterceptor) with access to the list of existing registrations.

public InterceptorRegistry
forSocketAcceptor(SocketAcceptorInterceptor interceptor)

Add a SocketAcceptorInterceptor that will intercept the accepting of new connections.

public InterceptorRegistry
forSocketAcceptor(Consumer<List<SocketAcceptorInterceptor>> consumer)

Variant of forSocketAcceptor(SocketAcceptorInterceptor) with access to the list of existing registrations.

pack-priv List<DuplexConnectionInterceptor>
pack-priv List<RSocketInterceptor>
pack-priv List<Function<RSocket, ? extends RequestInterceptor>>
pack-priv List<Function<RSocket, ? extends RequestInterceptor>>
pack-priv List<RSocketInterceptor>
pack-priv List<SocketAcceptorInterceptor>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connectionInterceptorsback to summary
private List<DuplexConnectionInterceptor> connectionInterceptors
requesterRequestInterceptorsback to summary
private List<Function<RSocket, ? extends RequestInterceptor>> requesterRequestInterceptors
requesterRSocketInterceptorsback to summary
private List<RSocketInterceptor> requesterRSocketInterceptors
responderRequestInterceptorsback to summary
private List<Function<RSocket, ? extends RequestInterceptor>> responderRequestInterceptors
responderRSocketInterceptorsback to summary
private List<RSocketInterceptor> responderRSocketInterceptors
socketAcceptorInterceptorsback to summary
private List<SocketAcceptorInterceptor> socketAcceptorInterceptors

Constructor Detail

InterceptorRegistryback to summary
public InterceptorRegistry()

Method Detail

forConnectionback to summary
public InterceptorRegistry forConnection(DuplexConnectionInterceptor interceptor)

Add a DuplexConnectionInterceptor.

forConnectionback to summary
public InterceptorRegistry forConnection(Consumer<List<DuplexConnectionInterceptor>> consumer)

Variant of forConnection(DuplexConnectionInterceptor) with access to the list of existing registrations.

forRequesterback to summary
public InterceptorRegistry forRequester(RSocketInterceptor interceptor)

Add an RSocketInterceptor that will decorate the RSocket used for performing requests.

forRequesterback to summary
public InterceptorRegistry forRequester(Consumer<List<RSocketInterceptor>> consumer)

Variant of forRequester(RSocketInterceptor) with access to the list of existing registrations.

forRequestsInRequesterback to summary
public InterceptorRegistry forRequestsInRequester(Function<RSocket, ? extends RequestInterceptor> interceptor)

Add an RequestInterceptor that will hook into Requester RSocket requests' phases.

Parameters
interceptor:Function<RSocket, ? extends RequestInterceptor>

a function which accepts an RSocket and returns a new RequestInterceptor

Since
1.1
forRequestsInResponderback to summary
public InterceptorRegistry forRequestsInResponder(Function<RSocket, ? extends RequestInterceptor> interceptor)

Add an RequestInterceptor that will hook into Requester RSocket requests' phases.

Parameters
interceptor:Function<RSocket, ? extends RequestInterceptor>

a function which accepts an RSocket and returns a new RequestInterceptor

Since
1.1
forResponderback to summary
public InterceptorRegistry forResponder(RSocketInterceptor interceptor)

Add an RSocketInterceptor that will decorate the RSocket used for resonding to requests.

forResponderback to summary
public InterceptorRegistry forResponder(Consumer<List<RSocketInterceptor>> consumer)

Variant of forResponder(RSocketInterceptor) with access to the list of existing registrations.

forSocketAcceptorback to summary
public InterceptorRegistry forSocketAcceptor(SocketAcceptorInterceptor interceptor)

Add a SocketAcceptorInterceptor that will intercept the accepting of new connections.

forSocketAcceptorback to summary
public InterceptorRegistry forSocketAcceptor(Consumer<List<SocketAcceptorInterceptor>> consumer)

Variant of forSocketAcceptor(SocketAcceptorInterceptor) with access to the list of existing registrations.

getConnectionInterceptorsback to summary
pack-priv List<DuplexConnectionInterceptor> getConnectionInterceptors()
getRequesterInterceptorsback to summary
pack-priv List<RSocketInterceptor> getRequesterInterceptors()
getRequestInterceptorsForRequesterback to summary
pack-priv List<Function<RSocket, ? extends RequestInterceptor>> getRequestInterceptorsForRequester()
getRequestInterceptorsForResponderback to summary
pack-priv List<Function<RSocket, ? extends RequestInterceptor>> getRequestInterceptorsForResponder()
getResponderInterceptorsback to summary
pack-priv List<RSocketInterceptor> getResponderInterceptors()
getSocketAcceptorInterceptorsback to summary
pack-priv List<SocketAcceptorInterceptor> getSocketAcceptorInterceptors()