Subversion Repositories XServices

Rev

Rev 87 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 87 Rev 116
Line 16... Line 16...
16
 
16
 
Line 17... Line 17...
17
package net.brutex.xservices.types;
17
package net.brutex.xservices.types;
Line 18... Line 18...
18
 
18
 
19
import javax.xml.bind.annotation.XmlElement;
19
import javax.xml.bind.annotation.XmlElement;
-
 
20
 
20
 
21
/**
21
/*
-
 
Line -... Line 22...
-
 
22
 * @author Brian Rosenberger, bru(at)brutex.de
-
 
23
 *
22
 * Information about processors and memory
24
 */
Line 23... Line 25...
23
 */
25
 
24
public class RuntimeInfoType {
26
public class RuntimeInfoType
25
	
27
{
26
	private final Runtime runtime = Runtime.getRuntime();
28
  private final Runtime runtime = Runtime.getRuntime();
Line 27... Line 29...
27
	
29
 
28
	@XmlElement
30
  @XmlElement
29
	public int getAvailableProcessors() {
31
  public int getAvailableProcessors() {
30
		return runtime.availableProcessors();
32
    return this.runtime.availableProcessors();
Line 31... Line 33...
31
	}
33
  }
32
	
34
 
33
	@XmlElement
35
  @XmlElement
34
	public long getFreeMemory() {
36
  public long getFreeMemory() {
Line 35... Line 37...
35
		return runtime.freeMemory();
37
    return this.runtime.freeMemory();
36
	}
38
  }
37
	
39
 
38
	@XmlElement
40
  @XmlElement
Line 39... Line 41...
39
	public long getFreeMemoryMB() {
41
  public long getFreeMemoryMB() {
40
		return runtime.freeMemory() / 1024;
42
    return this.runtime.freeMemory() / 1024L;
41
	}
43
  }
42
	
44
 
Line 43... Line 45...
43
	@XmlElement
45
  @XmlElement
44
	public long getMaxMemory() {
46
  public long getMaxMemory() {
45
		return runtime.maxMemory();
47
    return this.runtime.maxMemory();
46
	}
48
  }
Line 47... Line 49...
47
	
49
 
48
	@XmlElement
50
  @XmlElement
49
	public long getMaxMemoryMB() {
51
  public long getMaxMemoryMB() {
50
		return runtime.maxMemory() / 1024;
52
    return this.runtime.maxMemory() / 1024L;
51
	}
-
 
52
	
53
  }