org.springframework.boot.security.servlet

Class ApplicationContextRequestMatcher<C>

  • java.lang.Object
    • org.springframework.boot.security.servlet.ApplicationContextRequestMatcher<C>
  • Type Parameters:
    C - The type of the context that the match method actually needs to use. Can be an ApplicationContext or a class of an existing bean.
    All Implemented Interfaces:
    org.springframework.security.web.util.matcher.RequestMatcher


    public abstract class ApplicationContextRequestMatcher<C>
    extends Object
    implements org.springframework.security.web.util.matcher.RequestMatcher
    ApplicationContext backed RequestMatcher. Can work directly with the ApplicationContext, obtain an existing bean or create a new bean that is autowired in the usual way.
    Since:
    2.0.0
    Author:
    Phillip Webb
    • Constructor Detail

      • ApplicationContextRequestMatcher

        public ApplicationContextRequestMatcher(Class<? extends C> contextClass)
    • Method Detail

      • matches

        public final boolean matches(javax.servlet.http.HttpServletRequest request)
        Specified by:
        matches in interface org.springframework.security.web.util.matcher.RequestMatcher
      • matches

        protected abstract boolean matches(javax.servlet.http.HttpServletRequest request,
                                           Supplier<C> context)
        Decides whether the rule implemented by the strategy matches the supplied request.
        Parameters:
        request - the source request
        context - a supplier for the initialized context (may throw an exception)
        Returns:
        if the request matches
      • initialized

        protected void initialized(Supplier<C> context)
        Called once the context has been initialized.
        Parameters:
        context - a supplier for the initialized context (may throw an exception)

Copyright © 2018 Pivotal Software, Inc.. All rights reserved.