Revision 927f13fa
Added by Katja Luther almost 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/util/ProgressMonitorClientManager.java | ||
---|---|---|
87 | 87 |
// wait about 10 seconds for the remoting monitor to be initialised |
88 | 88 |
// (i.e. for the begin task method to be called ON THE REMOTING MONITOR) |
89 | 89 |
for(int i=0;i<START_DELAY;i++) { |
90 |
Thread.sleep(500);
|
|
90 |
Thread.sleep(10);
|
|
91 | 91 |
logger.info("Waiting for monitered work to start .."); |
92 | 92 |
remotingMonitor = progressMonitorService.getRemotingMonitor(uuid); |
93 |
if(remotingMonitor.getTotalWork() > 0) { |
|
93 |
if (remotingMonitor != null){ |
|
94 |
if(remotingMonitor.getTotalWork() > 0) { |
|
95 |
break; |
|
96 |
} |
|
94 | 97 |
break; |
95 | 98 |
} |
96 | 99 |
} |
100 |
|
|
101 |
if (remotingMonitor == null){ |
|
102 |
return null; |
|
103 |
} |
|
97 | 104 |
// if the total work is still not been set then we assume that the |
98 | 105 |
// operation has zero work units |
106 |
|
|
99 | 107 |
if(remotingMonitor.getTotalWork() == 0 && remotingMonitor.isDone()) { |
100 | 108 |
return remotingMonitor; |
101 |
// throw new InterruptedException("Monitor has zero work units"); |
|
109 |
|
|
102 | 110 |
}else if (remotingMonitor.getTotalWork() == 0 ){ |
103 | 111 |
Object result = remotingMonitor.getResult(); |
104 | 112 |
InterruptedException exception = new InterruptedException("Monitor has zero work units"); |
... | ... | |
161 | 169 |
} |
162 | 170 |
return remotingMonitor; |
163 | 171 |
} finally { |
164 |
if(postOp != null && remotingMonitor.isDone()) { |
|
172 |
if(postOp != null && remotingMonitor != null && remotingMonitor.isDone()) {
|
|
165 | 173 |
postOp.postOperation(remotingMonitor); |
166 | 174 |
} |
167 | 175 |
} |
Also available in: Unified diff
smaller changes in progressMonitorClientManager