Changeset 4118
- Timestamp:
- Feb 1, 2008, 3:00:32 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/Affymetrix.java
r4095 r4118 28 28 import net.sf.basedb.core.filehandler.CdfFileHandler; 29 29 import net.sf.basedb.core.filehandler.CelFileHandler; 30 import net.sf.basedb.core.signal.ThreadSignalHandler; 30 31 import affymetrix.fusion.cdf.FusionCDFData; 31 32 import affymetrix.fusion.cel.FusionCELData; … … 338 339 while (index < numProbesets) 339 340 { 341 ThreadSignalHandler.checkInterrupted(); 340 342 String probesetId = cdf.getProbeSetName(index); 341 343 if (!batcher.exists(probesetId, true, true)) -
trunk/src/core/net/sf/basedb/core/SpotImages.java
r4095 r4118 27 27 import net.sf.basedb.core.query.Orders; 28 28 import net.sf.basedb.core.query.Hql; 29 import net.sf.basedb.core.signal.ThreadSignalHandler; 29 30 import net.sf.basedb.core.data.SpotImagesData; 30 31 import net.sf.basedb.core.data.RawData; … … 385 386 throws PermissionDeniedException, InvalidDataException, BaseException 386 387 { 388 ThreadSignalHandler.checkInterrupted(); 387 389 checkPermission(Permission.WRITE); 388 390 if (spotImagesFile == null) throw new InvalidUseOfNullException("spotImagesFile"); … … 460 462 while (rawDataIterator.hasNext()) 461 463 { 464 ThreadSignalHandler.checkInterrupted(); 462 465 RawData rawData = rawDataIterator.next(); 463 466 -
trunk/src/core/net/sf/basedb/core/plugin/AbstractPlugin.java
r3994 r4118 33 33 import net.sf.basedb.core.SessionControl; 34 34 import net.sf.basedb.core.PluginParameter; 35 import net.sf.basedb.core.signal.SignalException; 36 import net.sf.basedb.core.signal.ThreadSignalHandler; 35 37 36 38 import java.util.Collection; … … 308 310 } 309 311 312 /** 313 Check if the current thread has been interrupted and throw 314 a SignalException if it has. Subclasses that use the {@link ThreadSignalHandler} 315 to implement signal handling should regularly call this method. 316 @since 2.6 317 */ 318 protected void checkInterrupted() 319 { 320 if (Thread.interrupted()) 321 { 322 throw new SignalException("Aborted by user"); 323 } 324 } 310 325 311 326 } -
trunk/src/core/net/sf/basedb/core/signal/ProgressReporterSignalHandler.java
r4078 r4118 37 37 uses with it's own progress reporter. Each time the plug-in calls 38 38 {@link ProgressReporter#display(int, String)} or {@link ProgressReporter#append(String)} 39 the signal handler will check if a signal has been receiver. If so,40 a {@link SignalReceivedException} will be thrown.39 and the percentage value is less than 100 the signal handler will check if a signal 40 has been received. If so, a {@link SignalReceivedException} will be thrown. 41 41 Here is a general outline of a plug-in that uses this signal handler: 42 42 … … 112 112 113 113 /** 114 The current percentage status. 115 */ 116 private int percent; 117 118 /** 119 When the progress has reached this limit signal 120 checking becomes disabled. Default value is 100. 121 */ 122 private int limit; 123 124 /** 114 125 Create a new progress reporter signal handler that supports the specified 115 126 signals. … … 121 132 super(supported); 122 133 this.received = Collections.synchronizedList(new ArrayList<Signal>()); 134 this.limit = 100; 123 135 } 124 136 … … 160 172 { 161 173 if (forwardTo != null) forwardTo.append(message); 162 checkForSignals();174 if (percent < limit) checkForSignals(); 163 175 } 164 176 public void display(int percent, String message) 165 177 { 166 178 if (forwardTo != null) forwardTo.display(percent, message); 167 checkForSignals(); 179 if (percent < limit) checkForSignals(); 180 this.percent = percent; 168 181 } 169 182 // ------------------------------------------- … … 208 221 209 222 /** 223 Get the percentage limit where signal checking becomes disabled. 224 @return The limit in percent 225 */ 226 public int getLimit() 227 { 228 return limit; 229 } 230 231 /** 232 Set the percentage limit. When the progress has reached the limit 233 signal checking will be disable. The default value is 100 since there is 234 no need to abort a process when it has already been finished. 235 @param limit The new limit 236 */ 237 public void setLimit(int limit) 238 { 239 this.limit = limit; 240 } 241 242 /** 210 243 If at least one signal has been received a {@link SignalReceivedException} 211 244 is thrown. This method clears the received signals. -
trunk/src/core/net/sf/basedb/core/signal/ThreadSignalHandler.java
r4078 r4118 79 79 { 80 80 81 /** 82 Utility method to check if the current thread has been interrupted and throws 83 a SignalException if it has. 84 */ 85 public static void checkInterrupted() 86 { 87 if (Thread.interrupted()) throw new SignalException("Aborted by user"); 88 } 89 90 81 91 /** 82 92 Log signals processing. -
trunk/src/core/net/sf/basedb/util/BioAssaySetFilterUtil.java
r4095 r4118 44 44 import net.sf.basedb.core.query.Restrictions; 45 45 import net.sf.basedb.core.query.SqlResult; 46 import net.sf.basedb.core.signal.ThreadSignalHandler; 46 47 47 48 import java.sql.SQLException; … … 87 88 88 89 if (progress != null) progress.display(5, "Initialising spot filter..."); 90 ThreadSignalHandler.checkInterrupted(); 89 91 90 92 // Create Transformation … … 126 128 int spotsAfter = 0; 127 129 if (progress != null) progress.display(10, "Filtering spots (0 done; "+spotsTotal+" total)..."); 128 130 129 131 // Create filter 130 132 if (bioAssays == null || bioAssays.size() == 0) bioAssays = parent.getBioAssays().list(dc); 131 133 for (BioAssay parentBa : bioAssays) 132 134 { 135 ThreadSignalHandler.checkInterrupted(); 133 136 BioAssay childBa = child.newBioAssay(parentBa); 134 137 dc.saveItemIf(child, childBa, false); … … 165 168 166 169 if (progress != null) progress.display(5, "Initialising spot filter..."); 170 ThreadSignalHandler.checkInterrupted(); 167 171 168 172 // Create Transformation … … 202 206 query.restrict(Restrictions.in(column, selectedColumns)); 203 207 } 204 208 205 209 // Prepare progress reporting 206 210 int interval = 10; // Update progress after this many spots >= 10 … … 213 217 progress.display(10, "Filtering spots (0 done; "+spotsTotal+" total)..."); 214 218 } 215 219 216 220 // Do the filtering 217 221 if (filter.useIncludeSpot()) … … 222 226 while (result.hasNext()) 223 227 { 228 ThreadSignalHandler.checkInterrupted(); 224 229 SqlResult data = result.next(); 225 230 if (filter.includeSpot(data)) -
trunk/src/core/net/sf/basedb/util/IntensityCalculatorUtil.java
r4095 r4118 56 56 import net.sf.basedb.core.query.Aggregations; 57 57 import net.sf.basedb.core.query.Expressions; 58 import net.sf.basedb.core.signal.ThreadSignalHandler; 58 59 import net.sf.basedb.util.jep.Jep; 59 60 import net.sf.basedb.util.jep.RawFunction; … … 161 162 162 163 checkSameArrayDesign(rawBioAssays, true); 164 ThreadSignalHandler.checkInterrupted(); 163 165 164 166 // Create Transformation … … 208 210 query.reset(); 209 211 first = false; 212 ThreadSignalHandler.checkInterrupted(); 210 213 } 211 214 … … 225 228 spotBatcher.insert(query); 226 229 query.reset(); 230 ThreadSignalHandler.checkInterrupted(); 227 231 228 232 // Map spot data to raw data … … 239 243 query.reset(); 240 244 rawBioAssaysDone++; 245 ThreadSignalHandler.checkInterrupted(); 241 246 } 242 247 … … 349 354 350 355 DataResultIterator<RawData> rawData = rawQuery.iterate(dc); 356 ThreadSignalHandler.checkInterrupted(); 351 357 //data -= System.nanoTime(); 352 358 while (rawData.hasNext()) 353 359 { 360 ThreadSignalHandler.checkInterrupted(); 354 361 RawData rd = rawData.next(); 355 362 int position = rd.getPosition(); -
trunk/src/core/net/sf/basedb/util/zip/AbstractFileUnpacker.java
r3675 r4118 56 56 import net.sf.basedb.core.plugin.Request; 57 57 import net.sf.basedb.core.plugin.Response; 58 import net.sf.basedb.core.signal.SignalHandler; 59 import net.sf.basedb.core.signal.SignalTarget; 60 import net.sf.basedb.core.signal.ThreadSignalHandler; 58 61 59 62 /** … … 80 83 public abstract class AbstractFileUnpacker 81 84 extends AbstractPlugin 82 implements FileUnpacker, InteractivePlugin 85 implements FileUnpacker, InteractivePlugin, SignalTarget 83 86 { 84 87 … … 104 107 105 108 private RequestInformation configureJob; 109 110 private ThreadSignalHandler signalHandler; 106 111 107 112 /* … … 246 251 } 247 252 // ------------------------------------------- 253 /* 254 From the SignalTarget interface 255 ------------------------------------------- 256 */ 257 public SignalHandler getSignalHandler() 258 { 259 signalHandler = new ThreadSignalHandler(); 260 return signalHandler; 261 } 262 // ------------------------------------------- 248 263 249 264 /** -
trunk/src/core/net/sf/basedb/util/zip/ZipUnpacker.java
r3675 r4118 40 40 import net.sf.basedb.core.Location; 41 41 import net.sf.basedb.core.Path; 42 import net.sf.basedb.core.signal.ThreadSignalHandler; 42 43 import net.sf.basedb.util.FileUtil; 43 44 import net.sf.basedb.util.Values; … … 95 96 while ((entry = zip.getNextEntry()) != null) 96 97 { 98 ThreadSignalHandler.checkInterrupted(); 97 99 String subPath = entry.getName(); 98 100 String completePath = rootPath + "/" + subPath; -
trunk/src/plugins/core/net/sf/basedb/plugins/AbstractFlatFileImporter.java
r4107 r4118 52 52 import net.sf.basedb.core.plugin.Response; 53 53 import net.sf.basedb.core.plugin.Plugin; 54 import net.sf.basedb.core.signal.SignalException;55 54 import net.sf.basedb.core.signal.SignalHandler; 56 55 import net.sf.basedb.core.signal.SignalTarget; … … 548 547 if (progress != null) progress.display(getProgress(ffp), "Parsing headers..."); 549 548 } 549 checkInterrupted(); 550 550 FlatFileParser.LineType result = ffp.parseHeaders(); 551 551 FlatFileParser.Line line = null; … … 574 574 } 575 575 } 576 // In case the server is shutting down... throw exception, rollback and quit577 if (Thread.interrupted()) throw new SignalException("Aborted by user.");578 576 } 577 checkInterrupted(); 579 578 } 580 579 catch (Throwable t) … … 620 619 } 621 620 // In case the server is shutting down... throw exception, rollback and quit 622 if (Thread.interrupted()) throw new SignalException("Aborted by user.");621 checkInterrupted(); 623 622 } 624 623 } -
trunk/src/plugins/core/net/sf/basedb/plugins/AnnotationFlatFileImporter.java
r4107 r4118 800 800 numError += na.getNumError(); 801 801 numReplaced += na.getNumReplaced(); 802 checkInterrupted(); 802 803 } 803 804 } -
trunk/src/plugins/core/net/sf/basedb/plugins/CdfFileReporterImporter.java
r4076 r4118 80 80 import net.sf.basedb.core.query.Hql; 81 81 import net.sf.basedb.core.query.Orders; 82 import net.sf.basedb.core.signal.SignalHandler; 83 import net.sf.basedb.core.signal.SignalTarget; 84 import net.sf.basedb.core.signal.ThreadSignalHandler; 82 85 import net.sf.basedb.util.FileUtil; 83 86 … … 97 100 public class CdfFileReporterImporter 98 101 extends AbstractPlugin 99 implements InteractivePlugin, AutoDetectingImporter 102 implements InteractivePlugin, AutoDetectingImporter, SignalTarget 100 103 { 101 104 … … 132 135 private RequestInformation configureJob; 133 136 137 private ThreadSignalHandler signalHandler; 138 134 139 /** 135 140 Constructor should be empty. … … 180 185 public void run(Request request, Response response, ProgressReporter progress) 181 186 { 187 if (signalHandler != null) signalHandler.setWorkerThread(null); 182 188 DbControl dc = sc.newDbControl(); 183 189 try … … 186 192 File cdfFile = (File)job.getValue("file"); 187 193 cdfFile = File.getById(dc, cdfFile.getId()); 194 checkInterrupted(); 188 195 FusionCDFData cdf = new CdfFileHandler().loadCdfFile(cdfFile); 189 196 … … 371 378 // ------------------------------------------- 372 379 373 380 /* 381 From the SignalTarget interface 382 ------------------------------------------- 383 */ 384 public SignalHandler getSignalHandler() 385 { 386 signalHandler = new ThreadSignalHandler(); 387 return signalHandler; 388 } 389 // ------------------------------------------- 390 374 391 private RequestInformation getConfigureJobParameters(GuiContext context) 375 392 { … … 462 479 private int importFromCdf(DbControl dc, FusionCDFData cdf, ProgressReporter progress) 463 480 { 481 checkInterrupted(); 482 464 483 ReporterBatcher batcher = ReporterBatcher.getNew(dc); 465 484 if (job.getValue("file") != null) -
trunk/src/plugins/core/net/sf/basedb/plugins/FormulaFilter.java
r3775 r4118 49 49 import net.sf.basedb.core.plugin.Response; 50 50 import net.sf.basedb.core.query.Restriction; 51 import net.sf.basedb.core.signal.SignalHandler; 52 import net.sf.basedb.core.signal.SignalTarget; 53 import net.sf.basedb.core.signal.ThreadSignalHandler; 51 54 import net.sf.basedb.util.BioAssaySetFilterUtil; 52 55 import net.sf.basedb.util.BioAssaySetUtil; … … 73 76 public class FormulaFilter 74 77 extends AbstractAnalysisPlugin 75 implements InteractivePlugin, AnalysisFilterPlugin 78 implements InteractivePlugin, AnalysisFilterPlugin, SignalTarget 76 79 { 77 80 … … 100 103 private RequestInformation configureJob; 101 104 105 private ThreadSignalHandler signalHandler; 106 102 107 /** 103 108 Constructor should be empty. … … 142 147 try 143 148 { 149 if (signalHandler != null) 150 { 151 signalHandler.setWorkerThread(null); 152 } 153 144 154 // Get all parameters 145 155 BioAssaySet source = getSourceBioAssaySet(dc); … … 159 169 // Parse filter expression 160 170 Restriction filter = BioAssaySetUtil.createJepRestriction(dc, source, expression, false); 171 172 checkInterrupted(); 161 173 162 174 if (includeLimit != null || excludeLimit != null) … … 256 268 response.setError(ex.getMessage(), Arrays.asList(ex)); 257 269 } 270 } 271 // ------------------------------------------- 272 /* 273 From the SignalTarget interface 274 ------------------------------------------- 275 */ 276 public SignalHandler getSignalHandler() 277 { 278 signalHandler = new ThreadSignalHandler(); 279 return signalHandler; 258 280 } 259 281 // ------------------------------------------- -
trunk/src/plugins/core/net/sf/basedb/plugins/IntensityCalculatorPlugin.java
r4078 r4118 57 57 import net.sf.basedb.core.query.Hql; 58 58 import net.sf.basedb.core.query.Orders; 59 import net.sf.basedb.core.signal.ProgressReporterSignalHandler;60 import net.sf.basedb.core.signal.Signal;61 59 import net.sf.basedb.core.signal.SignalHandler; 62 import net.sf.basedb.core.signal.SignalReceivedException;63 60 import net.sf.basedb.core.signal.SignalTarget; 61 import net.sf.basedb.core.signal.ThreadSignalHandler; 64 62 import net.sf.basedb.util.IntensityCalculator; 65 63 import net.sf.basedb.util.IntensityCalculatorUtil; … … 132 130 133 131 private RequestInformation configureJob; 134 private ProgressReporterSignalHandler signalHandler;132 private ThreadSignalHandler signalHandler; 135 133 136 134 /** … … 188 186 if (signalHandler != null) 189 187 { 190 signalHandler.forwardTo(progress); 191 progress = signalHandler; 188 signalHandler.setWorkerThread(null); 192 189 } 193 190 DbControl dc = sc.newDbControl(); … … 247 244 Job thisJob = Job.getById(dc, jobId); 248 245 246 checkInterrupted(); 249 247 BioAssaySet rootBas = null; 250 248 if (IntensityCalculatorUtil.checkSameArrayDesign(sources, false)) … … 274 272 if (progress != null) progress.display(100, "Done"); 275 273 response.setDone("Done"); 276 }277 catch (SignalReceivedException ex)278 {279 response.setError("Aborted by user", Arrays.asList(ex));280 274 } 281 275 catch (Throwable t) … … 434 428 public SignalHandler getSignalHandler() 435 429 { 436 signalHandler = new ProgressReporterSignalHandler(Collections.singleton(Signal.ABORT));430 signalHandler = new ThreadSignalHandler(); 437 431 return signalHandler; 438 432 } -
trunk/src/plugins/core/net/sf/basedb/plugins/JepExtraValueCalculator.java
r3675 r4118 55 55 import net.sf.basedb.core.query.Orders; 56 56 import net.sf.basedb.core.query.Selects; 57 import net.sf.basedb.core.signal.SignalHandler; 58 import net.sf.basedb.core.signal.SignalTarget; 59 import net.sf.basedb.core.signal.ThreadSignalHandler; 57 60 import net.sf.basedb.util.BioAssaySetUtil; 58 61 … … 76 79 public class JepExtraValueCalculator 77 80 extends AbstractAnalysisPlugin 78 implements InteractivePlugin 81 implements InteractivePlugin, SignalTarget 79 82 { 80 83 … … 105 108 ); 106 109 110 private ThreadSignalHandler signalHandler; 111 107 112 private RequestInformation configureJob; 108 113 … … 143 148 public void run(Request request, Response response, ProgressReporter progress) 144 149 { 150 if (signalHandler != null) signalHandler.setWorkerThread(null); 145 151 DbControl dc = sc.newDbControl(); 146 152 try … … 172 178 173 179 if (progress != null) progress.display(10, "Calculating extra value ("+source.getNumSpots()+" total)..."); 180 checkInterrupted(); 174 181 extraBatcher.insert(query); 175 182 … … 250 257 // ------------------------------------------- 251 258 259 /* 260 From the SignalTarget interface 261 ------------------------------------------- 262 */ 263 public SignalHandler getSignalHandler() 264 { 265 signalHandler = new ThreadSignalHandler(); 266 return signalHandler; 267 } 268 // ------------------------------------------- 252 269 253 270 private RequestInformation getConfigureJobParameters() -
trunk/src/plugins/core/net/sf/basedb/plugins/JepIntensityTransformer.java
r3675 r4118 62 62 import net.sf.basedb.core.query.Expression; 63 63 import net.sf.basedb.core.query.Selects; 64 import net.sf.basedb.core.signal.SignalHandler; 65 import net.sf.basedb.core.signal.SignalTarget; 66 import net.sf.basedb.core.signal.ThreadSignalHandler; 64 67 import net.sf.basedb.util.BioAssaySetUtil; 65 68 import net.sf.basedb.util.Values; … … 75 78 public class JepIntensityTransformer 76 79 extends AbstractAnalysisPlugin 77 implements InteractivePlugin 80 implements InteractivePlugin, SignalTarget 78 81 { 79 82 … … 98 101 new HashSet<GuiContext>(Arrays.asList(CONTEXT_BIOASSAYSET, CONTEXT_BIOASSAYS))); 99 102 103 private ThreadSignalHandler signalHandler; 100 104 private RequestInformation configureJob; 101 105 private List<PluginParameter<String>> channelParameters; … … 137 141 public void run(Request request, Response response, ProgressReporter progress) 138 142 { 143 if (signalHandler != null) signalHandler.setWorkerThread(null); 139 144 DbControl dc = sc.newDbControl(); 140 145 try … … 191 196 // Create the batchers we need 192 197 if (progress != null) progress.display(10, "Transforming intensities ("+source.getNumSpots()+" total)..."); 198 checkInterrupted(); 193 199 SpotBatcher spotBatcher = child.getSpotBatcher(); 194 200 spotBatcher.insert(query); … … 273 279 response.setError(ex.getMessage(), Arrays.asList(ex)); 274 280 } 281 } 282 // ------------------------------------------- 283 /* 284 From the SignalTarget interface 285 ------------------------------------------- 286 */ 287 public SignalHandler getSignalHandler() 288 { 289 signalHandler = new ThreadSignalHandler(); 290 return signalHandler; 275 291 } 276 292 // ------------------------------------------- -
trunk/src/plugins/core/net/sf/basedb/plugins/LowessNormalization.java
r4095 r4118 67 67 import net.sf.basedb.core.query.SqlResult; 68 68 import net.sf.basedb.core.query.WhenStatement; 69 import net.sf.basedb.core.signal.ProgressReporterSignalHandler;70 import net.sf.basedb.core.signal.Signal;71 69 import net.sf.basedb.core.signal.SignalHandler; 72 70 import net.sf.basedb.core.signal.SignalReceivedException; 73 71 import net.sf.basedb.core.signal.SignalTarget; 72 import net.sf.basedb.core.signal.ThreadSignalHandler; 74 73 import net.sf.basedb.util.Values; 75 74 … … 170 169 private RequestInformation configureJob; 171 170 172 private ProgressReporterSignalHandler signalHandler;171 private ThreadSignalHandler signalHandler; 173 172 174 173 /* … … 210 209 if (signalHandler != null) 211 210 { 212 signalHandler.forwardTo(progress); 213 progress = signalHandler; 211 signalHandler.setWorkerThread(null); 214 212 } 215 213 DbControl dc = null; … … 236 234 response.setDone(normalizedSpots + " spots normalized, " + (source.getNumSpots() - normalizedSpots) + " spots removed"); 237 235 } 238 catch (SignalReceivedException ex)239 {240 response.setError("Aborted by user", Arrays.asList(ex));241 }242 236 catch (Throwable ex) 243 237 { … … 338 332 public SignalHandler getSignalHandler() 339 333 { 340 signalHandler = new ProgressReporterSignalHandler(Collections.singleton(Signal.ABORT));334 signalHandler = new ThreadSignalHandler(); 341 335 return signalHandler; 342 336 } … … 408 402 query.restrict(intensityRestriction); 409 403 long numSpots = query.count(dc); 404 checkInterrupted(); 405 410 406 long normalizedSpots = 0; 411 407 if (progress != null) progress.display((int)(normalizedSpots / numSpots * 100), normalizedSpots + " spots normalized"); … … 423 419 // Create query to retrieve spot data: COLUMN, POSITION, ch1, ch2, block, present 424 420 // We use a parameter to restrict the query to return data for one bioassay at a time 425 // The ' exclude' value is 0 to not exclude and 1 to exclude a spot421 // The 'present' value is 0 to not exclude and 1 to exclude a spot 426 422 query.select(Dynamic.select(VirtualColumn.POSITION)); 427 423 query.select(Selects.expression(ch1, "ch1")); … … 434 430 // Normalize one bioassay at a time 435 431 List<BioAssay> assays = source.getBioAssays().list(dc); 432 checkInterrupted(); 436 433 437 434 try … … 448 445 449 446 DynamicResultIterator it = query.iterate(dc); 447 checkInterrupted(); 450 448 int positionIndex = it.getIndex(VirtualColumn.POSITION.getName()); 451 449 int ch1Index = it.getIndex("ch1"); … … 464 462 } 465 463 it.close(); 464 checkInterrupted(); 466 465 467 466 // Continue with next bioassay if there is no data … … 497 496 Collections.sort(toNormalize); 498 497 List<Double> smoothCurve = lowess(toNormalize, fitFraction, iterations, delta); 498 checkInterrupted(); 499 499 for (int j = 0; j < smoothCurve.size(); ++j) 500 500 { … … 503 503 batcher.insert(bioassayColumn, spot.position, (float)(spot.ch1/factor), (float)(spot.ch2*factor)); 504 504 } 505 checkInterrupted(); 505 506 normalizedSpots += smoothCurve.size(); 506 507 if (progress != null) progress.display((int)((normalizedSpots * 100L) / numSpots), normalizedSpots + " spots normalized"); … … 581 582 } 582 583 583 private staticList<Double> lowess(List<SpotData> data, double f, int iter, double delta)584 private List<Double> lowess(List<SpotData> data, double f, int iter, double delta) 584 585 { 585 586 int dataSize = data.size(); … … 591 592 for (int iteration = 0; iteration < iter; ++iteration) 592 593 { 594 checkInterrupted(); 593 595 int windowStart = 0; 594 596 int i = 0; -
trunk/src/plugins/core/net/sf/basedb/plugins/PackedFileExporter.java
r4095 r4118 58 58 import net.sf.basedb.core.query.Hql; 59 59 import net.sf.basedb.core.query.Orders; 60 import net.sf.basedb.core.signal.SignalHandler; 61 import net.sf.basedb.core.signal.SignalTarget; 62 import net.sf.basedb.core.signal.ThreadSignalHandler; 60 63 import net.sf.basedb.util.Values; 61 64 import net.sf.basedb.util.zip.FilePacker; … … 90 93 public class PackedFileExporter 91 94 extends AbstractExporterPlugin 92 implements InteractivePlugin 95 implements InteractivePlugin, SignalTarget 93 96 { 94 97 … … 125 128 private long totalBytes; 126 129 private List<Nameable> selectedFilesAndDirs; 130 131 private ThreadSignalHandler signalHandler; 127 132 128 133 /** … … 354 359 throws IOException 355 360 { 361 if (signalHandler != null) signalHandler.setWorkerThread(null); 362 356 363 // Get parameters 357 364 Directory rootDir = (Directory)job.getValue("root"); … … 385 392 for (Nameable item : itemsToPack) 386 393 { 394 checkInterrupted(); 387 395 currentFile++; 388 396 String entryPath = null; … … 439 447 { 440 448 return numFiles + " file(s) and directories compressed successfully."; 449 } 450 // ------------------------------------------- 451 /* 452 From the SignalTarget interface 453 ------------------------------------------- 454 */ 455 public SignalHandler getSignalHandler() 456 { 457 signalHandler = new ThreadSignalHandler(); 458 return signalHandler; 441 459 } 442 460 // ------------------------------------------- … … 563 581 for (Integer fileId : files) 564 582 { 583 checkInterrupted(); 565 584 try 566 585 { … … 578 597 for (Integer dirId : directories) 579 598 { 599 checkInterrupted(); 580 600 try 581 601 { … … 604 624 for (File f : fileQuery.list(dc)) 605 625 { 626 checkInterrupted(); 606 627 loadedFiles.add(f); 607 628 if (f.getLocation() == Location.PRIMARY) totalBytes += f.getSize(); … … 614 635 for (Directory dir : dirQuery.list(dc)) 615 636 { 637 checkInterrupted(); 616 638 loadedFiles.add(dir); 617 639 loadFiles(dc, loadedFiles, dir); -
trunk/src/plugins/core/net/sf/basedb/plugins/SpotImageCreator.java
r3679 r4118 40 40 import net.sf.basedb.core.plugin.Request; 41 41 import net.sf.basedb.core.plugin.Response; 42 import net.sf.basedb.core.signal.SignalHandler; 43 import net.sf.basedb.core.signal.SignalTarget; 44 import net.sf.basedb.core.signal.ThreadSignalHandler; 42 45 43 46 import java.util.Arrays; … … 54 57 public class SpotImageCreator 55 58 extends AbstractPlugin 56 implements Plugin 59 implements Plugin, SignalTarget 57 60 { 58 61 … … 74 77 private static final Set<Permissions> permissions = new HashSet<Permissions>(); 75 78 79 private ThreadSignalHandler signalHandler; 80 76 81 /* 77 82 From the Plugin interface … … 162 167 } 163 168 // ------------------------------------------- 169 /* 170 From the SignalTarget interface 171 ------------------------------------------- 172 */ 173 public SignalHandler getSignalHandler() 174 { 175 signalHandler = new ThreadSignalHandler(); 176 return signalHandler; 177 } 178 // ------------------------------------------- 164 179 165 180 } -
trunk/src/plugins/core/net/sf/basedb/plugins/TarFileUnpacker.java
r4095 r4118 164 164 while ((entry = TarUtil.getNextEntry(tarStream)) != null) 165 165 { 166 checkInterrupted(); 166 167 String subPath = entry.getName(); 167 168 String completePath = rootPath + "/" + subPath; -
trunk/www/common/plugin/download_immediately.jsp
r3675 r4118 85 85 <td width="50%"><base:button id="download" onclick="downloadExport();" title="Download" 86 86 image="download.gif" /></td> 87 <td width="50%"><base:button onclick="doCancel();" title="C lose" /></td>87 <td width="50%"><base:button onclick="doCancel();" title="Cancel" /></td> 88 88 </tr> 89 89 </table>
Note: See TracChangeset
for help on using the changeset viewer.