Lines 11-17
Link Here
|
11 |
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. |
11 |
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. |
12 |
* |
12 |
* |
13 |
* Contributors: |
13 |
* Contributors: |
14 |
* Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes |
14 |
* Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes |
|
|
15 |
* David McKnight (IBM) - [190803] Canceling a long-running dstore job prints "InterruptedException" to stdout |
15 |
********************************************************************************/ |
16 |
********************************************************************************/ |
16 |
|
17 |
|
17 |
package org.eclipse.rse.services.dstore; |
18 |
package org.eclipse.rse.services.dstore; |
Lines 87-97
Link Here
|
87 |
DStoreStatusMonitor smon = getStatusMonitor(getDataStore()); |
88 |
DStoreStatusMonitor smon = getStatusMonitor(getDataStore()); |
88 |
smon.waitForUpdate(status, monitor); |
89 |
smon.waitForUpdate(status, monitor); |
89 |
int resultSize = subject.getNestedSize(); |
90 |
int resultSize = subject.getNestedSize(); |
90 |
if (resultSize == 0) |
91 |
|
91 |
{ |
|
|
92 |
//System.out.println("status="+status); |
93 |
//System.out.println("subject="+subject); |
94 |
} |
95 |
checkHostJVM(); |
92 |
checkHostJVM(); |
96 |
// get results |
93 |
// get results |
97 |
List nested = subject.getNestedData(); |
94 |
List nested = subject.getNestedData(); |
Lines 100-114
Link Here
|
100 |
return (DataElement[])nested.toArray(new DataElement[resultSize]); |
97 |
return (DataElement[])nested.toArray(new DataElement[resultSize]); |
101 |
} |
98 |
} |
102 |
} |
99 |
} |
103 |
catch (Exception e) |
100 |
catch (InterruptedException e) |
104 |
{ |
101 |
{ |
105 |
e.printStackTrace(); |
102 |
// cancel monitor if it's still not canceled |
|
|
103 |
if (monitor != null && !monitor.isCanceled()) |
104 |
{ |
105 |
monitor.setCanceled(true); |
106 |
} |
107 |
|
108 |
//InterruptedException is used to report user cancellation, so no need to log |
109 |
//This should be reviewed (use OperationCanceledException) with bug #190750 |
106 |
} |
110 |
} |
107 |
} |
111 |
} |
108 |
else |
112 |
|
109 |
{ |
|
|
110 |
System.out.println("no query command for "+ subject); //$NON-NLS-1$ |
111 |
} |
112 |
return new DataElement[0]; |
113 |
return new DataElement[0]; |
113 |
} |
114 |
} |
114 |
|
115 |
|
Lines 125-132
Link Here
|
125 |
DStoreStatusMonitor smon = getStatusMonitor(getDataStore()); |
126 |
DStoreStatusMonitor smon = getStatusMonitor(getDataStore()); |
126 |
smon.waitForUpdate(status, monitor); |
127 |
smon.waitForUpdate(status, monitor); |
127 |
} |
128 |
} |
128 |
catch (Exception e) |
129 |
catch (InterruptedException e) |
129 |
{ |
130 |
{ |
|
|
131 |
// cancel monitor if it's still not canceled |
132 |
if (monitor != null && !monitor.isCanceled()) |
133 |
{ |
134 |
monitor.setCanceled(true); |
135 |
} |
136 |
|
137 |
//InterruptedException is used to report user cancellation, so no need to log |
138 |
//This should be reviewed (use OperationCanceledException) with bug #190750 |
130 |
} |
139 |
} |
131 |
return status; |
140 |
return status; |
132 |
} |
141 |
} |
Lines 153-161
Link Here
|
153 |
return (DataElement[])nested.toArray(new DataElement[subject.getNestedSize()]); |
162 |
return (DataElement[])nested.toArray(new DataElement[subject.getNestedSize()]); |
154 |
} |
163 |
} |
155 |
} |
164 |
} |
156 |
catch (Exception e) |
165 |
catch (InterruptedException e) |
157 |
{ |
166 |
{ |
158 |
e.printStackTrace(); |
167 |
// cancel monitor if it's still not canceled |
|
|
168 |
if (monitor != null && !monitor.isCanceled()) |
169 |
{ |
170 |
monitor.setCanceled(true); |
171 |
} |
172 |
|
173 |
//InterruptedException is used to report user cancellation, so no need to log |
174 |
//This should be reviewed (use OperationCanceledException) with bug #190750 |
159 |
} |
175 |
} |
160 |
} |
176 |
} |
161 |
return new DataElement[0]; |
177 |
return new DataElement[0]; |
Lines 174-181
Link Here
|
174 |
{ |
190 |
{ |
175 |
getStatusMonitor(ds).waitForUpdate(status, monitor); |
191 |
getStatusMonitor(ds).waitForUpdate(status, monitor); |
176 |
} |
192 |
} |
177 |
catch (Exception e) |
193 |
catch (InterruptedException e) |
178 |
{ |
194 |
{ |
|
|
195 |
// cancel monitor if it's still not canceled |
196 |
if (monitor != null && !monitor.isCanceled()) |
197 |
{ |
198 |
monitor.setCanceled(true); |
199 |
} |
200 |
|
201 |
//InterruptedException is used to report user cancellation, so no need to log |
202 |
//This should be reviewed (use OperationCanceledException) with bug #190750 |
203 |
|
179 |
} |
204 |
} |
180 |
return status; |
205 |
return status; |
181 |
} |
206 |
} |
Lines 252-258
Link Here
|
252 |
} |
277 |
} |
253 |
catch (InterruptedException e) |
278 |
catch (InterruptedException e) |
254 |
{ |
279 |
{ |
255 |
e.printStackTrace(); |
280 |
// cancel monitor if it's still not canceled |
|
|
281 |
if (monitor != null && !monitor.isCanceled()) |
282 |
{ |
283 |
monitor.setCanceled(true); |
284 |
} |
285 |
|
286 |
//InterruptedException is used to report user cancellation, so no need to log |
287 |
//This should be reviewed (use OperationCanceledException) with bug #190750 |
256 |
} |
288 |
} |
257 |
|
289 |
|
258 |
getMinerElement(); |
290 |
getMinerElement(); |