<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    破門點滴(Java技術版)

    在日常學習和工作中記錄

      BlogJava :: 首頁 ::  :: 聚合  :: 管理
      15 Posts :: 7 Stories :: 36 Comments :: 0 Trackbacks
     

    關于ClassLoader 問題的分析:

    EclipeClassLoader 創建:


    org.eclipse.core.runtime.adaptor.EclipseElementFactory

    public org.eclipse.osgi.framework.adaptor.BundleClassLoader createClassLoader

    (ClassLoaderDelegate delegate, ProtectionDomain domain, S

    tring[] bundleclasspath, AbstractBundleData data) {

                  
    return new EclipseClassLoader(delegate, domain, 

    bundleclasspath, data.getAdaptor().getBundleClassLoaderParent(), data);

           }


    獲取ClassLoaderParent 的方法,使用了EclipseAdaptor

    Adaptor getBundleClassLoaderParent() 如何去定 bundleClassLoaderParent?


     1org.eclipse.osgi.framework.adaptor.core. AbstractFrameworkAdaptor
     2
     3/**
     4
     5        * The BundleClassLoader parent to use when creating BundleClassLoaders.
     6
     7        * The behavior of the ParentClassLoader will load classes
     8
     9        * from the boot strap classloader.
    10
    11        */

    12
    13       protected static ClassLoader bundleClassLoaderParent;
    14
    15 
    16
    17       static {
    18
    19              // check property for specified parent
    20
    21              String type = 
    22
    23System.getProperty(PROP_PARENT_CLASSLOADER, PARENT_CLASSLOADER_BOOT);
    24
    25              if (PARENT_CLASSLOADER_FWK.equalsIgnoreCase(type))
    26
    27                     bundleClassLoaderParent = FrameworkAdaptor.class.getClassLoader();
    28
    29              else if (PARENT_CLASSLOADER_APP.equalsIgnoreCase(type))
    30
    31                     bundleClassLoaderParent = ClassLoader.getSystemClassLoader();
    32
    33              else if (PARENT_CLASSLOADER_EXT.equalsIgnoreCase(type)) {
    34
    35                     ClassLoader appCL = ClassLoader.getSystemClassLoader();
    36
    37                     if (appCL != null)
    38
    39                            bundleClassLoaderParent = appCL.getParent();
    40
    41              }

    42
    43 
    44
    45              // default to boot classloader
    46
    47              if (bundleClassLoaderParent == null)
    48
    49                     bundleClassLoaderParent = new ParentClassLoader();
    50
    51       }

    52
    53


    如果使用了了boot Classloader ParentClassLoader 是新建的 boot,這里分析看來應該使用framework 或者系統的ClassLoader吧。

    根據以上的分析,對Triones的啟動環境進行了調整:

    1、直接引用 org.eclipse.osgi 中的啟動包,避免使用反射。注:可以直接調用EclipseStarter.run(null) 了。

    2、Triones Runtime 拆分成為 triones-core.jar (包括主要的服務接口 ItrionesFramework 等)和 triones-runtime.jar (Triones Runtime Eclipse插件)

    3、修改 Eclipse config.ini 配置。

    # osgi classloader :

    osgi.parentClassloader = fwk

    根據上面的分析, fwk 表示使用 FrameworkAdaptor ClassLoader 作為OSGiparent classloader

    bundleClassLoaderParent = FrameworkAdaptor.class.getClassLoader();



    不得窺道門,不得悟佛門,不得入窄門,實乃破門。
    posted on 2005-11-28 16:25 破門 閱讀(540) 評論(0)  編輯  收藏 所屬分類: Triones
    主站蜘蛛池模板: 无码av免费一区二区三区试看| 亚洲熟妇无码AV| 丰满人妻一区二区三区免费视频| 天天天欲色欲色WWW免费| 亚洲精品av无码喷奶水糖心| 无码少妇一区二区浪潮免费| 77777午夜亚洲| 免费看的成人yellow视频| 亚洲综合一区二区三区四区五区| 四虎影院在线免费播放| 亚洲国产精品18久久久久久| heyzo亚洲精品日韩| 中文字幕免费在线看电影大全 | 在线观看成人免费视频不卡| 亚洲乱码在线播放| 日本免费福利视频| 九九全国免费视频| 久久久久亚洲av无码尤物| 免费专区丝袜脚调教视频| 中文字幕亚洲综合久久综合| 国产大片91精品免费看3| www在线观看播放免费视频日本| 亚洲精品乱码久久久久久| 57pao一国产成视频永久免费| 亚洲久悠悠色悠在线播放| 亚洲婷婷国产精品电影人久久| 久久久精品免费视频| 国产精品高清视亚洲一区二区 | 亚洲夂夂婷婷色拍WW47| 日韩精品视频免费观看| 人成电影网在线观看免费| 亚洲国产精品无码久久SM| 亚色九九九全国免费视频| 国产亚洲漂亮白嫩美女在线| 亚洲最大AV网站在线观看| 91网站免费观看| kk4kk免费视频毛片| 亚洲成av人片在线看片| 亚洲不卡无码av中文字幕| 最近最新高清免费中文字幕| 337P日本欧洲亚洲大胆精品|