I have done a Download manager that works just fine. I need to re-write just a tiny bit of it with a monitor (multi-thread) It is not so much work but I cant get it to work proberlyI need this:

I got all the code for a running app and need to rewrite so it works with the multi-thread(notify, wait)

The Downloader class

This class inherits from Thread and, of course, has a run()-method where all its work is done. As it is supposed to download a networked file, it will need a URL. The controller will notify each thread when the URL is written to disk. This means the Downloader class constructor must have a parameter that is a reference to a Controller object (a method in the Controller class is called from each Downloader instance). When notified that there is a URL available, a Downloader should read that URL from a file (with a fixed name, in a fixed place (preferably in the working directory)), delete the file and then proceed to download the networked file to disk (preferably to the working directory). This means that each thread in its run() method should call the Controllers getURL() method (see below).

The Controller class

This class plays the role of monitor. There should be a method in this class called getURL() that will be called by the individual threads. This means that this method should be synchronized and use wait() and notify() calls. There should also be a boolean in this class, indicating whether there is a URL-file for consumption. This boolean will be used by the main() method (see below). When the Controller has notified a Downloader that there is a URL file to be consumed, the boolean should be reset (false).

Habilidades: Java

Veja mais: Multi thread, get download manager, tiny app, thread, multi, java thread, java monitor, download manager, boolean, java means, file manager java app, app java download, app download java, code disk, java app download, call method, app downloader, call manager app, java url parameter, place bit, object method, app download manager, monitor app, java synchronized, call code java

Acerca do Empregador:
( 143 comentários ) Norway, Sweden

ID do Projeto: #569105

Concedido a:


I can do this project withnot deadlock. Please contract me.

$30 USD em 0 dias
(3 Comentários)

3 freelancers estão ofertando em média $30 para esse trabalho


sir , i have three years experience in java. i use multi-threading in many project in university . i am ready to work.....

$30 USD in 2 dias
(3 Comentários)

I suggest using the Command pattern would suit your needs better. So you would wrap each download task up in its own object (implementing Runnable) and then dispatch this onto a [login to view URL] Mais

$30 USD em 1 dia
(0 Comentários)