|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bibalex.daf.handlers.filehandler.FTPClientsPool
class FTPClientsPool
This class represents a pool of FTP clients, used to limit the number of FTPClients created while maintaning multithreading algorithm
| Field Summary | |
|---|---|
private java.util.Hashtable<java.lang.String,com.enterprisedt.net.ftp.FTPClient> |
freeFTPClients
|
private java.lang.String |
hostName
|
private java.util.Hashtable<java.lang.String,com.enterprisedt.net.ftp.FTPClient> |
inUseFTPClients
|
private java.lang.String |
password
|
private int |
poolSize
|
private java.lang.String |
userName
|
| Constructor Summary | |
|---|---|
FTPClientsPool(java.lang.String hostName,
java.lang.String userName,
java.lang.String password,
int poolSize)
Constructor |
|
| Method Summary | |
|---|---|
private com.enterprisedt.net.ftp.FTPClient |
createFTPClient()
Creates a new Object of the FTPClient, addressed privatly, when the pool is still empty |
(package private) com.enterprisedt.net.ftp.FTPClient |
getFTPClient()
Retives an existing instance of FTPClient, if there is a free one it is returned, if there is no and the pool size was not reached it creates a new one, If the pool is full and non is free it sends a wait signal |
(package private) void |
releaseFTPClient(com.enterprisedt.net.ftp.FTPClient ftpClient)
This method indicates that a specific FTPClient is no longer in use, It is then moved from the used Clients Hash to the free Clients Hash |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String hostName
private java.lang.String userName
private java.lang.String password
private int poolSize
private java.util.Hashtable<java.lang.String,com.enterprisedt.net.ftp.FTPClient> inUseFTPClients
private java.util.Hashtable<java.lang.String,com.enterprisedt.net.ftp.FTPClient> freeFTPClients
| Constructor Detail |
|---|
FTPClientsPool(java.lang.String hostName,
java.lang.String userName,
java.lang.String password,
int poolSize)
hostName - The Host Network Name or IPuserName - The User Name for the Connectionpassword - The Password for the ConnectionpoolSize - The Pool Size of the FTPClients| Method Detail |
|---|
private com.enterprisedt.net.ftp.FTPClient createFTPClient()
com.enterprisedt.net.ftp.FTPClient getFTPClient()
FTPClient instance free.void releaseFTPClient(com.enterprisedt.net.ftp.FTPClient ftpClient)
ftpClient - The FTPClient to be released
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||