title: Listing Processes if Any Process Exist Java
body: <p>I'm developing a deployment project. I have an user interface for it and I binded interface with server via RPC Callback. I've used SmartGWT for interface.</p>
  
  <p>My project simply downloads war file from a path, and deploys it to the server. Also I have a timer checks for updated version every 24 hours. 
  My problem is that, How can I prevent my program to run twice at same time?
  Firstly I though about disabling the "execute" button from interface, but this doesn't work properly if user refreshes page, or timer and user process works at same time. Then I though about using Singleton Pattern to solve this. Assuming that my FTP class called, ftp.DownloadFile method will start a long running download process. How can I determine if download process, or other processes are running? How can I list the requests from user while I already have a process? </p>