public abstract class AbstractInterceptableSecurityWebSocketMessageBrokerConfigurer
extends org.springframework.security.config.annotation.web.socket.AbstractSecurityWebSocketMessageBrokerConfigurer
AbstractSecurityWebSocketMessageBrokerConfigurer
重载registerStompEndpoints(StompEndpointRegistry)
将StompEndpointRegistry向下造型为InterceptableWebMvcStompEndpointRegistry
子类直接重写registerStompEndpoints(InterceptableWebMvcStompEndpointRegistry)即可,方便增加消息拦截器
示例:
@Configuration
@EnableInterceptableWebSocketMessageBroker
public class WebSocketSecurityConfig extends AbstractInterceptableSecurityWebSocketMessageBrokerConfigurer {
@Override
protected void registerStompEndpoints(InterceptableWebMvcStompEndpointRegistry registry) {
registry.addFromClientInterceptor(exampleFromClientInterceptor)
.addToClientInterceptor(exampleToClientInterceptor);
}
}
| 构造器和说明 |
|---|
AbstractInterceptableSecurityWebSocketMessageBrokerConfigurer() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
registerStompEndpoints(InterceptableWebMvcStompEndpointRegistry registry) |
void |
registerStompEndpoints(org.springframework.web.socket.config.annotation.StompEndpointRegistry registry) |
addArgumentResolvers, afterSingletonsInstantiated, configureClientInboundChannel, configureInbound, csrfChannelInterceptor, customizeClientInboundChannel, inboundChannelSecurity, inboundMessageSecurityMetadataSource, sameOriginDisabled, securityContextChannelInterceptor, setApplicationContext, setMessageExpessionHandler, setMessageExpressionHandler, setObjectPostProcessorpublic AbstractInterceptableSecurityWebSocketMessageBrokerConfigurer()
public void registerStompEndpoints(org.springframework.web.socket.config.annotation.StompEndpointRegistry registry)
registerStompEndpoints 在接口中 org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurerregisterStompEndpoints 在类中 org.springframework.security.config.annotation.web.socket.AbstractSecurityWebSocketMessageBrokerConfigurerpublic void registerStompEndpoints(InterceptableWebMvcStompEndpointRegistry registry)
Copyright © 2019. All rights reserved.