|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jndi.ldap.LdapClient
public final class LdapClient
LDAP (RFC-1777) and LDAPv3 (RFC-2251) compliant client This class represents a connection to an LDAP client. Callers interact with this class at an LDAP operation level. That is, the caller invokes a method to do a SEARCH or MODRDN operation and gets back the result. The caller uses the constructor to create a connection to the server. It then needs to use authenticate() to perform an LDAP BIND. Note that for v3, BIND is optional so authenticate() might not actually send a BIND. authenticate() can be used later on to issue a BIND, for example, for a v3 client that wants to change the connection's credentials.
Multiple LdapCtx might share the same LdapClient. For example, contexts derived from the same initial context would share the same LdapClient until changes to a context's properties necessitates its own LdapClient. LdapClient methods that access shared data are thread-safe (i.e., caller does not have to sync).
Fields: isLdapv3 - no sync; initialized and updated within sync authenticate(); always updated when connection is "quiet" and not shared; read access from outside LdapClient not sync referenceCount - sync within LdapClient; exception is forceClose() which is used by Connection thread to close connection upon receiving an Unsolicited Notification. access from outside LdapClient must sync; conn - no sync; Connection takes care of its own sync unsolicited - sync Vector; multiple operations sync'ed
| Method Summary | |
|---|---|
void |
closeConnection()
Closes the physical connection. |
protected void |
finalize()
finalize may be called by the memory management of the virtual machine when it determined that this instance's memory is unreachable and can be reclaimed. |
LdapResult |
ldapBind(String dn,
byte[] toServer,
Control[] bindCtls,
String auth,
boolean pauseAfterReceipt)
Sends an LDAP Bind request. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public LdapResult ldapBind(String dn,
byte[] toServer,
Control[] bindCtls,
String auth,
boolean pauseAfterReceipt)
throws IOException,
NamingException
dn - The possibly null DN to use in the BIND request. null if anonymous.toServer - The possibly null array of bytes to send to the server.auth - The authentication mechanism
IOException
NamingExceptionprotected void finalize()
ObjectNOTE: The use of finalize() is strongly discouraged for realtime or safety-critical code. This method should only be used for debugging purposes. If used as a last resort to reclaim non-memory resouces, finalize() should indicate the resource leak with a loud error message.
There is no guarantee that finalize() will be called, the memory management may decide not to reclaim this object's memory or to delay the call to finalize() to an unspecified point in time. It is therefore recommended never to use the finalize method to release any resources (files, network connections, non-Java memory, etc.) since releasing of these resource may be delayed perpetually.
The order of finalization is not specified, i.e., the finalize method of any two objects that become unreachable may be called in an arbitrary order. It therefore has to be assumed that when finalize() is called on an object, that the finalize() method of any object that is only reachable through this object() has been called as well or is called simultaneously by another thread.
The presence of a finalize-method in any sub-class of Object causes the reclamation of the memory of this object to be delayed until the finalize() method has been executed. The finalize() method is typically executed by the finalizer thread (that may run at a low priority) or by a call to Runtime.runFinalization().
Any code sequence that creates instances of a class that defines a finalize() method must therefore ensure that sufficient CPU time is allocated to the finalizer thread or that Runtime.runFinalization() is called regularly such that the finalize() methods can be executed and the object's memory can be reclaimed.
The finalize method itself should never block or run for long times since it would otherwise block the finalizer thread or the thread that called Runtime.runFinalization() and prevent the execution other finalize() method and consequently prevent the reclamation of these object's memory.
For objects that are allocated in a javax.realtime.ScopedMemory, the finalize() methods will be called when this scoped memory is exited by the last thread. Unlike HeapMemory, which is controlled by the garbage collector, ScopedMemory provides a defined execution point for the finalize() mehods and it is therefore safer to use finalize() here.
finalize in class Objectpublic void closeConnection()
PooledConnection
closeConnection in interface PooledConnection
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||