1
/*___INFO__MARK_BEGIN__*/
2
/*************************************************************************
4
* The Contents of this file are made available subject to the terms of
5
* the Sun Industry Standards Source License Version 1.2
7
* Sun Microsystems Inc., March, 2001
10
* Sun Industry Standards Source License Version 1.2
11
* =================================================
12
* The contents of this file are subject to the Sun Industry Standards
13
* Source License Version 1.2 (the "License"); You may not use this file
14
* except in compliance with the License. You may obtain a copy of the
15
* License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
17
* Software provided under this License is provided on an "AS IS" basis,
18
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
19
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
21
* See the License for the specific provisions governing your rights and
22
* obligations concerning the Software.
24
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
26
* Copyright: 2001 by Sun Microsystems, Inc.
28
* All Rights Reserved.
30
************************************************************************/
31
/*___INFO__MARK_END__*/
32
package com.sun.grid.jgdi.monitoring;
34
import java.io.Serializable;
37
* Default implementation of the <code>TaskSummary</code> interface
39
public class TaskSummaryImpl implements TaskSummary, Serializable {
41
private String taskId;
43
private boolean hasCpuUsage;
44
private double cpuUsage;
45
private boolean hasMemUsage;
46
private double memUsage;
47
private boolean hasIoUsage;
48
private double ioUsage;
49
private boolean isRunning;
50
private boolean hasExitStatus;
51
private int exitStatus;
53
/** Creates a new instance of TaskSummary */
54
public TaskSummaryImpl() {
61
public String getTaskId() {
67
* @param taskId the task id
69
public void setTaskId(String taskId) {
74
* Get the state of the task
75
* @return state of the task
77
public String getState() {
82
* Set the state of the task
83
* @param state state of the task
85
public void setState(String state) {
90
* Determine if the task has cpu usage
91
* @return <code>true</code> if the task has cpu usage
93
public boolean hasCpuUsage() {
98
* Get the cpu usage of the task. Returns only a meanful value
99
* if {@link #hasCpuUsage} returns true.
100
* @return the cpu usage of the task
102
public double getCpuUsage() {
107
* Set the cpu usage of the task.
108
* @param cpuUsage the cpu usage
110
public void setCpuUsage(double cpuUsage) {
111
this.cpuUsage = cpuUsage;
116
* Determine if the task has mem usage
117
* @return <code>true</code> if the task has mem usage
119
public boolean hasMemUsage() {
124
* Get the mem usage of the task. Returns only a meanful value
125
* if {@link #hasMemUsage} returns true.
126
* @return the mem usage of the task
128
public double getMemUsage() {
133
* Set the mem usage of the task.
134
* @param memUsage the mem usage
136
public void setMemUsage(double memUsage) {
137
this.memUsage = memUsage;
142
* Determine if the task has io usage
143
* @return <code>true</code> if the task has io usage
145
public boolean hasIoUsage() {
150
* Get the io usage of the task. Returns only a meanful value
151
* if {@link #hasIoUsage} returns true.
152
* @return the io usage of the task
154
public double getIoUsage() {
159
* Set the io usage of the task.
160
* @param ioUsage the io usage
162
public void setIoUsage(double ioUsage) {
163
this.ioUsage = ioUsage;
168
* Determine if the task is running
169
* @return <code>true</code> if task is running
171
public boolean isRunning() {
176
* Set the running flag of the task
177
* @param isRunning the running flag
179
public void setRunning(boolean isRunning) {
180
this.isRunning = isRunning;
184
* Determine if the task has an exit status.
185
* @return <code>true</code> if the task has an exit status
187
public boolean hasExitStatus() {
188
return hasExitStatus;
192
* Get the exit status of the task. Returns only a meanful value if
193
* {@link #hasExitStatus} returns <code>true</code>.
194
* @return the exit status of the task
196
public int getExitStatus() {
201
* Set the exit status of the task
202
* @param exitStatus the exit status
204
public void setExitStatus(int exitStatus) {
205
this.exitStatus = exitStatus;
206
hasExitStatus = true;