equal
deleted
inserted
replaced
37 import java.security.AccessController; |
37 import java.security.AccessController; |
38 import java.security.PrivilegedAction; |
38 import java.security.PrivilegedAction; |
39 |
39 |
40 import com.sun.jndi.ldap.pool.PoolCleaner; |
40 import com.sun.jndi.ldap.pool.PoolCleaner; |
41 import com.sun.jndi.ldap.pool.Pool; |
41 import com.sun.jndi.ldap.pool.Pool; |
|
42 import jdk.internal.misc.InnocuousThread; |
42 |
43 |
43 /** |
44 /** |
44 * Contains utilities for managing connection pools of LdapClient. |
45 * Contains utilities for managing connection pools of LdapClient. |
45 * Contains method for |
46 * Contains method for |
46 * - checking whether attempted connection creation may be pooled |
47 * - checking whether attempted connection creation may be pooled |
161 } |
162 } |
162 } |
163 } |
163 |
164 |
164 if (idleTimeout > 0) { |
165 if (idleTimeout > 0) { |
165 // Create cleaner to expire idle connections |
166 // Create cleaner to expire idle connections |
166 new PoolCleaner(idleTimeout, pools).start(); |
167 PrivilegedAction<Void> pa = new PrivilegedAction<Void>() { |
|
168 public Void run() { |
|
169 Thread t = InnocuousThread.newSystemThread( |
|
170 "LDAP PoolCleaner", |
|
171 new PoolCleaner(idleTimeout, pools)); |
|
172 assert t.getContextClassLoader() == null; |
|
173 t.setDaemon(true); |
|
174 t.start(); |
|
175 return null; |
|
176 }}; |
|
177 AccessController.doPrivileged(pa); |
167 } |
178 } |
168 |
179 |
169 if (debug) { |
180 if (debug) { |
170 showStats(System.err); |
181 showStats(System.err); |
171 } |
182 } |