|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--netscape.ldap.util.ConnectionPool
Connection pool, typically used by a server to avoid creating a new connection for each client
Constructor Summary | |
ConnectionPool(int min,
int max,
LDAPConnection ldc)
|
|
ConnectionPool(int min,
int max,
java.lang.String host,
int port)
Constructor for specifying all parameters, anonymous identity |
|
ConnectionPool(int min,
int max,
java.lang.String host,
int port,
java.lang.String authdn,
java.lang.String authpw)
Constructor for specifying all parameters |
|
ConnectionPool(java.lang.String host,
int port)
Constructor for using default parameters, anonymous identity |
Method Summary | |
void |
close(LDAPConnection ld)
This is our soft close - all we do is mark the connection as available for others to use. |
void |
destroy()
Destroy the whole pool - called during a shutdown |
LDAPConnection |
getConnection()
Gets a connection from the pool If no connections are available, the pool will be extended if the number of connections is less than the maximum; if the pool cannot be extended, the method blocks until a free connection becomes available. |
protected LDAPConnection |
getConnFromPool()
Gets a connection from the pool If no connections are available, the pool will be extended if the number of connections is less than the maximum; if the pool cannot be extended, the method returns null. |
boolean |
getDebug()
Reports the debug printout mode. |
void |
printPool()
Debug method to print the contents of the pool |
void |
setDebug(boolean mode)
Sets the debug printout mode. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ConnectionPool(int min, int max, java.lang.String host, int port, java.lang.String authdn, java.lang.String authpw) throws LDAPException
min
- initial number of connectionsmax
- maximum number of connectionshost
- hostname of LDAP serverport
- port number of LDAP serverauthdn
- DN to authenticate asauthpw
- password for authenticationpublic ConnectionPool(int min, int max, java.lang.String host, int port) throws LDAPException
min
- initial number of connectionsmax
- maximum number of connectionshost
- hostname of LDAP serverport
- port number of LDAP serverpublic ConnectionPool(java.lang.String host, int port) throws LDAPException
host
- hostname of LDAP serverport
- port number of LDAP serverpublic ConnectionPool(int min, int max, LDAPConnection ldc) throws LDAPException
Method Detail |
public void destroy()
public LDAPConnection getConnection()
protected LDAPConnection getConnFromPool()
public void close(LDAPConnection ld)
ld
- a connection to return to the poolpublic void printPool()
public void setDebug(boolean mode)
mode
- debug mode to usepublic boolean getDebug()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |