Mercurial Hosting > luan
comparison src/org/eclipse/jetty/util/component/LifeCycle.java @ 847:5dfb10ec0ca5
remove LifeCycle.Listener
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 19 Sep 2016 16:11:15 -0600 |
parents | 3428c60d7cfc |
children |
comparison
equal
deleted
inserted
replaced
846:490960236c58 | 847:5dfb10ec0ca5 |
---|---|
29 * | 29 * |
30 * | 30 * |
31 */ | 31 */ |
32 public interface LifeCycle | 32 public interface LifeCycle |
33 { | 33 { |
34 /* ------------------------------------------------------------ */ | 34 /* ------------------------------------------------------------ */ |
35 /** | 35 /** |
36 * Starts the component. | 36 * Starts the component. |
37 * @throws Exception If the component fails to start | 37 * @throws Exception If the component fails to start |
38 * @see #isStarted() | 38 * @see #isStarted() |
39 * @see #stop() | 39 * @see #stop() |
40 * @see #isFailed() | 40 * @see #isFailed() |
41 */ | 41 */ |
42 public void start() | 42 public void start() |
43 throws Exception; | 43 throws Exception; |
44 | 44 |
45 /* ------------------------------------------------------------ */ | 45 /* ------------------------------------------------------------ */ |
46 /** | 46 /** |
47 * Stops the component. | 47 * Stops the component. |
48 * The component may wait for current activities to complete | 48 * The component may wait for current activities to complete |
49 * normally, but it can be interrupted. | 49 * normally, but it can be interrupted. |
50 * @exception Exception If the component fails to stop | 50 * @exception Exception If the component fails to stop |
51 * @see #isStopped() | 51 * @see #isStopped() |
52 * @see #start() | 52 * @see #start() |
53 * @see #isFailed() | 53 * @see #isFailed() |
54 */ | 54 */ |
55 public void stop() | 55 public void stop() |
56 throws Exception; | 56 throws Exception; |
57 | 57 |
58 /* ------------------------------------------------------------ */ | 58 /* ------------------------------------------------------------ */ |
59 /** | 59 /** |
60 * @return true if the component is starting or has been started. | 60 * @return true if the component is starting or has been started. |
61 */ | 61 */ |
62 public boolean isRunning(); | 62 public boolean isRunning(); |
63 | 63 |
64 /* ------------------------------------------------------------ */ | 64 /* ------------------------------------------------------------ */ |
65 /** | 65 /** |
66 * @return true if the component has been started. | 66 * @return true if the component has been started. |
67 * @see #start() | 67 * @see #start() |
68 * @see #isStarting() | 68 * @see #isStarting() |
69 */ | 69 */ |
70 public boolean isStarted(); | 70 public boolean isStarted(); |
71 | 71 |
72 /* ------------------------------------------------------------ */ | 72 /* ------------------------------------------------------------ */ |
73 /** | 73 /** |
74 * @return true if the component is starting. | 74 * @return true if the component is starting. |
75 * @see #isStarted() | 75 * @see #isStarted() |
76 */ | 76 */ |
77 public boolean isStarting(); | 77 public boolean isStarting(); |
78 | 78 |
79 /* ------------------------------------------------------------ */ | 79 /* ------------------------------------------------------------ */ |
80 /** | 80 /** |
81 * @return true if the component is stopping. | 81 * @return true if the component is stopping. |
82 * @see #isStopped() | 82 * @see #isStopped() |
83 */ | 83 */ |
84 public boolean isStopping(); | 84 public boolean isStopping(); |
85 | 85 |
86 /* ------------------------------------------------------------ */ | 86 /* ------------------------------------------------------------ */ |
87 /** | 87 /** |
88 * @return true if the component has been stopped. | 88 * @return true if the component has been stopped. |
89 * @see #stop() | 89 * @see #stop() |
90 * @see #isStopping() | 90 * @see #isStopping() |
91 */ | 91 */ |
92 public boolean isStopped(); | 92 public boolean isStopped(); |
93 | 93 |
94 /* ------------------------------------------------------------ */ | 94 /* ------------------------------------------------------------ */ |
95 /** | 95 /** |
96 * @return true if the component has failed to start or has failed to stop. | 96 * @return true if the component has failed to start or has failed to stop. |
97 */ | 97 */ |
98 public boolean isFailed(); | 98 public boolean isFailed(); |
99 | |
100 /* ------------------------------------------------------------ */ | |
101 public void addLifeCycleListener(LifeCycle.Listener listener); | |
102 | 99 |
103 /* ------------------------------------------------------------ */ | |
104 public void removeLifeCycleListener(LifeCycle.Listener listener); | |
105 | |
106 | |
107 /* ------------------------------------------------------------ */ | |
108 /** Listener. | |
109 * A listener for Lifecycle events. | |
110 */ | |
111 public interface Listener extends EventListener | |
112 { | |
113 public void lifeCycleStarting(LifeCycle event); | |
114 public void lifeCycleStarted(LifeCycle event); | |
115 public void lifeCycleFailure(LifeCycle event,Throwable cause); | |
116 public void lifeCycleStopping(LifeCycle event); | |
117 public void lifeCycleStopped(LifeCycle event); | |
118 } | |
119 } | 100 } |