Example usage for org.apache.commons.daemon DaemonInitException getMessage

List of usage examples for org.apache.commons.daemon DaemonInitException getMessage

Introduction

In this page you can find the example usage for org.apache.commons.daemon DaemonInitException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:com.cws.esolutions.agent.AgentDaemon.java

public static void main(final String[] args) {
    AgentDaemon daemon = new AgentDaemon();

    if (args.length != 1) {
        AgentDaemon.usage();//w  w  w  . j  a v  a2s.co m

        return;
    }

    try {
        if (StringUtils.equals("start", args[0])) {
            daemon.init(null);
            daemon.start();
        } else if (StringUtils.equals("stop", args[0])) {
            daemon.stop();
        } else {
            AgentDaemon.usage();
        }
    } catch (DaemonInitException dix) {
        ERROR_RECORDER.error(dix.getMessage(), dix);

        System.exit(-1);
    }
}