annotate src/org/eclipse/jetty/util/component/LifeCycle.java @ 1042:a62193321d6a

remove Buffer.reset()
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 04 Nov 2016 01:03:25 -0600
parents 5dfb10ec0ca5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 //
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 // ========================================================================
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 // Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 // ------------------------------------------------------------------------
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 // All rights reserved. This program and the accompanying materials
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 // are made available under the terms of the Eclipse Public License v1.0
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 // and Apache License v2.0 which accompanies this distribution.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 //
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 // The Eclipse Public License is available at
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 // http://www.eclipse.org/legal/epl-v10.html
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 //
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 // The Apache License v2.0 is available at
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 // http://www.opensource.org/licenses/apache2.0.php
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 //
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 // You may elect to redistribute this code under either of these licenses.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 // ========================================================================
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 //
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 package org.eclipse.jetty.util.component;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21 import java.util.EventListener;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
23 /* ------------------------------------------------------------ */
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24 /**
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25 * The lifecycle interface for generic components.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 * <br />
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
27 * Classes implementing this interface have a defined life cycle
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
28 * defined by the methods of this interface.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
29 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
30 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
31 */
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
32 public interface LifeCycle
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
33 {
847
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
34 /* ------------------------------------------------------------ */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
35 /**
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
36 * Starts the component.
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
37 * @throws Exception If the component fails to start
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
38 * @see #isStarted()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
39 * @see #stop()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
40 * @see #isFailed()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
41 */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
42 public void start()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
43 throws Exception;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
44
847
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
45 /* ------------------------------------------------------------ */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
46 /**
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
47 * Stops the component.
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
48 * The component may wait for current activities to complete
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
49 * normally, but it can be interrupted.
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
50 * @exception Exception If the component fails to stop
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
51 * @see #isStopped()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
52 * @see #start()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
53 * @see #isFailed()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
54 */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
55 public void stop()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
56 throws Exception;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
57
847
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
58 /* ------------------------------------------------------------ */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
59 /**
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
60 * @return true if the component is starting or has been started.
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
61 */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
62 public boolean isRunning();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
63
847
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
64 /* ------------------------------------------------------------ */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
65 /**
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
66 * @return true if the component has been started.
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
67 * @see #start()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
68 * @see #isStarting()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
69 */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
70 public boolean isStarted();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
71
847
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
72 /* ------------------------------------------------------------ */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
73 /**
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
74 * @return true if the component is starting.
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
75 * @see #isStarted()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
76 */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
77 public boolean isStarting();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
78
847
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
79 /* ------------------------------------------------------------ */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
80 /**
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
81 * @return true if the component is stopping.
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
82 * @see #isStopped()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
83 */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
84 public boolean isStopping();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
85
847
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
86 /* ------------------------------------------------------------ */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
87 /**
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
88 * @return true if the component has been stopped.
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
89 * @see #stop()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
90 * @see #isStopping()
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
91 */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
92 public boolean isStopped();
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
93
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
94 /* ------------------------------------------------------------ */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
95 /**
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
96 * @return true if the component has failed to start or has failed to stop.
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
97 */
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
98 public boolean isFailed();
5dfb10ec0ca5 remove LifeCycle.Listener
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
99
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
100 }