Skip to content

Commit 6a47279

Browse files
nizarbenallaAlekseiEfimov
authored andcommitted
8332072: Convert package.html files in java.naming to package-info.java
8335213: Code snippet in javax.naming.ldap package summary does not compile Reviewed-by: aefimov
1 parent 7e378fc commit 6a47279

File tree

11 files changed

+717
-714
lines changed

11 files changed

+717
-714
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
26+
/**
27+
*
28+
* Extends the {@code javax.naming} package to provide functionality
29+
* for accessing directory services.
30+
*
31+
* <p>
32+
* This package defines the directory operations of the Java Naming and
33+
* Directory Interface (JNDI). &nbsp;
34+
* JNDI provides naming and directory functionality to applications
35+
* written in the Java programming language. It is designed to be
36+
* independent of any specific naming or directory service
37+
* implementation. Thus a variety of services--new, emerging, and
38+
* already deployed ones--can be accessed in a common way.
39+
*
40+
* <p>
41+
* This package allows applications to retrieve and update attributes
42+
* associated with objects stored in a directory, and to search for
43+
* objects using specified attributes.
44+
*
45+
* <h2>The Directory Context</h2>
46+
*
47+
* The {@code DirContext}
48+
* interface represents a <em>directory context</em>.
49+
* It defines methods for examining and updating attributes associated with a
50+
* <em>directory object</em>, or <em>directory entry</em> as it is sometimes
51+
* called.
52+
* <p>
53+
* You use {@code getAttributes()} to retrieve the attributes
54+
* associated with a directory object (for which you supply the name).
55+
* Attributes are modified using {@code modifyAttributes()}.
56+
* You can add, replace, or remove attributes and/or attribute values
57+
* using this operation.
58+
* <p>
59+
* {@code DirContext} also behaves as a naming context
60+
* by extending the {@code Context} interface in the {@code javax.naming} package.
61+
* This means that any directory object can also provide
62+
* a naming context.
63+
* For example, the directory object for a person might contain
64+
* the attributes of that person, and at the same time provide
65+
* a context for naming objects relative to that person
66+
* such as his printers and home directory.
67+
*
68+
* <h3>Searches</h3>
69+
* {@code DirContext} contains methods for
70+
* performing content-based searching of the directory.
71+
* In the simplest and most common form of usage, the application
72+
* specifies a set of attributes--possibly with specific
73+
* values--to match, and submits this attribute set, to the
74+
* {@code search()} method.
75+
* There are other overloaded forms of {@code search()}
76+
* that support more sophisticated <em>search filters</em>.
77+
*
78+
*
79+
* <h2>Package Specification</h2>
80+
*
81+
* The JNDI API Specification and related documents can be found in the
82+
* {@extLink jndi_overview JNDI documentation}.
83+
*
84+
* @since 1.3
85+
*/
86+
package javax.naming.directory;

src/java.naming/share/classes/javax/naming/directory/package.html

Lines changed: 0 additions & 90 deletions
This file was deleted.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/*
2+
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
26+
/**
27+
*
28+
* Provides support for event notification when accessing naming and
29+
* directory services.
30+
*
31+
* <p>
32+
* This package defines the event notification operations of the Java Naming
33+
* and Directory Interface (JNDI). &nbsp;
34+
* JNDI provides naming and directory functionality to applications
35+
* written in the Java programming language. It is designed to be
36+
* independent of any specific naming or directory service
37+
* implementation. Thus a variety of services--new, emerging, and
38+
* already deployed ones--can be accessed in a common way.
39+
*
40+
* <h2>Naming Events</h2>
41+
* <p>
42+
* This package defines a {@code NamingEvent} class to represent an event
43+
* that is generated by a naming/directory service.
44+
* It also defines subinterfaces of {@code Context} and {@code DirContext},
45+
* called {@code EventContext} and {@code EventDirContext},
46+
* through which applications can register their interest in events
47+
* fired by the context.
48+
* <p>
49+
* {@code NamingEvent} represents an event that occurs in a
50+
* naming or directory service. There are two categories of naming events:
51+
* <ul>
52+
* <li>Those that affect the namespace (add/remove/rename an object)
53+
* <li>Those that affect the objects' contents.
54+
* </ul>
55+
* Each category of events is handled by a corresponding listener:
56+
* {@code NamespaceChangeListener}, {@code ObjectChangeListener}.
57+
* <p>
58+
* An application, for example, can register its interest in changes to
59+
* objects in a context as follows:
60+
* {@snippet :
61+
* EventContext src =
62+
* (EventContext)(new InitialContext()).lookup("o=wiz,c=us");
63+
* src.addNamingListener("ou=users", EventContext.ONELEVEL_SCOPE,
64+
* new ChangeHandler());
65+
* ...
66+
* class ChangeHandler implements ObjectChangeListener {
67+
* public void objectChanged(NamingEvent evt) {
68+
* System.out.println(evt.getNewBinding());
69+
* }
70+
* public void namingExceptionThrown(NamingExceptionEvent evt) {
71+
* System.out.println(evt.getException());
72+
* }
73+
* }
74+
* }
75+
*
76+
* <a id=THREADING></a>
77+
* <h3>Threading Issues</h3>
78+
*
79+
* When an event is dispatched to a listener, the listener method (such
80+
* as {@code objectChanged()}) may be executed in a thread other than the
81+
* one in which the call to {@code addNamingListener()} was executed.
82+
* The choice of which thread to use is made by the service provider.
83+
* When an event is dispatched to multiple listeners, the service provider
84+
* may choose (and is generally encouraged) to execute the listener methods
85+
* concurrently in separate threads.
86+
* <p>
87+
* When a listener instance invokes {@code NamingEvent.getEventContext()},
88+
* it must take into account the possibility that other threads will be
89+
* working with that context concurrently. Likewise, when a listener is
90+
* registered via {@code addNamingListener()}, the registering thread
91+
* must take into account the likely possibility that the service provider
92+
* will later invoke the listeners in newly-created threads. As {@code Context}
93+
* instances are not guaranteed to be thread-safe in general, all context
94+
* operations must be synchronized as needed.
95+
*
96+
* <h3>Exception Handling</h3>
97+
*
98+
* When a listener registers for events with a context, the context might
99+
* need to do some internal processing in order to collect information
100+
* required to generate the events. The context, for example, might need
101+
* to make a request to the server to register interest in changes
102+
* on the server that will eventually be translated into events.
103+
* If an exception occurs that prevents information about the events from
104+
* being collected, the listener will never be notified of the events.
105+
* When such an exception occurs, a {@code NamingExceptionEvent} is
106+
* fired to notify the listener. The listener's
107+
* {@code namingExceptionThrown()} method is invoked, as shown in the
108+
* sample code above,
109+
* and the listener is automatically deregistered.
110+
*
111+
* <h2>Package Specification</h2>
112+
*
113+
* The JNDI API Specification and related documents can be found in the
114+
* {@extLink jndi_overview JNDI documentation}.
115+
*
116+
* @since 1.3
117+
*/
118+
package javax.naming.event;

0 commit comments

Comments
 (0)