3

I wrote a Daemon by using the apache commons sample code:

public class LockDaemon implements Daemon {

@Override
public void init(DaemonContext context) throws DaemonInitException, Exception {
    LogManager.getLogger().info("initialized with arguments {}", context.getArguments());
}

@Override
public void start() throws Exception {
    LogManager.getLogger().info("Start called");

}

@Override
public void stop() throws Exception {
    LogManager.getLogger().info("Stop called");
}

@Override
public void destroy() {

}

}

Unfortunately the example does not mention how to install this class with procrun. Procrun needs a static "Start Method", which I do not have when using the code above.

So which start (and stop) method needs to be set for procrun to make the code above work?

4

1 回答 1

0

这个问题在这个线程中进一步讨论:Howto setup a Daemon implementation as windows service

于 2016-05-18T10:51:11.270 回答