KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > container > State


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.excalibur.container;
9
10 import org.apache.avalon.framework.ValuedEnum;
11
12 /**
13  * Defines possible states for contained components.
14  *
15  * @author <a HREF="mailto:peter@apache.org">Peter Donald</a>
16  */

17 public final class State
18     extends ValuedEnum
19 {
20     /**
21      * VOID is the initial state of all components.
22      */

23     public final static State VOID = new State( "VOID", 0 );
24
25     /**
26      * CREATING indicates that the Component is in process of being created.
27      */

28     public final static State CREATING = new State( "CREATING", 0 );
29
30     /**
31      * CREATED is the state the component exists in after it has been
32      * successfully created but before it has been prepared.
33      */

34     public final static State CREATED = new State( "CREATED", 0 );
35
36     /**
37      * READYING indicates that the component is being prepared for service.
38      * In terms of Avalons Component Lifecycle this would indicate Loggable,
39      * Contextualizable, Composable, Configurable and Initializable stages.
40      */

41     public final static State READYING = new State( "READYING", 0 );
42
43     /**
44      * READY indicates that the component is ready to be started
45      * or destroyed as appropriate.
46      */

47     public final static State READY = new State( "READY", 0 );
48
49     /**
50      * STARTING indicates that the component is being started.
51      */

52     public final static State STARTING = new State( "STARTING", 0 );
53
54     /**
55      * STARTED indicates that the component has been started.
56      */

57     public final static State STARTED = new State( "STARTED", 0 );
58
59     /**
60      * STOPPING indicates that the component is being stopped.
61      */

62     public final static State STOPPING = new State( "STOPPING", 0 );
63
64     /**
65      * STOPPED indicates that the component has been stopped.
66      */

67     public final static State STOPPED = new State( "STOPPED", 0 );
68
69     /**
70      * DESTROYING indicates that the component is being destroyed.
71      */

72     public final static State DESTROYING = new State( "DESTROYING", 0 );
73
74     /**
75      * DESTROYED indicates that the component has been destroyed.
76      */

77     public final static State DESTROYED = new State( "DESTROYED", 0 );
78
79     /**
80      * FAILED indicates that the component is in a FAILED state. This is
81      * usually the result of an error during one of the transition states.
82      */

83     public final static State FAILED = new State( "FAILED", 0 );
84
85     protected State( final String JavaDoc name, final int value )
86     {
87         super( name, value );
88     }
89 }
90
Popular Tags