1 17 package org.apache.servicemix.beanflow; 18 19 import java.util.Timer ; 20 import java.util.concurrent.TimeUnit ; 21 22 28 public class ProxyActivity implements Activity { 29 30 private Activity proxy; 31 32 public ProxyActivity(Activity proxy) { 33 this.proxy = proxy; 34 } 35 36 public void fail(String reason) { 37 getProxy().fail(reason); 38 } 39 40 public String getFailedReason() { 41 return getProxy().getFailedReason(); 42 } 43 44 public Throwable getFailedException() { 45 return getProxy().getFailedException(); 46 } 47 48 public State<Transitions> getState() { 49 return getProxy().getState(); 50 } 51 52 public boolean isFailed() { 53 return getProxy().isFailed(); 54 } 55 56 public boolean isStopped() { 57 return getProxy().isStopped(); 58 } 59 60 public void start() { 61 getProxy().start(); 62 } 63 64 public void startWithTimeout(Timer timer, long timeout) { 65 getProxy().startWithTimeout(timer, timeout); 66 } 67 68 public void stop() { 69 getProxy().stop(); 70 } 71 72 public void onFailure(Runnable runnable) { 73 getProxy().onFailure(runnable); 74 } 75 76 public void onStop(Runnable runnable) { 77 getProxy().onStop(runnable); 78 } 79 80 public void join() { 81 getProxy().join(); 82 } 83 84 public boolean join(int time, TimeUnit unit) { 85 return getProxy().join(time, unit); 86 } 87 88 protected Activity getProxy() { 89 return proxy; 90 } 91 92 protected void setProxy(Activity proxy) { 93 this.proxy = proxy; 94 } 95 } 96 | Popular Tags |