co.cask.common.runtime
Class DaemonMain

java.lang.Object
  extended by co.cask.common.runtime.DaemonMain

public abstract class DaemonMain
extends Object

A abstract base class for bridging standard main method to method invoked through apache commons-daemon jsvc.


Constructor Summary
DaemonMain()
           
 
Method Summary
abstract  void destroy()
          Invoked by jsvc for resource cleanup.
protected  void doMain(String[] args)
          The main method.
abstract  void init(String[] args)
          Invoked by jsvc to initialize the program.
abstract  void start()
          Invoked by jsvc to start the program.
abstract  void stop()
          Invoked by jsvc to stop the program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DaemonMain

public DaemonMain()
Method Detail

doMain

protected void doMain(String[] args)
               throws Exception
The main method. It simply call methods in the same sequence as if the program is started by jsvc.

Throws:
Exception

init

public abstract void init(String[] args)
Invoked by jsvc to initialize the program.


start

public abstract void start()
Invoked by jsvc to start the program.


stop

public abstract void stop()
Invoked by jsvc to stop the program.


destroy

public abstract void destroy()
Invoked by jsvc for resource cleanup.



Copyright © 2015 Cask Data, Inc. Licensed under the Apache License, Version 2.0.