Subversion Repositories XServices

Rev

Rev 116 | Details | Compare with Previous | 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
 
116 brianR 21
/**
22
 * @author Brian Rosenberger, bru(at)brutex.de
23
 *
87 brianR 24
 */
25
 
116 brianR 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() {
62
    return this.runtime.totalMemory() / 1024L;
63
  }
87 brianR 64
}