Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
6.2k views
in Java FTP by
Please excuse my "leanring-java" mode - I'm learning but this is a need help meltdown !!!
I have a process that spawns multiple threads all of which are doing
ftp - each gets it's own client with : theclient = new FTPClient(ftp_loc) ;
The base process is working fine -
I want to use the progress monitor for each client object -
I am using the sample code as in the sample
theclient.setProgressMonitor(new TestProgressMonitor(), WW );
- works fine when testing - ie when 1 thread is running - then I know that the returned count applies to this thread's ftp -
since this is an interface - If multiple threads all do the same is there 1 progressmonitor or one per ftp client ??? - trying to force the returned count to also tell me who he is counting FOR ( ie the thread ) is proving a problem.
Since I cant use public variables or non-static data in my TestProgressMonitor class (interface is static ? ) I am assuming there can only be 1 monitor object in memory, therefore I would have to synchronize access to it - that makes it unusable for my multi ftp process
doesnt it ???

2 Answers

0 votes
by (162k points)
If each thread has an FTPCLient, you should have one monitor per thread. If you want to identify the progress monitors, pass the thread name into the progress monitor's constructor (you'll have to modify it of course)
0 votes
by
thanks - I will do that that -will report back when I get it working - thanks for your help -

Categories

...