1 22 package org.objectweb.petals.system.launch.mock; 23 24 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 25 import org.objectweb.fractal.api.control.LifeCycleController; 26 27 32 public class MockLifeCycleController implements LifeCycleController { 33 34 protected boolean throwException; 35 36 protected String state; 37 38 public String getFcState() { 39 return state; 40 } 41 42 public String getState() { 43 return state; 44 } 45 46 public void setState(String state) { 47 this.state = state; 48 } 49 50 public void startFc() throws IllegalLifeCycleException { 51 state = STARTED; 52 } 53 54 public void stopFc() throws IllegalLifeCycleException { 55 if (throwException) { 56 throw new IllegalLifeCycleException("Problem while stopping"); 57 } else { 58 state = STOPPED; 59 } 60 } 61 62 public void setThrowException(boolean throwException) { 63 this.throwException = throwException; 64 } 65 66 } 67 | Popular Tags |