1 package org.jacorb.notification.engine; 2 3 23 24 import org.jacorb.notification.interfaces.MessageSupplier; 25 import org.omg.CosEventComm.Disconnected; 26 27 31 32 public class PullFromSupplierTask extends AbstractTask 33 { 34 private MessageSupplier target_; 35 36 38 PullFromSupplierTask(TaskExecutor executor) { 39 setTaskExecutor(executor); 40 } 41 42 44 public void setTarget( MessageSupplier target ) 45 { 46 target_ = target; 47 } 48 49 public void doWork() throws Disconnected 50 { 51 target_.runPullMessage(); 52 53 dispose(); 54 } 55 56 57 public void reset() 58 { 59 target_ = null; 60 } 61 62 63 public void handleTaskError(AbstractTask task, Throwable error) { 64 if (error instanceof Disconnected) { 65 target_.destroy(); 66 } 67 } 68 69 70 public void schedule() throws InterruptedException { 71 schedule(false); 72 } 73 } 74 | Popular Tags |