KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > management > base > OperationStatus


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 package com.sun.appserv.management.base;
24
25
26 /**
27     Base interface for all OperationStatus objects.
28  */

29 public interface OperationStatus extends MapCapable
30 {
31     /**
32         Key used to look up the Throwable (if any) from the Map.
33         The value returned is a java.lang.Throwable.
34      */

35     public static final String JavaDoc THROWABLE_KEY = "ThrowableKey";
36     
37     /**
38         Key used to look up the status code (if any) from the Map.
39         The value returned is an Integer whose intValue() is the
40         status code. Corresponds to {@link #getStatusCode}.
41      */

42     public static final String JavaDoc STATUS_CODE_KEY = "StatusCodeKey";
43     
44     /**
45         If there is no explicit status code, an operation is considered
46         successful if nothing was thrown.
47         <p>
48         Legal status codes include:
49         <ul>
50         <li>#STATUS_CODE_SUCCESS</li>
51         <li>#STATUS_CODE_FAILURE</li>
52         <li>#STATUS_CODE_WARNING</li>
53         <li><i>any other status codes defined by sub-interfaces/subclasses</i></li>
54         </ul>
55         
56         @return the status code
57      */

58     public int getStatusCode();
59     
60     /**
61         If a Throwable was thrown, this implies some degree of failure
62         from partial to total.
63         
64         @return any Throwable that was thrown
65      */

66     public Throwable JavaDoc getThrowable();
67     
68     /**
69         Status code indicating success of the operation.
70      */

71     public final int STATUS_CODE_SUCCESS = 2;
72     
73     /**
74         Status code indicating failure of the operation.
75      */

76     public final int STATUS_CODE_FAILURE = 0;
77     
78     /**
79         Status code indicating success, with warning.
80      */

81     public static final int STATUS_CODE_WARNING = 1;
82 }
83
84
85
86
87
88
89
90
91
Popular Tags