Class AbstractRSocketConnector
java.lang.Object
org.springframework.integration.rsocket.AbstractRSocketConnector
- All Implemented Interfaces:
Aware
,DisposableBean
,InitializingBean
,SmartInitializingSingleton
,ApplicationContextAware
,Lifecycle
,Phased
,SmartLifecycle
- Direct Known Subclasses:
ClientRSocketConnector
,ServerRSocketConnector
public abstract class AbstractRSocketConnector
extends Object
implements ApplicationContextAware, InitializingBean, DisposableBean, SmartInitializingSingleton, SmartLifecycle
A base connector container for common RSocket client and server functionality.
It accepts IntegrationRSocketEndpoint
instances for mapping registration via an internal
IntegrationRSocketMessageHandler
or performs an auto-detection otherwise, when all beans are ready
in the application context.
- Since:
- 5.2
- Author:
- Artem Bilan
- See Also:
-
IntegrationRSocketMessageHandler
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.springframework.integration.rsocket.IntegrationRSocketMessageHandler
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractRSocketConnector
(org.springframework.integration.rsocket.IntegrationRSocketMessageHandler rSocketMessageHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEndpoint
(IntegrationRSocketEndpoint endpoint) Add anIntegrationRSocketEndpoint
for mapping and handling RSocket requests.void
void
protected abstract void
doStart()
protected MimeType
protected MimeType
boolean
boolean
void
setApplicationContext
(ApplicationContext applicationContext) void
setAutoStartup
(boolean autoStartup) void
setDataMimeType
(MimeType dataMimeType) Configure aMimeType
for data exchanging.void
setEndpoints
(IntegrationRSocketEndpoint... endpoints) ConfigureIntegrationRSocketEndpoint
instances for mapping and handling requests.void
setMetadataMimeType
(MimeType metadataMimeType) Configure aMimeType
for metadata exchanging.void
setRSocketStrategies
(RSocketStrategies rsocketStrategies) Configure aRSocketStrategies
for data encoding/decoding.void
start()
void
stop()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.DisposableBean
destroy
Methods inherited from interface org.springframework.context.SmartLifecycle
getPhase, stop
-
Field Details
-
rSocketMessageHandler
protected final org.springframework.integration.rsocket.IntegrationRSocketMessageHandler rSocketMessageHandler
-
-
Constructor Details
-
AbstractRSocketConnector
protected AbstractRSocketConnector(org.springframework.integration.rsocket.IntegrationRSocketMessageHandler rSocketMessageHandler)
-
-
Method Details
-
setDataMimeType
Configure aMimeType
for data exchanging.- Parameters:
dataMimeType
- theMimeType
to use.
-
getDataMimeType
-
setMetadataMimeType
Configure aMimeType
for metadata exchanging. Default to"message/x.rsocket.composite-metadata.v0"
.- Parameters:
metadataMimeType
- theMimeType
to use.
-
getMetadataMimeType
-
setRSocketStrategies
Configure aRSocketStrategies
for data encoding/decoding.- Parameters:
rsocketStrategies
- theRSocketStrategies
to use.
-
getRSocketStrategies
-
setEndpoints
ConfigureIntegrationRSocketEndpoint
instances for mapping and handling requests.- Parameters:
endpoints
- theIntegrationRSocketEndpoint
instances for handling inbound requests.- See Also:
-
addEndpoint
Add anIntegrationRSocketEndpoint
for mapping and handling RSocket requests.- Parameters:
endpoint
- theIntegrationRSocketEndpoint
to map.
-
setApplicationContext
- Specified by:
setApplicationContext
in interfaceApplicationContextAware
- Throws:
BeansException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceInitializingBean
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiated
in interfaceSmartInitializingSingleton
-
setAutoStartup
public void setAutoStartup(boolean autoStartup) -
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartup
in interfaceSmartLifecycle
-
start
public void start() -
doStart
protected abstract void doStart() -
stop
public void stop() -
isRunning
public boolean isRunning()
-