KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > ide > j2ee > Status


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.j2ee.sun.ide.j2ee;
21
22 import javax.enterprise.deploy.shared.ActionType JavaDoc;
23 import javax.enterprise.deploy.shared.CommandType JavaDoc;
24 import javax.enterprise.deploy.shared.StateType JavaDoc;
25 import javax.enterprise.deploy.spi.status.DeploymentStatus JavaDoc;
26
27 //The tomcat team will split the tomcat module in 2, so that this type of behaviour can be shared
28
// between web/app server plugins. This is really a shared utility class.
29
//
30

31 /** Implementation of DeploymentStatus
32  *
33  * @@author Radim Kubacki
34  */

35 public class Status implements DeploymentStatus JavaDoc {
36     
37     /** Value of action type. */
38     private ActionType JavaDoc at;
39     
40     /** Executed command. */
41     private CommandType JavaDoc ct;
42     
43     /** Status message. */
44     private String JavaDoc msg;
45     
46     /** Current state. */
47     private StateType JavaDoc state;
48     
49     public Status (ActionType JavaDoc at, CommandType JavaDoc ct, String JavaDoc msg, StateType JavaDoc state) {
50         this.at = at;
51         this.ct = ct;
52         this.msg = msg;
53         this.state = state;
54     }
55     
56     public ActionType JavaDoc getAction () {
57         return at;
58     }
59     
60     public CommandType JavaDoc getCommand () {
61         return ct;
62     }
63     
64     public String JavaDoc getMessage () {
65         return msg;
66     }
67     
68     public StateType JavaDoc getState () {
69         return state;
70     }
71     
72     public boolean isCompleted () {
73         return StateType.COMPLETED.equals (state);
74     }
75     
76     public boolean isFailed () {
77         return StateType.FAILED.equals (state);
78     }
79     
80     public boolean isRunning () {
81         return StateType.RUNNING.equals (state);
82     }
83     
84     public String JavaDoc toString () {
85         return "A="+getAction ()+" S="+getState ()+" "+getMessage (); // NOI18N
86
}
87 }
88
89
Popular Tags