org.springframework.security.config.annotation.web.configuration.EnableWebSecurity Java Examples

The following examples show how to use org.springframework.security.config.annotation.web.configuration.EnableWebSecurity. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EnableWebSecurityCondition.java    From cola-cloud with MIT License 6 votes vote down vote up
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
    String[] enablers = context.getBeanFactory()
            .getBeanNamesForAnnotation(EnableWebSecurity.class);
    ConditionMessage.Builder message = ConditionMessage
            .forCondition("@EnableWebSecurity Condition");
    if (enablers != null && enablers.length > 0) {
        return ConditionOutcome.match(message
                .found("@EnableWebSecurity annotation on Application")
                .items(enablers));
    }

    return ConditionOutcome.noMatch(message.didNotFind(
            "@EnableWebSecurity annotation " + "on Application")
            .atAll());
}