|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetscape.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)
Constructor for using an existing connection to clone from. |
|
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. |
LDAPConnection |
getConnection(int timeout)
Gets a connection from the pool within a time limit. |
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 authentication
LDAPException
- on failure to create connectionspublic 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 server
LDAPException
- on failure to create connectionspublic ConnectionPool(java.lang.String host, int port) throws LDAPException
host
- hostname of LDAP serverport
- port number of LDAP server
LDAPException
- on failure to create connectionspublic ConnectionPool(int min, int max, LDAPConnection ldc) throws LDAPException
The connection to clone must be already established and the user authenticated.
min
- initial number of connectionsmax
- maximum number of connectionsldc
- connection to clone
LDAPException
- on failure to create connectionsMethod Detail |
public void destroy()
public LDAPConnection getConnection()
public LDAPConnection getConnection(int timeout)
timeout
- timeout in milliseconds
null
if timed out.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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |