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
Fields Modifier and Type Field Description protected org.springframework.integration.rsocket.IntegrationRSocketMessageHandler
rSocketMessageHandler
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractRSocketConnector(org.springframework.integration.rsocket.IntegrationRSocketMessageHandler rSocketMessageHandler)
-
Method Summary
Modifier and Type Method Description void
addEndpoint(IntegrationRSocketEndpoint endpoint)
Add anIntegrationRSocketEndpoint
for mapping and handling RSocket requests.void
afterPropertiesSet()
void
afterSingletonsInstantiated()
protected abstract void
doStart()
protected MimeType
getDataMimeType()
protected MimeType
getMetadataMimeType()
RSocketStrategies
getRSocketStrategies()
boolean
isAutoStartup()
boolean
isRunning()
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()
-
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(IntegrationRSocketEndpoint)
-
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()
-