1 17 package org.apache.servicemix.beanflow; 18 19 import java.util.Timer ; 20 import java.util.concurrent.TimeUnit ; 21 22 34 public interface Activity { 35 36 41 public enum Transitions { 42 Initialised, Starting, Started, Stopping, Stopped, Failed 43 }; 44 45 50 public void start(); 51 52 56 public void startWithTimeout(Timer timer, long timeout); 57 58 61 public void stop(); 62 63 66 public void fail(String reason); 67 68 71 public State<Transitions> getState(); 72 73 77 public boolean isStopped(); 78 79 82 public boolean isFailed(); 83 84 87 public String getFailedReason(); 88 89 92 public Throwable getFailedException(); 93 94 97 public void onStop(Runnable runnable); 98 99 102 public void onFailure(Runnable runnable); 103 104 108 public void join(); 109 110 116 public boolean join(int time, TimeUnit unit); 117 } 118 | Popular Tags |