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

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

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

    Bryan

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      37 Posts :: 3 Stories :: 24 Comments :: 0 Trackbacks

    Chain of Responsibility

    The Java Servlet filter framework is an example of chain of resposibility design. Note that the chain.doFilter() is the method that should be called to make the chain roll. If the subclass missed it, the whole chain would be stopped or blocked.

    Java exception handling is another example of chain of responsibility design. When an error occurs, the exception call will look for a handling class. If there is no handler, the super Exception class will be called to throw the exception. Otherwise, the handler class will handle it.


     Mediator (Allows loose coupling by encapsulating the way disparate sets of objects interact and communicate with each other.  Allows for the actions of each object set to vary independently of one another. )

     

    An airport control tower is an excellent example of the mediator pattern. The tower looks after who can take off and land - all communications are done from the airplane to control tower, rather than having plane-to-plane communication. This idea of a central controller is one of the key aspects to the mediator pattern.

    An observer based variation of the mediator pattern is used in Java Message Service (JMS) implementations, which allows applications to subscribe and publish data to other applications. This is a common combination of patterns that makes sense.

     

    Aspect-oriented programming is a way of modularizing crosscutting concerns much like object-oriented programming is a way of modularizing common concerns. AspectJ is an implementation of aspect-oriented programming for Java.



    AOP's core idea is "separating the business logic in an application from the common services that support it," according to Adam Magee, a Senior Solution Architect with Avanade, a technology integrator that specialises in Microsoft technologies.
    正如Avanade公司的高級方案構架師Adam Magee所說,AOP的核心思想就是將應用程序中的商業邏輯同對其提供支持的通用服務進行分離。


    IIOP is CORBA's communication protocol. It defines the way bits are sent over a wire between CORBA clients and servers. CORBA is a standard distributed object architecture developed by the Object Management Group (OMG). Interfaces to remote objects are described in a platform-neutral interface definition language (IDL). Mappings from IDL to specific programming languages are implemented, binding the language to CORBA/IIOP.


    Java class loader hierarchy

    We have 3 main class loader :

    • Bootstrap class loader, called primordial class loader. It's a part of the JVM., and is responsible for loading classes from the core Java package (java.lang, java.util etc.) These classes are found in JAVA_HOME/jre/lib/rt.jar.
    • Extension class loader. It monitors the JAVA_HOME/jre/lib/ext folder and load the existing jars.
    • System class loader. It monitors the folders and Jars which can be find in the classpath.

         An important point is that a class loader can only see the class locations that are above it in the hierarchy. So a class loaded from Extension class loader can't see a class from the class path.

     

     

    Bootstrap classloader is the parent of all classloaders and loads the standard JDK classes in lib directory of JRE (rt.jar and i18n.jar). All the java.* classes are loaded by this classloader.

    Extensions Classloader is the immediate child of Bootstrap classloader. This classloader loads the classes in lib\ext directory of the JRE. For example, JDK1.4.x ships with its own implementation for JCE. The JCE implementation is identified by the sunjceprovider.jar and is present in JRE/lib/ext directory and is loaded by the extensions classloader.

    System-Classpath classloader is the immediate child of Extensions classloader. It loads the classes and jars specified by the CLASSPATH environment variable, java.class.path system property, -cp or –classpath command line settings. If any of the jars specified in one of the above manner have a MANIFEST.MF file with a Class-Path attribute, the jars specified by the Class-Path attribute are also loaded.



    LDAP  

    So What is a Directory?

    A directory is a type of heirarchical database. It is made up of entries, that have a globally unique name, and contain attributes that are named collections of data values. A simple conceptual example:

    A country { relative name 'c=au' , description = 'Australia' }
        |
        |
        ---- A company { relative name = 'o=computer associates', web address = 'www.ca.com'  }
                |
                |
                ----- A person { relative name = 'cn=Chris', favorite drink = 'japanese slipper' }
                |
                ----- A person { relative name = 'cn=Trudi', favorite drink = 'beer' }
                |
                ----- A person { relative name = 'cn=Jay', favorite drink = 'mineral water' }
    

    This shows a simple directory with five entries. Each entry has a unique name relative to its parent called its 'relative distinguished name' or RDN. The combination of all its ancestors RDNs is called the 'distinguished name' - hence the distinguished name of the last entry above would be "c=au, o=computer associates, cn=Jay".
    Each LDAP directory can have a root DN (rootdn), which is similar to the superuser account on Unix systems. When authenticated, this DN is authorized to do whatever the user desires.The root DN also requires a corresponding root password (rootpw), which can be stored in clear text or encrypted form using one of the prefixes accepted by the password-hash parameter.
    The binddn and bindpw parameters provide a means of specifying the credentials to use when contacting the remote LDAP directory.



    LDAP URLs have the following syntax:

    ldap[s]://hostname:port/base_dn?attributes?scope?filter


    Component

    Description

    hostname

    Name (or IP address in dotted format) of the LDAP server. For example, ldap.example.com or 192.202.185.90.

    port

    Port number of the LDAP server (for example, 696). If no port is specified, the standard LDAP port (389) or LDAPS port (636) is used.

    base_dn

    Distinguished name (DN) of an entry in the directory. This DN identifies the entry that is the starting point of the search. If no base DN is specified, the search starts at the root of the directory tree.

    attributes

    The attributes to be returned. To specify more than one attribute, use commas to separate the attributes; for example, cn,mail,telephoneNumber. If no attributes are specified in the URL, all attributes are returned.

    scope

    The scope of the search, which can be one of these values:

    base retrieves information only about the distinguished name (base_dn) specified in the URL.

    one retrieves information about entries one level below the distinguished name (base_dn) specified in the URL. The base entry is not included in this scope.

    sub retrieves information about entries at all levels below the distinguished name (base_dn) specified in the URL. The base entry is included in this scope.

    If no scope is specified, the server performs a base search.

    filter

    Search filter to apply to entries within the specified scope of the search. If no filter is specified, the server uses the filter (objectClass=*).



    (General structure of an LDAP tree)

    An entry can be located in LDAP by specifying either the distinguished name (dn) or the relative distinguished name (rdn). The dn is the full LDAP tree path whereas the rdn is just a unique identifier for a specific entry in the tree.

    One way to easily conceptualize the difference between the dn and rdn is to think of the difference between directions and an address. The dn would be equivalent to giving directions from the airport to a hotel. The rdn would just be the address of the hotel. Similar to an address a rdn must be unique. It would be very difficult to find your hotel on a city map if its address was not unique.




    Ref

     

    http://java.dzone.com/articles/design-patterns-mediator
    http://docs.oracle.com/javase/tutorial/rmi/compiling.html
    http://avricot.com/blog/index.php?post/2011/02/18/tomcat-class-loader%2C-priority-order
    http://www.javapractices.com/source/SourceAction.do;jsessionid=8B35187C2A4BA9742D2DD5A35F98B6E4
    http://www.objectsource.com/j2eechapters/Ch21-ClassLoaders_and_J2EE.htm
    http://www.keutel.de/directory/public_ldap_servers.html
    posted on 2012-03-22 12:57 Life is no respector of any genius. 閱讀(487) 評論(0)  編輯  收藏 所屬分類: Java
    主站蜘蛛池模板: 国产精品亚洲аv无码播放| 久久久久久久亚洲Av无码| 亚洲美女视频一区二区三区| 亚洲国产区男人本色| 国产羞羞的视频在线观看免费 | 久久一区二区免费播放| 999国内精品永久免费视频| jizzjizz亚洲| 亚洲H在线播放在线观看H| 成人免费无码H在线观看不卡| 99热在线精品免费全部my| 中文字幕精品亚洲无线码二区 | 日韩午夜理论免费TV影院| 亚洲一区二区三区亚瑟| 亚洲hairy多毛pics大全| 亚洲精品天堂无码中文字幕| 亚洲中文字幕久久精品无码A| 亚洲午夜精品国产电影在线观看| 亚洲日本在线看片| 亚洲专区中文字幕| 国产精品高清免费网站| 美女扒开屁股让男人桶爽免费| 亚洲国产精品ⅴa在线观看| 久久永久免费人妻精品| 免费成人av电影| 亚洲一区中文字幕| 在线观看免费无码专区| 亚洲А∨精品天堂在线| 亚洲人成77777在线播放网站不卡| 九九99热免费最新版| 日美韩电影免费看| 亚洲国产成人精品电影| 免费一级不卡毛片| 国产亚洲一区二区三区在线不卡| 亚洲风情亚Aⅴ在线发布| 麻豆高清免费国产一区| 国产成人亚洲精品青草天美| 免费人妻精品一区二区三区| 韩国欧洲一级毛片免费| 在线综合亚洲中文精品| 69视频在线观看免费|