1 23 24 package org.objectweb.dream.control.activity.task; 25 26 import org.objectweb.dream.util.Error; 27 import org.objectweb.fractal.api.Component; 28 import org.objectweb.fractal.api.NoSuchInterfaceException; 29 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 30 31 35 public abstract class ContainerLifeCycleMixin 36 implements 37 TaskLifeCycleController 38 { 39 40 44 private ContainerLifeCycleMixin() 45 { 46 } 47 48 52 55 public void asyncStop(TaskStoppedListener listener) 56 { 57 getContent().asyncStop(listener); 58 } 59 60 63 public String getFcState() 64 { 65 return getContent().getFcState(); 66 } 67 68 71 public void startFc() throws IllegalLifeCycleException 72 { 73 getContent().startFc(); 74 } 75 76 79 public void stopFc() throws IllegalLifeCycleException 80 { 81 getContent().stopFc(); 82 } 83 84 89 public TaskLifeCycleController getContent() 90 { 91 try 92 { 93 return (TaskLifeCycleController) _this_weaveableOptC 94 .getFcInterface("/content"); 95 } 96 catch (NoSuchInterfaceException e) 97 { 98 Error.error("Unable to find component content", null); 99 return null; 100 } 101 catch (ClassCastException e) 102 { 103 Error.error( 104 "The content object does not implements TaskLifeCycleController", 105 null); 106 return null; 107 } 108 } 109 110 114 119 120 public Component _this_weaveableOptC; 121 122 } | Popular Tags |