add contructor that takes already open sigar

This commit is contained in:
Doug MacEachern 2007-01-18 22:30:46 +00:00
parent 8864012c94
commit 0d58f9f281
1 changed files with 5 additions and 1 deletions

View File

@ -37,7 +37,11 @@ public class SigarProcess implements SigarProcessMBean {
private SigarProxy sigar; private SigarProxy sigar;
public SigarProcess() { public SigarProcess() {
this.sigarImpl = new Sigar(); this(new Sigar());
}
public SigarProcess(Sigar sigar) {
this.sigarImpl = sigar;
this.sigar = SigarProxyCache.newInstance(sigarImpl); this.sigar = SigarProxyCache.newInstance(sigarImpl);
} }