<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. 閱讀(488) 評論(0)  編輯  收藏 所屬分類: Java
    主站蜘蛛池模板: 1000部羞羞禁止免费观看视频| 人人玩人人添人人澡免费| 免费人成视频在线| 亚洲白色白色永久观看| 午夜免费1000部| 亚洲一区动漫卡通在线播放| 日本视频一区在线观看免费| 亚洲精品国产情侣av在线| 久久精品免费一区二区| 亚洲国产美女福利直播秀一区二区 | 亚洲精品成人区在线观看| 美女被艹免费视频| 亚洲一区二区三区在线播放| 两个人日本免费完整版在线观看1| 国产亚洲高清不卡在线观看| 四虎影视成人永久免费观看视频| 亚洲综合婷婷久久| 在线天堂免费观看.WWW| 亚洲成aⅴ人片久青草影院按摩| 成在线人永久免费视频播放| 一级白嫩美女毛片免费| 亚洲av中文无码乱人伦在线咪咕| 3344免费播放观看视频| 欧美亚洲精品一区二区| 成人亚洲性情网站WWW在线观看| 久久福利青草精品资源站免费 | 69pao强力打造免费高清| 亚洲日本一线产区和二线| yy6080久久亚洲精品| 久久99热精品免费观看牛牛| 欧洲 亚洲 国产图片综合| 亚洲福利中文字幕在线网址| 91成人免费观看| 久久久久久亚洲精品无码| 亚洲成AV人在线观看天堂无码| 麻豆一区二区免费播放网站 | 亚洲免费视频在线观看| 亚洲欧美日韩综合俺去了| 亚洲中文久久精品无码ww16| 国产麻豆视频免费观看| eeuss在线兵区免费观看|