Class AbstractRSocketConnector

java.lang.Object
org.springframework.integration.rsocket.AbstractRSocketConnector
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle
Direct Known Subclasses:
ClientRSocketConnector, ServerRSocketConnector

public abstract class AbstractRSocketConnector extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.context.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
See Also:
  • IntegrationRSocketMessageHandler
  • 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

      public void setDataMimeType(@Nullable org.springframework.util.MimeType dataMimeType)
      Configure a MimeType for data exchanging.
      Parameters:
      dataMimeType - the MimeType to use.
    • getDataMimeType

      @Nullable protected org.springframework.util.MimeType getDataMimeType()
    • setMetadataMimeType

      public void setMetadataMimeType(org.springframework.util.MimeType metadataMimeType)
      Configure a MimeType for metadata exchanging. Default to "message/x.rsocket.composite-metadata.v0".
      Parameters:
      metadataMimeType - the MimeType to use.
    • getMetadataMimeType

      protected org.springframework.util.MimeType getMetadataMimeType()
    • setRSocketStrategies

      public void setRSocketStrategies(org.springframework.messaging.rsocket.RSocketStrategies rsocketStrategies)
      Configure a RSocketStrategies for data encoding/decoding.
      Parameters:
      rsocketStrategies - the RSocketStrategies to use.
    • getRSocketStrategies

      public org.springframework.messaging.rsocket.RSocketStrategies getRSocketStrategies()
    • setEndpoints

      public void setEndpoints(IntegrationRSocketEndpoint... endpoints)
      Configure IntegrationRSocketEndpoint instances for mapping and handling requests.
      Parameters:
      endpoints - the IntegrationRSocketEndpoint instances for handling inbound requests.
      See Also:
    • addEndpoint

      public void addEndpoint(IntegrationRSocketEndpoint endpoint)
      Add an IntegrationRSocketEndpoint for mapping and handling RSocket requests.
      Parameters:
      endpoint - the IntegrationRSocketEndpoint to map.
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • afterSingletonsInstantiated

      public void afterSingletonsInstantiated()
      Specified by:
      afterSingletonsInstantiated in interface org.springframework.beans.factory.SmartInitializingSingleton
    • setAutoStartup

      public void setAutoStartup(boolean autoStartup)
    • isAutoStartup

      public boolean isAutoStartup()
      Specified by:
      isAutoStartup in interface org.springframework.context.SmartLifecycle
    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • doStart

      protected abstract void doStart()
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle