KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > deployment > spi > status > DeploymentStatusImpl


1 /*
2  * JBoss, Home of Professional Open Source
3  * Copyright 2005, JBoss Inc., and individual contributors as indicated
4  * by the @authors tag. See the copyright.txt in the distribution for a
5  * full listing of individual contributors.
6  *
7  * This is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this software; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21  */

22 package org.jboss.deployment.spi.status;
23
24 import javax.enterprise.deploy.shared.ActionType JavaDoc;
25 import javax.enterprise.deploy.shared.CommandType JavaDoc;
26 import javax.enterprise.deploy.shared.StateType JavaDoc;
27 import javax.enterprise.deploy.spi.status.DeploymentStatus JavaDoc;
28
29 /**
30  * The DeploymentStatus interface provides information about the progress status of a deployment action.
31  *
32  * @author thomas.diesler@jboss.org
33  * @version $Revision: 38480 $
34  */

35 public class DeploymentStatusImpl implements DeploymentStatus JavaDoc
36 {
37
38    private StateType JavaDoc stateType;
39    private CommandType JavaDoc commandType;
40    private ActionType JavaDoc actionType;
41    private String JavaDoc message;
42
43    public DeploymentStatusImpl(StateType JavaDoc stateType, CommandType JavaDoc commandType, ActionType JavaDoc actionType, String JavaDoc message)
44    {
45       this.stateType = stateType;
46       this.commandType = commandType;
47       this.actionType = actionType;
48       this.message = message;
49    }
50
51    /**
52     * Set the current deployment status
53     */

54    void setStateType(StateType JavaDoc stateType)
55    {
56       this.stateType = stateType;
57    }
58
59    /**
60     * Set the current deployment message
61     */

62    void setMessage(String JavaDoc message)
63    {
64       this.message = message;
65    }
66
67    /**
68     * Get the state of the deployment
69     *
70     * @return the state
71     */

72    public StateType JavaDoc getState()
73    {
74       return stateType;
75    }
76
77    /**
78     * The deployment command
79     *
80     * @return the command
81     */

82    public CommandType JavaDoc getCommand()
83    {
84       return commandType;
85    }
86
87    /**
88     * The action of this deployment
89     *
90     * @return the action
91     */

92    public ActionType JavaDoc getAction()
93    {
94       return actionType;
95    }
96
97    /**
98     * Get the message
99     *
100     * @return the message
101     */

102    public String JavaDoc getMessage()
103    {
104       return message;
105    }
106
107    /**
108     * Is the deployment complete
109     *
110     * @return true when complete, false otherwise
111     */

112    public boolean isCompleted()
113    {
114       return stateType == StateType.COMPLETED;
115    }
116
117    /**
118     * Has the deployment failed
119     *
120     * @return true when failed, false otherwise
121     */

122    public boolean isFailed()
123    {
124       return stateType == StateType.FAILED;
125    }
126
127    /**
128     * Is the deployment in progress
129     *
130     * @return true when in progress, false otherwise
131     */

132    public boolean isRunning()
133    {
134       return stateType == StateType.RUNNING;
135    }
136 }
137
Popular Tags