Package com.mikuac.shiro.boot
Class ShiroAutoConfiguration
java.lang.Object
com.mikuac.shiro.boot.ShiroAutoConfiguration
- All Implemented Interfaces:
org.springframework.web.socket.config.annotation.WebSocketConfigurer,org.springframework.web.socket.server.HandshakeInterceptor
@Component
@EnableAsync
@EnableWebSocket
@Import(Shiro.class)
@ComponentScan("com.mikuac.shiro")
public class ShiroAutoConfiguration
extends Object
implements org.springframework.web.socket.config.annotation.WebSocketConfigurer, org.springframework.web.socket.server.HandshakeInterceptor
Created on 2021/7/15.
-
Constructor Summary
ConstructorsConstructorDescriptionShiroAutoConfiguration(WebSocketServerProperties wsServerProp, WebSocketClientProperties wsClientProp, WebSocketProperties wsProp, ShiroProperties shiroProperties, ScheduledTask scheduledTask, Optional<WebSocketServerHandler> webSocketServerHandler, Optional<WebSocketClientHandler> webSocketClientHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, Exception exception) booleanbeforeHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, Map<String, Object> attributes) voidregisterWebSocketHandlers(org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry registry)
-
Constructor Details
-
ShiroAutoConfiguration
@Autowired public ShiroAutoConfiguration(WebSocketServerProperties wsServerProp, WebSocketClientProperties wsClientProp, WebSocketProperties wsProp, ShiroProperties shiroProperties, ScheduledTask scheduledTask, Optional<WebSocketServerHandler> webSocketServerHandler, Optional<WebSocketClientHandler> webSocketClientHandler)
-
-
Method Details
-
registerWebSocketHandlers
public void registerWebSocketHandlers(@Nonnull org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry registry) - Specified by:
registerWebSocketHandlersin interfaceorg.springframework.web.socket.config.annotation.WebSocketConfigurer
-
beforeHandshake
public boolean beforeHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception- Specified by:
beforeHandshakein interfaceorg.springframework.web.socket.server.HandshakeInterceptor- Throws:
Exception
-
afterHandshake
public void afterHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, @Nullable Exception exception) - Specified by:
afterHandshakein interfaceorg.springframework.web.socket.server.HandshakeInterceptor
-