Subversion Repositories XServices

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
87 brianR 1
/*
2
 *   Copyright 2012 Brian Rosenberger (Brutex Network)
3
 *
4
 *   Licensed under the Apache License, Version 2.0 (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
7
 *
8
 *       http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *   Unless required by applicable law or agreed to in writing, software
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
15
 */
16
 
17
package net.brutex.xservices.types;
18
 
19
import javax.xml.bind.annotation.XmlElement;
20
 
21
/*
22
 * Information about processors and memory
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;
61
	}
62
 
63
}