1 11 package org.eclipse.core.runtime.jobs; 12 13 import org.eclipse.core.internal.jobs.InternalJob; 14 import org.eclipse.core.internal.jobs.JobManager; 15 import org.eclipse.core.runtime.*; 16 17 44 public abstract class Job extends InternalJob implements IAdaptable { 45 46 51 public static final IStatus ASYNC_FINISH = new Status(IStatus.OK, JobManager.PI_JOBS, 1, "", null); 53 54 64 public static final int INTERACTIVE = 10; 65 75 public static final int SHORT = 20; 76 83 public static final int LONG = 30; 84 92 public static final int BUILD = 40; 93 94 104 public static final int DECORATE = 50; 105 112 public static final int NONE = 0; 113 119 public static final int SLEEPING = 0x01; 120 125 public static final int WAITING = 0x02; 126 131 public static final int RUNNING = 0x04; 132 133 139 public static final IJobManager getJobManager() { 140 return manager; 141 } 142 143 150 public Job(String name) { 151 super(name); 152 } 153 154 160 public final void addJobChangeListener(IJobChangeListener listener) { 161 super.addJobChangeListener(listener); 162 } 163 164 179 public boolean belongsTo(Object family) { 180 return false; 181 } 182 183 193 public final boolean cancel() { 194 return super.cancel(); 195 } 196 197 205 protected void canceling() { 206 } 208 209 224 public final void done(IStatus result) { 225 super.done(result); 226 } 227 228 234 public final String getName() { 235 return super.getName(); 236 } 237 238 245 public final int getPriority() { 246 return super.getPriority(); 247 } 248 249 258 public final Object getProperty(QualifiedName key) { 259 return super.getProperty(key); 260 } 261 262 268 public final IStatus getResult() { 269 return super.getResult(); 270 } 271 272 280 public final ISchedulingRule getRule() { 281 return super.getRule(); 282 } 283 284 302 public final int getState() { 303 return super.getState(); 304 } 305 306 312 public final Thread getThread() { 313 return super.getThread(); 314 } 315 316 326 public final boolean isBlocking() { 327 return super.isBlocking(); 328 } 329 330 340 public final boolean isSystem() { 341 return super.isSystem(); 342 } 343 344 353 public final boolean isUser() { 354 return super.isUser(); 355 } 356 357 383 public final void join() throws InterruptedException { 384 super.join(); 385 } 386 387 393 public final void removeJobChangeListener(IJobChangeListener listener) { 394 super.removeJobChangeListener(listener); 395 } 396 397 423 protected abstract IStatus run(IProgressMonitor monitor); 424 425 434 public final void schedule() { 435 super.schedule(0L); 436 } 437 438 460 public final void schedule(long delay) { 461 super.schedule(delay); 462 } 463 464 474 public final void setName(String name) { 475 super.setName(name); 476 } 477 478 486 public final void setPriority(int priority) { 487 super.setPriority(priority); 488 } 489 490 507 public final void setProgressGroup(IProgressMonitor group, int ticks) { 508 super.setProgressGroup(group, ticks); 509 } 510 511 530 public void setProperty(QualifiedName key, Object value) { 531 super.setProperty(key, value); 532 } 533 534 542 public final void setRule(ISchedulingRule rule) { 543 super.setRule(rule); 544 } 545 546 557 public final void setSystem(boolean value) { 558 super.setSystem(value); 559 } 560 561 570 public final void setUser(boolean value) { 571 super.setUser(value); 572 } 573 574 586 public final void setThread(Thread thread) { 587 super.setThread(thread); 588 } 589 590 607 public boolean shouldRun() { 608 return true; 609 } 610 611 627 public boolean shouldSchedule() { 628 return true; 629 } 630 631 643 public final boolean sleep() { 644 return super.sleep(); 645 } 646 647 657 public final void wakeUp() { 658 super.wakeUp(0L); 659 } 660 661 670 public final void wakeUp(long delay) { 671 super.wakeUp(delay); 672 } 673 } 674 | Popular Tags |