Class SocketEndpointPostProcessor

java.lang.Object
io.fluxzero.sdk.configuration.spring.SocketEndpointPostProcessor
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor, org.springframework.context.EnvironmentAware

public class SocketEndpointPostProcessor extends Object
Spring BeanDefinitionRegistryPostProcessor that detects SocketEndpoint types within the application's component-scan scope and registers them as FluxzeroPrototype definitions for use in Fluxzero.

This enables WebSocket endpoints to be activated per application scan scope without exposing those endpoint types as regular Spring beans.

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(FluxzeroSpringConfig.class)
public class MyApp { ... }
See Also:
  • Constructor Details

    • SocketEndpointPostProcessor

      public SocketEndpointPostProcessor()
  • Method Details

    • getTargetAnnotation

      protected Class<SocketEndpoint> getTargetAnnotation()
    • getBeanNameSuffix

      protected String getBeanNameSuffix()
    • 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
    • setEnvironment

      public void setEnvironment(org.springframework.core.env.Environment environment)
      Specified by:
      setEnvironment in interface org.springframework.context.EnvironmentAware