Subversion Repositories XServices

Rev

Rev 87 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 87 Rev 116
1
/*
1
/*
2
 *   Copyright 2012 Brian Rosenberger (Brutex Network)
2
 *   Copyright 2012 Brian Rosenberger (Brutex Network)
3
 *
3
 *
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
5
 *   you may not use this file except in compliance with the License.
5
 *   you may not use this file except in compliance with the License.
6
 *   You may obtain a copy of the License at
6
 *   You may obtain a copy of the License at
7
 *
7
 *
8
 *       http://www.apache.org/licenses/LICENSE-2.0
8
 *       http://www.apache.org/licenses/LICENSE-2.0
9
 *
9
 *
10
 *   Unless required by applicable law or agreed to in writing, software
10
 *   Unless required by applicable law or agreed to in writing, software
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
14
 *   limitations under the License.
15
 */
15
 */
16
 
16
 
17
package net.brutex.xservices.types;
17
package net.brutex.xservices.types;
18
 
18
 
19
import javax.xml.bind.annotation.XmlElement;
19
import javax.xml.bind.annotation.XmlElement;
20
 
20
 
21
/*
21
/**
-
 
22
 * @author Brian Rosenberger, bru(at)brutex.de
22
 * Information about processors and memory
23
 *
23
 */
-
 
24
public class RuntimeInfoType {
-
 
25
	
-
 
26
	private final Runtime runtime = Runtime.getRuntime();
-
 
27
	
-
 
28
	@XmlElement
-
 
29
	public int getAvailableProcessors() {
-
 
30
		return runtime.availableProcessors();
-
 
31
	}
-
 
32
	
-
 
33
	@XmlElement
-
 
34
	public long getFreeMemory() {
-
 
35
		return runtime.freeMemory();
-
 
36
	}
-
 
37
	
-
 
38
	@XmlElement
-
 
39
	public long getFreeMemoryMB() {
-
 
40
		return runtime.freeMemory() / 1024;
-
 
41
	}
-
 
42
	
-
 
43
	@XmlElement
-
 
44
	public long getMaxMemory() {
-
 
45
		return runtime.maxMemory();
-
 
46
	}
-
 
47
	
-
 
48
	@XmlElement
-
 
49
	public long getMaxMemoryMB() {
-
 
50
		return runtime.maxMemory() / 1024;
-
 
51
	}
-
 
52
	
-
 
53
	@XmlElement
-
 
54
	public long getTotalMemory() {
-
 
55
		return runtime.totalMemory();
-
 
56
	}
-
 
57
	
-
 
58
	@XmlElement
-
 
59
	public long getTotalMemoryMB() {
-
 
60
		return runtime.totalMemory() / 1024;
-
 
-
 
24
 */
-
 
25
 
-
 
26
public class RuntimeInfoType
-
 
27
{
-
 
28
  private final Runtime runtime = Runtime.getRuntime();
-
 
29
 
-
 
30
  @XmlElement
-
 
31
  public int getAvailableProcessors() {
-
 
32
    return this.runtime.availableProcessors();
-
 
33
  }
-
 
34
 
-
 
35
  @XmlElement
-
 
36
  public long getFreeMemory() {
-
 
37
    return this.runtime.freeMemory();
-
 
38
  }
-
 
39
 
-
 
40
  @XmlElement
-
 
41
  public long getFreeMemoryMB() {
-
 
42
    return this.runtime.freeMemory() / 1024L;
-
 
43
  }
-
 
44
 
-
 
45
  @XmlElement
-
 
46
  public long getMaxMemory() {
-
 
47
    return this.runtime.maxMemory();
-
 
48
  }
-
 
49
 
-
 
50
  @XmlElement
-
 
51
  public long getMaxMemoryMB() {
-
 
52
    return this.runtime.maxMemory() / 1024L;
-
 
53
  }
-
 
54
 
-
 
55
  @XmlElement
-
 
56
  public long getTotalMemory() {
-
 
57
    return this.runtime.totalMemory();
-
 
58
  }
-
 
59
 
-
 
60
  @XmlElement
-
 
61
  public long getTotalMemoryMB() {
61
	}
62
    return this.runtime.totalMemory() / 1024L;
62
 
63
  }
63
}
64
}