2121import org .springframework .web .socket .config .annotation .WebSocketConfigurer ;
2222import org .springframework .web .socket .config .annotation .WebSocketHandlerRegistry ;
2323import org .springframework .web .socket .server .support .DefaultHandshakeHandler ;
24- import tools .dynamia .commons .logger .LoggingService ;
25- import tools .dynamia .commons .logger .SLF4JLoggingService ;
24+ import tools .dynamia .commons .logger .Loggable ;
2625
2726
2827/**
3433 * <li>{@link WebSocketGlobalCommandHandler}</li>
3534 * <li>{@link DefaultHandshakeHandler}</li>
3635 * </ul>
37- *
36+ * <p>
3837 * Usage:
3938 * <ul>
4039 * <li>Extend this class in your own {@code @Configuration} to customize endpoint,
4140 * allowed origins or handshake behavior.</li>
4241 * <li>Or import it from another {@code @Configuration} class using
4342 * {@code @Import(ZKWebSocketConfigurer.class)} to reuse the default configuration.</li>
4443 * </ul>
45- *
44+ * <p>
4645 * Important: When using this class as a Spring configuration (either by extending it
4746 * or importing it), the hosting configuration must enable WebSocket support by being
4847 * annotated with {@code @EnableWebSocket}. Without {@code @EnableWebSocket} Spring
6362 * @Import(ZKWebSocketConfigurer.class)
6463 * public class AppConfig { }
6564 * }</pre>
66- *
65+ * <p>
6766 * This class is intentionally lightweight and provides sensible defaults. Override
6867 * or extend behaviour when a project needs different endpoint paths, CORS rules
6968 * or a custom handshake handler.
7069 */
71- public class ZKWebSocketConfigurer implements WebSocketConfigurer {
70+ public class ZKWebSocketConfigurer implements WebSocketConfigurer , Loggable {
7271
7372 private String endpoint = "/ws-commands" ;
7473 private String [] allowedOrigins = new String []{"*" };
7574 private String [] allowedOriginPatterns = null ;
7675
77- private final LoggingService logger = new SLF4JLoggingService (ZKWebSocketConfigurer .class );
7876
7977 /**
8078 * Creates a new ZKWebSocketConfigurer with default configuration values.
8179 * A startup message is logged when an instance is created.
8280 */
8381 public ZKWebSocketConfigurer () {
84- logger . info ("Starting " + getClass ());
82+ log ("Starting " + getClass ());
8583 }
8684
8785 /**
@@ -93,7 +91,7 @@ public ZKWebSocketConfigurer() {
9391 */
9492 @ Override
9593 public void registerWebSocketHandlers (WebSocketHandlerRegistry registry ) {
96- logger . info ("Registering WS Handler for ZK Commands" );
94+ log ("Registering WS Handler for ZK Commands" );
9795 var reg = registry .addHandler (globalCommandHandler (), endpoint != null ? endpoint : "/ws-commands" );
9896 if (allowedOrigins != null ) {
9997 reg .setAllowedOrigins (allowedOrigins );
0 commit comments