From 53430acdcc075a2add8d71857ffac7fd8b21311a Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 27 Jun 2005 01:18:44 +0000 Subject: [PATCH] moving list method to Service class --- .../src/net/hyperic/sigar/win32/Service.java | 19 ++++++++++++++++--- .../hyperic/sigar/win32/ServiceConfig.java | 13 ------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bindings/java/src/net/hyperic/sigar/win32/Service.java b/bindings/java/src/net/hyperic/sigar/win32/Service.java index b1d3da4a..f86bb50a 100644 --- a/bindings/java/src/net/hyperic/sigar/win32/Service.java +++ b/bindings/java/src/net/hyperic/sigar/win32/Service.java @@ -1,5 +1,6 @@ package net.hyperic.sigar.win32; +import java.io.PrintStream; import java.util.Arrays; import java.util.List; @@ -294,6 +295,20 @@ public class Service extends Win32 { private static native boolean QueryServiceConfig(long handle, 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 { List services; if (args.length == 0) { @@ -320,9 +335,7 @@ public class Service extends Win32 { for (int i=0; i