1 package cz.cuni.amis.pogamut.base.agent;
2
3 import javax.management.MXBean;
4
5 import cz.cuni.amis.pogamut.base.utils.guice.AgentScoped;
6 import cz.cuni.amis.utils.exception.PogamutException;
7
8 /**
9 * Interface providing a control methods for the implementors. Used almost everywhere
10 * in the Gavial libray.
11 * <p><p>
12 * Must remain compatible with {@link IStartable}.
13 *
14 * @author ik
15 */
16 @MXBean
17 @AgentScoped
18 public interface IControllable {
19
20 /**
21 * Starts the object. If no exception is thrown we assume that the object has been correctly
22 * started and can be used.
23 * <p><p>
24 * May be blocking!
25 *
26 * @throws PogamutException
27 */
28 public void start() throws PogamutException;
29
30 /**
31 * Tries to stop the work of this object carefully.
32 * <p><p>
33 * May be blocking!
34 */
35 public void stop();
36
37 /**
38 * Kills the object - interrupt ruthlessly any work it might be doing.
39 * <p><p>
40 * This method should interrupt any threads the object may have.
41 * <p><p>
42 * May be blocking!
43 */
44 public void kill();
45
46 }