This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
TargetServer.doDeploy method calls distribute() on DeploymentManager and then immediately start(). This is wrong because distribute is asynchronous operation and may not be finished before start() is called and result status is not consulted. Timers in TargetServer are useless except for debug prints. We should avoid these two inner classes. DeployProgressMonitor will not close when operation is completed earlier than listener is attached (ProgressObject can be set directly to completed/failed status). It means that status has to be consulted at the begining to check for completed or failed value. BTW: this bug comes from bad design in JSR88.
Actually the code in this file became a bit messy as it grows from archive deployment into additional functionality like redeploy, incremental and in-place deployment, touched by many people. It is time to cleanup. The check for deployment status even before attahcing a handler to the ProgressObject has already been added during incremental deployment implementation. The practice had not been applied to other kind of deployements. I has spent a day today cleaning-up and refactoring the deploy code/logic to make it more bullet-proof and maintainable. About JSR-88 deployemnet architecture, I am not sure I got your point. Maybe its better for the deployer to pass the ProgressObject as argument instead of receiving as returned? This way the calls could be synchronous.
I think my cleanup is reasonable to close this issue. Please reopen if not so.