use static initialiser to set the custom security strategy

This commit is contained in:
Jonas Partner
2008-07-05 12:59:10 +00:00
parent bd5d71120f
commit 13109856f4

View File

@@ -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());