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

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

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

    破門(mén)點(diǎn)滴(Java技術(shù)版)

    在日常學(xué)習(xí)和工作中記錄

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

    關(guān)于ClassLoader 問(wèn)題的分析:

    EclipeClassLoader 創(chuàng)建:


    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,這里分析看來(lái)應(yīng)該使用framework 或者系統(tǒng)的ClassLoader吧。

    根據(jù)以上的分析,對(duì)Triones的啟動(dòng)環(huán)境進(jìn)行了調(diào)整:

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

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

    3、修改 Eclipse config.ini 配置。

    # osgi classloader :

    osgi.parentClassloader = fwk

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

    bundleClassLoaderParent = FrameworkAdaptor.class.getClassLoader();



    不得窺道門(mén),不得悟佛門(mén),不得入窄門(mén),實(shí)乃破門(mén)。
    posted on 2005-11-28 16:25 破門(mén) 閱讀(540) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): Triones
    主站蜘蛛池模板: 在线观看免费黄色网址| 国产精品亚洲精品日韩电影| 国内精品一级毛片免费看| 亚洲精品高清在线| 免费国产草莓视频在线观看黄| 四虎影视精品永久免费网站| 国产亚洲欧美日韩亚洲中文色| 成人永久免费高清| 色吊丝性永久免费看码 | 精品久久洲久久久久护士免费| 亚洲精品色播一区二区| 免费观看的毛片手机视频| 在线亚洲v日韩v| 国产成人亚洲精品91专区手机| 国产免费黄色无码视频 | 国内大片在线免费看| 亚洲妇女无套内射精| 亚洲国产成人久久一区WWW| caoporm碰最新免费公开视频| 亚洲人成77777在线播放网站| 免费91麻豆精品国产自产在线观看 | 国产精品亚洲AV三区| 免费一级毛片正在播放| 91免费福利视频| 亚洲毛片基地日韩毛片基地| 妞干网在线免费观看| 中文字幕免费在线视频| 亚洲成电影在线观看青青| 日本免费人成黄页网观看视频| 51午夜精品免费视频| 精品日韩亚洲AV无码一区二区三区 | 亚洲另类激情综合偷自拍图| 1a级毛片免费观看| 亚洲爆乳少妇无码激情| 亚洲午夜久久久影院| 999国内精品永久免费视频| 羞羞视频在线观看免费| 亚洲国产日韩在线一区| 亚洲成A人片在线观看无码3D| 无码精品国产一区二区三区免费| 亚洲日韩一区二区一无码|