当前位置: 首页 > news >正文

手机网站建设注册塔山双喜网线制作视频

手机网站建设注册塔山双喜,网线制作视频,诚信经营网站的建设,专门做任务的网站吗Spring Security本质是一个过滤器链 过滤器链本质是责任链设计模型 1. HttpSecurity 【第五篇】深入理解HttpSecurity的设计-腾讯云开发者社区-腾讯云 在以前spring security也是采用xml配置的方式#xff0c;在http标签中配置http请求相关的配置#xff0c;如用户…Spring Security本质是一个过滤器链 过滤器链本质是责任链设计模型 1. HttpSecurity 【第五篇】深入理解HttpSecurity的设计-腾讯云开发者社区-腾讯云 在以前spring security也是采用xml配置的方式在http标签中配置http请求相关的配置如用户权限等。但是在SpringBoot项目中我们慢慢脱离了xml配置文件的方式在SpringSecurity中提供了HttpSecurity等工具类。 1.1. SecurityBuilder 该接口仅定义了Spring Security构建对象的接口方法是一个泛型接口泛型中指明需要创建的对象。 public interface SecurityBuilderO {/*** Builds the object and returns it or null.* return the Object to be built or null if the implementation allows it.* throws Exception if an error occurred when building the Object*/O build() throws Exception;} 1.2. AbstractSecurityBuilder 一个抽象实现类该类确保对象仅被创建一次。使用了AtomicBoolean原子类使该类在并发情况下也能保证正确性。 public abstract class AbstractSecurityBuilderO implements SecurityBuilderO {private AtomicBoolean building new AtomicBoolean();private O object;Overridepublic final O build() throws Exception {if (this.building.compareAndSet(false, true)) {this.object doBuild();return this.object;}throw new AlreadyBuiltException(This object has already been built);}public final O getObject() {if (!this.building.get()) {throw new IllegalStateException(This object has not been built);}return this.object;}protected abstract O doBuild() throws Exception;} 1.3. AbstractConfiguredSecurityBuilder 其内部了定义了一个枚举类将整个构建过程分为 5 种状态也可以理解为构建过程生命周期的五个阶段如下 private enum BuildState {UNBUILT(0),INITIALIZING(1),CONFIGURING(2),BUILDING(3),BUILT(4);private final int order;BuildState(int order) {this.order order;}public boolean isInitializing() {return INITIALIZING.order this.order;}/*** Determines if the state is CONFIGURING or later* return*/public boolean isConfigured() {return this.order CONFIGURING.order;}} 构建过程 Override protected final O doBuild() throws Exception {synchronized (this.configurers) {this.buildState BuildState.INITIALIZING;beforeInit(); //是一个预留方法没有任何实现init(); // 就是找到所有的 xxxConfigure挨个调用其 init 方法进行初始化this.buildState BuildState.CONFIGURING;beforeConfigure(); // 是一个预留方法没有任何实现configure(); // 就是找到所有的 xxxConfigure挨个调用其 configure 方法进行配置。this.buildState BuildState.BUILDING;// 是真正的过滤器链构建方法//但是在 AbstractConfiguredSecurityBuilder中 performBuild 方法只是一个抽象方法//具体的实现在 HttpSecurity 中O result performBuild();this.buildState BuildState.BUILT;return result;} } AbstractConfiguredSecurityBuilder类字段中保存了一个配置列表由HashMap存储了配置类和对应的配置列表提供了添加、移除配置的方法。 private final LinkedHashMapClass? extends SecurityConfigurerO, B, ListSecurityConfigurerO, B configurers new LinkedHashMap(); 2. SecurityConfigurer public interface SecurityConfigurerO, B extends SecurityBuilderO {void init(B builder) throws Exception;void configure(B builder) throws Exception;} SecurityConfigurerO, B: 这是接口的声明它指定了两个泛型参数。 O代表配置的目标对象例如配置安全性规则的目标对象。这个参数表示你要对哪种类型的对象进行配置例如Web安全性规则HttpSecurity或认证管理器AuthenticationManager等。B代表用于构建配置的构建器builder。这个参数表示你使用的构建器的类型通常是一个实现了SecurityBuilder接口的类用于构建和配置目标对象。 接口SecurityConfigurer定义了一种通用的配置模式用于配置各种不同类型的安全对象而泛型参数O和B允许它变得灵活并适用于不同的配置场景。当你实现SecurityConfigurer接口时你会为不同的安全配置提供具体的实现其中O表示你要配置的安全对象的类型B表示你要使用的构建器类型。
http://www.pierceye.com/news/700106/

相关文章:

  • 加盟网站建设服务极简风格 wordpress
  • phpcms v9 网站模板seo优化的技巧
  • 域名备案网站要不要关7k7k网页游戏
  • 虚拟主机发布网站吗汕头建站平台
  • wap站是什么意思啊阿里云建设网站的步骤
  • 网站备案 异地可以做视频的网站
  • 淘宝网站c 设计怎么做安卓手机做网站
  • 嘉兴做网站建设的公司电商网名大全
  • 欢迎访问中国建设银行网站密码重置wordpress wp_parse_args
  • 普通电脑可以做网站服务器吗找人做网站需要什么条件
  • 长沙公司网站的建设网站图片尺寸
  • 高端网站定制费用是多少php网站建设制作
  • 广州营销型网站建设费用wordpress最新版下载
  • 洛阳网站设计公司xiamiplayer for wordpress
  • 做网站模版形象墙logo墙设计图
  • 视频网站怎么做防盗链好的装修效果图网站
  • 个人音乐分享网站源码移动网站建设的前景
  • 谷歌自建站和优化网站有很多304状态码
  • 甘肃 网站建设高端品牌护肤品
  • 南昌网站建设公司哪家好导航类网站怎么做
  • 织梦如何做汽车贸易网站wordpress调用主站的文章
  • 软件公司网站模板下载上海史特网站建设
  • 辽宁省锦州市住房与城乡建设厅网站网站的建设特色
  • 笨鸟网站开发如何做vip微信电影网站
  • 网站正在建设中图片南召seo快速排名价格
  • 网站怎么上线东莞网站seo优化托管
  • 网站建设免费的服务器关键词云图
  • 深圳网站建设哪家便宜彩票网站怎么做推广
  • 阿凡达网站建设西安免费做网站公司
  • 佛山的网站建设公司打鱼网站开发