KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > management > j2ee > StateManageable


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  
24 /*
25  * $Header: /cvs/glassfish/admin-core/mbeanapi/src/java/com/sun/appserv/management/j2ee/StateManageable.java,v 1.3 2005/12/25 03:50:50 tcfujii Exp $
26  * $Revision: 1.3 $
27  * $Date: 2005/12/25 03:50:50 $
28  */

29  
30  package com.sun.appserv.management.j2ee;
31  
32  public interface StateManageable
33  {
34     /**
35         This state indicates that the SMO has been requested to start,
36         and is in the process of starting. On entering this state an SMO may generate
37         an event whose type value is "STATE". Event notification of the STARTING state
38         is optional for all managed objects that implement StateManageable.
39      */

40     public static final int STATE_STARTING = 0;
41     
42     /**
43         This is the normal running state for an SMO. This state indicates
44         that the SMO is operational. On entering this state an SMO must generate an
45         event whose type value is "STATE". Event notification of the RUNNING state is
46         required for all managed objects that implement StateManageable.
47      */

48     public static final int STATE_RUNNING = 1;
49     
50     /**
51         This state indicates that the SMO has been requested to stop,
52         and is in the process of stopping. On entering this state an SMO may generate
53         an event whose type value is "STATE". Event notification of the STOPPING state
54         is optional for all managed objects that implement StateManageable.
55      */

56     public static final int STATE_STOPPING = 2;
57     
58     /**
59         This state indicates that the StateManageable Object has stopped
60         and can be restarted. On entering this state an SMO must generate an event
61         whose type value is "STATE". Event notification of the STOPPED state is
62         required by all managed objects that implement StateManageable.
63      */

64     public static final int STATE_STOPPED = 3;
65     
66     /**
67         This state indicates that the StateManageable Object is in a failed
68         state and intervention is required to restore the managed object. On entering
69         this state an SMO must generate an event whose type value is "STATE". Event
70         notification of the FAILED state is required by all managed objects that
71         implement StateManageable.
72      */

73     public static final int STATE_FAILED = 4;
74     
75     /**
76     The current state of this SMO. The SMO can be in one of the following states:
77     <ul>
78         <li>#STATE_STARTING </li>
79         <li>#STATE_RUNNING </li>
80         <li>#STATE_STOPPING </li>
81         <li>#STATE_STOPPED </li>
82         <li>#STATE_FAILED </li>
83     </ul>
84         <p>
85         Note that the Attribute name is case-sensitive
86         "state" as defined by JSR 77.
87     */

88     public int getstate();
89     
90     /**
91         The time that the managed object was started represented as a
92         long which value is the number of milliseconds since
93         January 1, 1970, 00:00:00.
94         <p>
95         Note that the Attribute name is case-sensitive
96         "startTime" as defined by JSR 77.
97      */

98     public long getstartTime();
99     
100     /**
101         Starts the SMO. This operation can be invoked only when the SMO
102         is in the STOPPED state. It causes the SMO to go into the STARTING
103         state initially, and if it completes successfully, the SMO will be in
104         the RUNNING state. Note that start() is not called on any of the child
105         SMOs that are registered with this SMO; it is the responsibility of the
106         calling application to start the child SMO if this is required.
107      */

108     public void start();
109     
110     /**
111         Starts the SMO. This operation can only be invoked when the SMO is in the
112         STOPPED state. It causes the SMO to go into the STARTING state initially,
113         and if it completes successfully, the SMO will be in the RUNNING state.
114         startRecursive() is called on all the child SMOs registered with this SMO
115         that are in the STOPPED state. Stops the SMO. This operation can only be
116         invoked when the SMO is in the RUNNING or STARTING state. It causes stop()
117         to be called on all the child SMOs registered with this SMO that are in the
118         RUNNING or STARTING state. It causes the SMO to go into the STOPPING state
119         initially, and if it completes successfully, the SMO and all the child SMOs
120         will be in the STOPPED state. There is no stopRecursive() operation because
121         it is mandatory if an SMO is in the STOPPED state, that all its child SMOs
122         must also be in the STOPPED state.
123      */

124     public void startRecursive();
125     
126     /**
127         Stops the SMO. This operation can only be invoked when the SMO is in
128         the RUNNING or STARTING state. It causes stop() to be called on all the
129         child SMOs registered with this SMO that are in the RUNNING or STARTING
130         state. It causes the SMO to go into the STOPPING state initially,
131         and if it completes successfully, the SMO and all the child SMOs will be
132         in the STOPPED state. There is no stopRecursive() operation because it is
133         mandatory if an SMO is in the STOPPED state, that all its child SMOs must
134         also be in the STOPPED state.
135      */

136     public void stop();
137  };
138  
Popular Tags