< prev index next >

src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java

Print this page




  27 
  28 import javax.naming.*;
  29 import javax.naming.directory.*;
  30 import javax.naming.spi.*;
  31 import javax.naming.event.*;
  32 import javax.naming.ldap.*;
  33 import javax.naming.ldap.LdapName;
  34 import javax.naming.ldap.Rdn;
  35 
  36 import java.util.Locale;
  37 import java.util.Vector;
  38 import java.util.Hashtable;
  39 import java.util.List;
  40 import java.util.StringTokenizer;
  41 import java.util.Enumeration;
  42 
  43 import java.io.IOException;
  44 import java.io.OutputStream;
  45 
  46 import com.sun.jndi.toolkit.ctx.*;

  47 import com.sun.jndi.toolkit.dir.HierMemDirCtx;
  48 import com.sun.jndi.toolkit.dir.SearchFilter;
  49 import com.sun.jndi.ldap.ext.StartTlsResponseImpl;
  50 
  51 /**
  52  * The LDAP context implementation.
  53  *
  54  * Implementation is not thread-safe. Caller must sync as per JNDI spec.
  55  * Members that are used directly or indirectly by internal worker threads
  56  * (Connection, EventQueue, NamingEventNotifier) must be thread-safe.
  57  * Connection - calls LdapClient.processUnsolicited(), which in turn calls
  58  *   LdapCtx.convertControls() and LdapCtx.fireUnsolicited().
  59  *   convertControls() - no sync; reads envprops and 'this'
  60  *   fireUnsolicited() - sync on eventSupport for all references to 'unsolicited'
  61  *      (even those in other methods);  don't sync on LdapCtx in case caller
  62  *      is already sync'ing on it - this would prevent Unsol events from firing
  63  *      and the Connection thread to block (thus preventing any other data
  64  *      from being read from the connection)
  65  *      References to 'eventSupport' need not be sync'ed because these
  66  *      methods can only be called after eventSupport has been set first




  27 
  28 import javax.naming.*;
  29 import javax.naming.directory.*;
  30 import javax.naming.spi.*;
  31 import javax.naming.event.*;
  32 import javax.naming.ldap.*;
  33 import javax.naming.ldap.LdapName;
  34 import javax.naming.ldap.Rdn;
  35 
  36 import java.util.Locale;
  37 import java.util.Vector;
  38 import java.util.Hashtable;
  39 import java.util.List;
  40 import java.util.StringTokenizer;
  41 import java.util.Enumeration;
  42 
  43 import java.io.IOException;
  44 import java.io.OutputStream;
  45 
  46 import com.sun.jndi.toolkit.ctx.*;
  47 import com.sun.jndi.toolkit.ctx.Continuation;
  48 import com.sun.jndi.toolkit.dir.HierMemDirCtx;
  49 import com.sun.jndi.toolkit.dir.SearchFilter;
  50 import com.sun.jndi.ldap.ext.StartTlsResponseImpl;
  51 
  52 /**
  53  * The LDAP context implementation.
  54  *
  55  * Implementation is not thread-safe. Caller must sync as per JNDI spec.
  56  * Members that are used directly or indirectly by internal worker threads
  57  * (Connection, EventQueue, NamingEventNotifier) must be thread-safe.
  58  * Connection - calls LdapClient.processUnsolicited(), which in turn calls
  59  *   LdapCtx.convertControls() and LdapCtx.fireUnsolicited().
  60  *   convertControls() - no sync; reads envprops and 'this'
  61  *   fireUnsolicited() - sync on eventSupport for all references to 'unsolicited'
  62  *      (even those in other methods);  don't sync on LdapCtx in case caller
  63  *      is already sync'ing on it - this would prevent Unsol events from firing
  64  *      and the Connection thread to block (thus preventing any other data
  65  *      from being read from the connection)
  66  *      References to 'eventSupport' need not be sync'ed because these
  67  *      methods can only be called after eventSupport has been set first


< prev index next >