1 package cz.cuni.amis.pogamut.base.component.bus.exception; 2 3 import java.util.logging.Logger; 4 5 import cz.cuni.amis.pogamut.base.component.controller.ComponentState; 6 import cz.cuni.amis.pogamut.base.component.exception.ComponentException; 7 8 /** 9 * This exception is thrown whenever you call some running-state-dependent method from the public interface of 10 * some {@link IComponent}. It means that the component is not running (e.g. is just stopping right now or is stopped, was 11 * not started etc.) 12 * 13 * @author Jimmy 14 */ 15 public class ComponentNotRunningException extends ComponentException { 16 17 /** 18 * Constructs a new exception with the specified detail message. 19 * <p><p> 20 * Not logging anything anywhere on its own. 21 * 22 * @param state 23 * @param origin which object does produced the exception 24 */ 25 public ComponentNotRunningException(ComponentState state, Object origin) { 26 super("In state: " + state + ".", origin); 27 } 28 29 /** 30 * Constructs a new exception with the specified detail message. 31 * <p><p> 32 * Not logging anything anywhere on its own. 33 * 34 * @param message 35 * @param origin which object does produced the exception 36 */ 37 public ComponentNotRunningException(String message, Object origin) { 38 super(message, origin); 39 } 40 41 /** 42 * Constructs a new exception with the specified detail message and cause. 43 * <p><p> 44 * Not logging anything anywhere on its own. 45 * 46 * @param message 47 * @param cause 48 * @param origin which object does produced the exception 49 */ 50 public ComponentNotRunningException(ComponentState state, Throwable cause, Object origin) { 51 super("In state: " + state + ".", cause, origin); 52 } 53 54 /** 55 * Constructs a new exception with the specified detail message and cause. 56 * <p><p> 57 * Not logging anything anywhere on its own. 58 * 59 * @param message 60 * @param cause 61 * @param origin which object does produced the exception 62 */ 63 public ComponentNotRunningException(String message, Throwable cause, Object origin) { 64 super(message, cause, origin); 65 } 66 67 /** 68 * Constructs a new exception with the specified detail message. 69 * <p><p> 70 * Logs the exception via specified Logger. 71 * 72 * @param message 73 * @param log 74 * @param origin which object does produced the exception 75 */ 76 public ComponentNotRunningException(ComponentState state, Logger log, Object origin){ 77 super("In state: " + state + ".", log, origin); 78 } 79 80 /** 81 * Constructs a new exception with the specified detail message. 82 * <p><p> 83 * Logs the exception via specified Logger. 84 * 85 * @param message 86 * @param log 87 * @param origin which object does produced the exception 88 */ 89 public ComponentNotRunningException(String message, Logger log, Object origin){ 90 super(message, log, origin); 91 } 92 93 /** 94 * Constructs a new exception with the specified detail message and cause. 95 * <p><p> 96 * Logs the exception via specified Logger. 97 * 98 * @param state 99 * @param cause 100 * @param log 101 * @param origin which object does produced the exception 102 */ 103 public ComponentNotRunningException(ComponentState state, Throwable cause, Logger log, Object origin) { 104 super("In state: " + state + ".", cause, log, origin); 105 } 106 107 /** 108 * Constructs a new exception with the specified detail message and cause. 109 * <p><p> 110 * Logs the exception via specified Logger. 111 * 112 * @param message 113 * @param cause 114 * @param origin which object does produced the exception 115 */ 116 public ComponentNotRunningException(String message, Throwable cause, Logger log, Object origin) { 117 super(message, cause, log, origin); 118 } 119 120 }