1 package cz.cuni.amis.pogamut.base.component;
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 *
12 * @author ik
13 */
14 @MXBean
15 @AgentScoped
16 public interface IControllable {
17
18 /**
19 * Starts the object. If no exception is thrown we assume that the object has been correctly
20 * started and can be used.
21 * <p><p>
22 * May block.
23 *
24 * @throws PogamutException
25 */
26 public void start() throws PogamutException;
27
28 /**
29 * Tries to stop the work of this object carefully.
30 * <p><p>
31 * May block.
32 */
33 public void stop();
34
35 /**
36 * Kills the object - interrupt ruthlessly any work it might be doing.
37 * <p><p>
38 * This method should interrupt any threads the object may have.
39 * <p><p>
40 * Must not block!
41 */
42 public void kill();
43
44 }