View Javadoc

1   /***
2    * ProcessInfo.java
3    *
4    * This file is part of the creme library.
5    * The creme library intends to ease the development effort of large
6    * applications by providing easy to use support classes.
7    *
8    * Copyright (C) 2003 Denis Bregeon
9    *
10   * This library is free software; you can redistribute it and/or
11   * modify it under the terms of the GNU Lesser General Public
12   * License as published by the Free Software Foundation; either
13   * version 2.1 of the License, or (at your option) any later version.
14   *
15   * This library is distributed in the hope that it will be useful,
16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18   * Lesser General Public License for more details.
19   *
20   * You should have received a copy of the GNU Lesser General Public
21   * License along with this library; if not, write to the Free Software
22   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23   *
24   * contact information: dbregeon@sourceforge.net
25   */
26  package org.jcreme.tutorial;
27  
28  /***
29   * 
30   * @author $Author: dbregeon $
31   * @version $Revision: 1.1 $
32   */
33  public class ProcessInfo {
34      protected Integer processId = null;
35  
36      protected String processName = null;
37  
38      protected Double memoryUsage = null;
39  
40      protected Double cpuUsage = null;
41  
42      /***
43       * 
44       * @param id
45       * @throws IllegalArgumentException
46       */
47      public ProcessInfo(Integer id) throws IllegalArgumentException {
48          if (id == null) {
49              throw new IllegalArgumentException(
50                      "Null is not a valid Process Id.");
51          }
52          this.processId = id;
53      }
54  
55      /***
56       * 
57       * @param name
58       */
59      public void setProcessName(String name) {
60          this.processName = name;
61      }
62  
63      /***
64       * 
65       * @return the name of the process.
66       */
67      public String getProcessName() {
68          return this.processName;
69      }
70  
71      /***
72       * 
73       * @param usage
74       */
75      public void setMemoryUsage(Double usage) {
76          this.memoryUsage = usage;
77      }
78  
79      /***
80       * 
81       * @return the amount memory used by the process.
82       */
83      public Double getMemoryUsage() {
84          return this.memoryUsage;
85      }
86  
87      /***
88       * 
89       * @param usage
90       */
91      public void setCPUUsage(Double usage) {
92          this.cpuUsage = usage;
93      }
94  
95      /***
96       * 
97       * @return the amount of CPU used by the process.
98       */
99      public Double getCPUUsage() {
100         return this.cpuUsage;
101     }
102 
103     /***
104      * 
105      * @return the id of the process.
106      */
107     public Integer getProcessId() {
108         return this.processId;
109     }
110 
111 }