Class SocketEndpointPostProcessor

java.lang.Object
io.fluxcapacitor.javaclient.configuration.spring.SocketEndpointPostProcessor
All Implemented Interfaces:
org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor

public class SocketEndpointPostProcessor extends Object implements org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
Spring BeanDefinitionRegistryPostProcessor that detects beans annotated with SocketEndpoint and registers them as FluxPrototype definitions for use in Flux Capacitor.

This enables WebSocket endpoints to be managed by Flux, allowing handler methods within these types to respond to socket-based requests (e.g. via WebRequest).

Usage

To expose a WebSocket endpoint in your application:

 @SocketEndpoint
 public class ChatSocketEndpoint {
     @HandleSocketMessage
     public ChatResponse handle(ChatRequest request) {
         // respond to request via WebSocket
     }
 }
 
Ensure that Spring picks up this processor, typically via:

 @SpringBootApplication
 @Import(FluxCapacitorSpringConfig.class)
 public class MyApp { ... }
 
See Also:
  • Constructor Details

    • SocketEndpointPostProcessor

      public SocketEndpointPostProcessor()
  • Method Details

    • postProcessBeanFactory

      public void postProcessBeanFactory(@NonNull @NonNull org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) throws org.springframework.beans.BeansException
      Specified by:
      postProcessBeanFactory in interface org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
      Specified by:
      postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
      Throws:
      org.springframework.beans.BeansException
    • postProcessBeanDefinitionRegistry

      public void postProcessBeanDefinitionRegistry(@NonNull @NonNull org.springframework.beans.factory.support.BeanDefinitionRegistry registry) throws org.springframework.beans.BeansException
      Specified by:
      postProcessBeanDefinitionRegistry in interface org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
      Throws:
      org.springframework.beans.BeansException