moving list method to Service class
This commit is contained in:
parent
b342c2aca2
commit
53430acdcc
|
@ -1,5 +1,6 @@
|
||||||
package net.hyperic.sigar.win32;
|
package net.hyperic.sigar.win32;
|
||||||
|
|
||||||
|
import java.io.PrintStream;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -294,6 +295,20 @@ public class Service extends Win32 {
|
||||||
private static native boolean QueryServiceConfig(long handle,
|
private static native boolean QueryServiceConfig(long handle,
|
||||||
ServiceConfig config) throws Win32Exception;
|
ServiceConfig config) throws Win32Exception;
|
||||||
|
|
||||||
|
public void list(PrintStream out) throws Win32Exception {
|
||||||
|
ServiceConfig config = getConfig();
|
||||||
|
out.println("display.......[" + config.getDisplayName() + "]");
|
||||||
|
out.println("description...[" + config.getDescription() + "]");
|
||||||
|
out.println("status........[" + getStatusString() + "]");
|
||||||
|
out.println("start type....[" + config.getStartTypeString() + "]");
|
||||||
|
out.println("start name....[" + config.getServiceStartName() + "]");
|
||||||
|
|
||||||
|
out.println("type.........." + config.getTypeList());
|
||||||
|
out.println("path..........[" + config.getPath() + "]");
|
||||||
|
out.println("deps.........." + Arrays.asList(config.getDependencies()));
|
||||||
|
out.println("error ctl.....[" + config.getErrorControlString() + "]");
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
List services;
|
List services;
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
|
@ -320,9 +335,7 @@ public class Service extends Win32 {
|
||||||
for (int i=0; i<services.size(); i++) {
|
for (int i=0; i<services.size(); i++) {
|
||||||
String name = (String)services.get(i);
|
String name = (String)services.get(i);
|
||||||
Service service = new Service(name);
|
Service service = new Service(name);
|
||||||
service.getConfig().list(System.out);
|
service.list(System.out);
|
||||||
System.out.println("status........[" +
|
|
||||||
service.getStatusString() + "]");
|
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package net.hyperic.sigar.win32;
|
package net.hyperic.sigar.win32;
|
||||||
|
|
||||||
import java.io.PrintStream;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ServiceConfig {
|
public class ServiceConfig {
|
||||||
|
@ -298,15 +296,4 @@ public class ServiceConfig {
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void list(PrintStream out) {
|
|
||||||
out.println("name..........[" + getName() + "]");
|
|
||||||
out.println("display.......[" + getDisplayName() + "]");
|
|
||||||
out.println("description...[" + getDescription() + "]");
|
|
||||||
out.println("path..........[" + getPath() + "]");
|
|
||||||
out.println("deps.........." + Arrays.asList(getDependencies()));
|
|
||||||
out.println("type.........." + getTypeList());
|
|
||||||
out.println("start type....[" + getStartTypeString() + "]");
|
|
||||||
out.println("error ctl.....[" + getErrorControlString() + "]");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue