您的位置:首页 > 其它

Binding and Context Concept, from JNDI Tutorial

2012-10-10 10:42 218 查看
Awesome material: http://docs.oracle.com/javase/jndi/tutorial/index.html

The association of a name with an object is called a binding. For example, a file name is bound to
a file.

A context is a set of name-to-object bindings. Every context has an associated naming convention. A context provides a lookup (resolution) operation that returns the object and may provide operations such
as those for binding names, unbinding names, and listing bound names. A name in one context object can be bound to another context object (called a subcontext) that has the same naming convention.

For example, a file directory, such as /usr, in the UNIX file system is a context. A file directory named relative to another file directory is a subcontext (some UNIX users refer to this as a subdirectory). That is, in a file directory /usr/bin,
the directory bin is a subcontext of usr. In another example, a DNS domain, such as COM, is a context. A DNS domain named relative to another DNS domain is a subcontext. For example, in the DNS domain Sun.COM, the DNS domain Sun is
a subcontext of COM.

Finally, an LDAP entry, such as c=us, is a context. An LDAP entry named relative to another LDAP entry is a subcontext. For example, in the an LDAP entry o=sun,c=us, the entry o=sun is a subcontext of c=us.

In the JNDI, all naming and directory operations are performed relative to a context. There are no absolute roots. Therefore the JNDI defines aninitial
context, InitialContext

,
which provides a starting point for naming and directory operations. Once you have an initial context, you can use it to look up other contexts and objects.

Contemplate: Why are there no absolute roots in JNDI? Duplicated items in various subcontexts.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐