use static initialiser to set the custom security strategy
This commit is contained in:
@@ -17,9 +17,11 @@
|
||||
package org.springframework.integration.security.config;
|
||||
|
||||
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
|
||||
import org.springframework.integration.security.StackBasedSecurityContextHolderStrategy;
|
||||
import org.springframework.integration.security.channel.config.SecuredChannelsParser;
|
||||
import org.springframework.integration.security.channel.config.SecurityPropagatingChannelsParser;
|
||||
import org.springframework.integration.security.endpoint.config.SecurityEndpointInterceptorParser;
|
||||
import org.springframework.security.context.SecurityContextHolder;
|
||||
|
||||
/**
|
||||
* Namespace handler for the security namespace.
|
||||
@@ -28,6 +30,10 @@ import org.springframework.integration.security.endpoint.config.SecurityEndpoint
|
||||
*/
|
||||
public class IntegrationSecurityNamespaceHandler extends NamespaceHandlerSupport {
|
||||
|
||||
static {
|
||||
SecurityContextHolder.setStrategyName(StackBasedSecurityContextHolderStrategy.class.getName());
|
||||
}
|
||||
|
||||
public void init() {
|
||||
registerBeanDefinitionParser("secured-channels", new SecuredChannelsParser());
|
||||
registerBeanDefinitionParser("security-propagating-channels", new SecurityPropagatingChannelsParser());
|
||||
|
||||
Reference in New Issue
Block a user