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

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

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

    gembin

    OSGi, Eclipse Equinox, ECF, Virgo, Gemini, Apache Felix, Karaf, Aires, Camel, Eclipse RCP

    HBase, Hadoop, ZooKeeper, Cassandra

    Flex4, AS3, Swiz framework, GraniteDS, BlazeDS etc.

    There is nothing that software can't fix. Unfortunately, there is also nothing that software can't completely fuck up. That gap is called talent.

    About Me

     

    WebLogic's Classloading Framework

    Running any application on a JVM or an application server (e.g., WebLogic Server), the main question a designer faces is:
    • Which class is getting loaded from which source
    classloader is used by the JVM to locate and load Java classes into memory at runtime. Java classloaders define a hierarchy, a tree-like collection of parent and child classloaders.

    Classloader Hierarchy and Visibility

    Classloader hierarchy plays an important role when locating and loading classes into memory. There are two important points to remember:
    1. Classloaders follow the delegation model when loading classes (i.e., current classloader asks its parent for the class if a class is not found in the cache).
    2. A child classloader loads a class only if its parent fails to load it (i.e., even if both parent and child classloaders have access to a particular class, and the child classloader receives a request to load the class, it is the parent that actually loads the class).
      • See customization section for an exception that is supported by WebLogic Server to override this default behavior by setting the prefer-web-inf-classes element to true in the weblogic.xmldescriptor file.
    The application that triggered the request to load a class receives a ClassNotFoundException if neither the classloader nor any of its ancestors can locate the class.

    The visibility of a class definition is determined by the following rules:
    • Any classes loaded by a classloader are visible directly or indirectly, to all its descendants.
    • A parent classloader cannot see any class loaded by any of its child classloaders
    • A classloader cannot access any classes loaded by a sibling classloader.

    Java Classloader Hierarchy

    The bootstrap classloader is the root of the Java classloader hierarchy. The details of Java classloader hierarchy is described below:
    1. Bootstrap classloader (root)
      • Created by the JVM for loading its internal classes and the java.* packages (i.e., core Java libraries under /lib directory) included within the JVM
      • Written in native code
    2. Extensions classloader (child of bootstrap classloader)
      • Loads any JARs placed in the extensions directory (/lib/ext or any other directory specified by thejava.ext.dirs system property) of the JDK
      • Implemented by the sun.misc.Launcher$ExtClassLoader class
    3. System classloader (child of extensions classloader)
      • Loads code found on java.class.path, which maps to the system CLASSPATH variable.
      • Implemented by the sun.misc.Launcher$AppClassLoader class
      • Any custom classloader created by an application, including WebLogic's classloaders, are all descendants of this system classpath classloader.

    WebLogic's Classloading Framework

    WebLogic's standard classloading framework needs to achieve two main goals:
    1. Maintain application independence
      • Classes used by application A must never come in conflict with any classes used by application B
      • Redeploying application A must have no effect on classes used by application B
    2. Hot-deploy or hot-redeploy
      • Within an application, it must allow you to redeploy web applications without having to redeploy the EJBs
      • It is more common to change JSP files and servlets than to change the EJB tier. With proper design, a separate classloader can be created for each servlet and JSP page. This allows you to reload individual servlets and JSPs easily, without the need for redeploying the web application or affecting any of the EJBs.

    WebLogic achieves the first goals by creating a separate classloader hierarchy for each application deployed to the server. The parent of this hierarchy is the system classpath classloader. By creating a separate classloaderhierarchy for each application, classloaders associated with one application cannot see the classloaders or classes of another application, and because sibling classloaders are isolated from each other, this also isolates the applications.

    Java classloaders do not have any standard mechanism to undeploy or unload a set of classes, nor can they load new versions of classes. To achieve the second goal, each application in WebLogic Server has a hierarchy of classloaders (see the Figure below) that are offspring of the system classloader. These hierarchies allow applications or parts of applications to be individually reloaded without affecting the rest of the system. To find out more details on this, read WebLogic Server Application Classloading.

    Customization

    Even with good support from either Java classloading framework or WebLogic's application classloading framework, it often comes times that you need to have better control over which modules are reloadable, which classes are visible between modules, etc.

    There are multiple solutions to your customization needs:
    1. You can configure a web application classloader so that it doesn't use the default parent delegation scheme by setting the prefer-web-inf-classes element to true in the weblogic.xml descriptor file. See details here.
    2. The FilteringClassLoader provides a mechanism for you to configure deployment descriptors to explicitly specify that certain packages should always be loaded from the application, rather than being loaded by the system classloader. See details here.
    3. You can create custom classloader hierarchies for an application allowing for better control over class visibility and reloadability. You achieve this by defining a classloader-structure element in the weblogic-application.xml deployment descriptor file. See details here.

    Wrap-up

    More often than not, you want class definitions (which are stable) shared across applications. To facilitate sharing, you would place them at higher level of the classloading hierarchy (for example, getting loaded at system classloader instead of at application classloader).

    If it is common to change some modules, a separate classloader can be created for them and place them at the tip of the classloading tree. This allows you to reload individual modules easily, without the need for redeploying their parent applications.

    References

    1. Classloader
    2. JRebel
    3. Understanding WebLogic Server Application Classloading
    4. WebLogic: The Definitive Guide
    5. WebLogic Server 11g for ADF/Forms Developers

    posted on 2011-08-16 16:49 gembin 閱讀(577) 評論(0)  編輯  收藏 所屬分類: JavaEEOracle

    導(dǎo)航

    統(tǒng)計(jì)

    常用鏈接

    留言簿(6)

    隨筆分類(440)

    隨筆檔案(378)

    文章檔案(6)

    新聞檔案(1)

    相冊

    收藏夾(9)

    Adobe

    Android

    AS3

    Blog-Links

    Build

    Design Pattern

    Eclipse

    Favorite Links

    Flickr

    Game Dev

    HBase

    Identity Management

    IT resources

    JEE

    Language

    OpenID

    OSGi

    SOA

    Version Control

    最新隨筆

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    free counters
    主站蜘蛛池模板: 亚洲人成人77777网站| 亚洲另类小说图片| MM1313亚洲精品无码久久| 免费一级毛片无毒不卡| 免费人成网站在线高清| avtt天堂网手机版亚洲| 久久精品成人免费观看| 亚洲区小说区图片区| 亚洲第一综合天堂另类专| 免费观看无遮挡www的视频 | 亚洲亚洲人成综合网络| 久久久亚洲精华液精华液精华液| 久草视频免费在线| 亚洲欧洲日产国码久在线观看| 一个人看的www视频免费在线观看 一个人看的免费观看日本视频www | 最近最好最新2019中文字幕免费| 亚洲中文字幕无码爆乳av中文| 亚洲国产成人精品无码区花野真一 | 亚洲av永久无码精品网址| 国产h肉在线视频免费观看| 亚洲精品国产成人99久久| 中文字幕在线免费看| 亚洲日本在线观看视频| 亚洲av综合日韩| 精品久久久久久久免费人妻| 亚洲二区在线视频| 日韩精品免费一级视频| 78成人精品电影在线播放日韩精品电影一区亚洲 | 亚洲视频精品在线| 老司机69精品成免费视频| 亚洲乳大丰满中文字幕| 国产精品青草视频免费播放| 亚洲精品97久久中文字幕无码| 美女被免费视频网站a| 国产午夜鲁丝片AV无码免费| 亚洲AV永久无码精品一福利| 日韩在线视频免费看| 亚洲av无码专区亚洲av不卡| 免费高清小黄站在线观看 | 成年女人喷潮毛片免费播放| 亚洲youjizz|