玩家必看科普!麻豆人人妻人人妻人人片AV,欧美老妇交乱视频在线观看,久久综合九色综合久99_知乎
<ruby id="fgcka"></ruby>
  • <progress id="fgcka"></progress>
    <tbody id="fgcka"></tbody>
    <dd id="fgcka"></dd>

    1. <dd id="fgcka"></dd>

      <em id="fgcka"></em>
        1. 系統城裝機大師 - 固鎮縣祥瑞電腦科技銷售部宣傳站!

          當前位置:首頁 > 網絡編程 > JavaScript > 詳細頁面

          ApplicationListenerDetector監聽器判斷demo

          時間:2023-03-15來源:系統城裝機大師作者:佚名

          判斷Bean是否是監聽器,如果是監聽器就將當前Bean加入監聽器集合

          1
          2
          3
          4
          5
          6
          7
          8
          9
          10
          11
          12
          13
          14
          15
          16
          17
          18
          19
          20
          21
          public Object postProcessAfterInitialization(Object bean, String beanName) {
             if (bean instanceof ApplicationListener) {
                // potentially not detected as a listener by getBeanNamesForType retrieval
                Boolean flag = this.singletonNames.get(beanName);
                if (Boolean.TRUE.equals(flag)) {
                   // singleton bean (top-level or inner): register on the fly
                   this.applicationContext.addApplicationListener((ApplicationListener<?>) bean);
                }
                else if (Boolean.FALSE.equals(flag)) {
                   if (logger.isWarnEnabled() && !this.applicationContext.containsBean(beanName)) {
                      // inner bean with other scope - can't reliably process events
                      logger.warn("Inner bean '" + beanName + "' implements ApplicationListener interface " +
                            "but is not reachable for event multicasting by its containing ApplicationContext " +
                            "because it does not have singleton scope. Only top-level listener beans are allowed " +
                            "to be of non-singleton scope.");
                   }
                   this.singletonNames.remove(beanName);
                }
             }
             return bean;
          }

          Bean銷毀之前

          如果當前Bean是監聽器,就將當前Bean從監聽器集合中移除

          1
          2
          3
          4
          5
          6
          7
          8
          9
          10
          11
          12
          public void postProcessBeforeDestruction(Object bean, String beanName) {
             if (bean instanceof ApplicationListener) {
                try {
                   ApplicationEventMulticaster multicaster = this.applicationContext.getApplicationEventMulticaster();
                   multicaster.removeApplicationListener((ApplicationListener<?>) bean);
                   multicaster.removeApplicationListenerBean(beanName);
                }
                catch (IllegalStateException ex) {
                   // ApplicationEventMulticaster not initialized yet - no need to remove a listener
                }
             }
          }

          以上就是ApplicationListenerDetector監聽器判斷demo的詳細內容

          分享到:

          相關信息

          系統教程欄目

          欄目熱門教程

          人氣教程排行

          站長推薦

          熱門系統下載

          玩家必看科普!麻豆人人妻人人妻人人片AV,欧美老妇交乱视频在线观看,久久综合九色综合久99_知乎 人人玩人人添人人澡超碰偷拍 青春娱乐视频精品分类官网2 最好最新高清中文字幕 91国自产拍最新2018 欧美精品一区二区三区不卡网 深夜你懂得我的意思2021 宿舍NP乖把腿张开H 网恋奔现一天被要几次 为什么我越叫他越快 学渣各种各样的PLAY 英语课代表下面好软小说 亚洲国产综合在线区尤物 FREE性丰满HD性欧美 我年轻漂亮的继坶BD 最近中文字幕完整免费视频 啦啦啦免费视频卡一卡二 青柠视频在线观看大全 在线天堂WWW在线资源 亚洲国产日本韩国欧美MV 天天学习|久久久久久久精品国产亚洲87 国产K频道分享系统进入口 三个嘴都吃满了还塞满了 JAPONENSIS老师学生JAVAHBB 亚洲精品1卡2卡3卡4卡 樱花草在线社区WWW韩国 好涨水快流出来了快吃动视频 久久AV无码精品人妻出轨