mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-02-02 12:49:11 +01:00
Cleanup Code
Pushed-by: Rene Pfeuffer<rene.pfeuffer@cloudogu.com> Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
This commit is contained in:
@@ -24,82 +24,44 @@
|
||||
|
||||
package sonia.scm.server;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import org.apache.commons.daemon.Daemon;
|
||||
import org.apache.commons.daemon.DaemonContext;
|
||||
import org.apache.commons.daemon.DaemonInitException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
|
||||
public class ScmServerDaemon implements Daemon
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
private static volatile ScmServer webserver = new ScmServer();
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
private String[] daemonArgs;
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
{
|
||||
webserver.run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param args
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
|
||||
public static void start(String[] args) throws Exception
|
||||
{
|
||||
webserver.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param args
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
|
||||
public static void stop(String[] args) throws Exception
|
||||
{
|
||||
webserver.stopServer();
|
||||
webserver.join((long) ScmServer.GRACEFUL_TIMEOUT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
|
||||
// do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param context
|
||||
*
|
||||
* @throws DaemonInitException
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void init(DaemonContext context) throws DaemonInitException, Exception
|
||||
{
|
||||
@@ -110,32 +72,16 @@ public class ScmServerDaemon implements Daemon
|
||||
webserver.init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void start() throws Exception
|
||||
{
|
||||
start(daemonArgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void stop() throws Exception
|
||||
{
|
||||
stop(daemonArgs);
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private String[] daemonArgs;
|
||||
}
|
||||
|
||||
@@ -24,53 +24,28 @@
|
||||
|
||||
package sonia.scm.server;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
|
||||
public class ScmServerException extends RuntimeException
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
private static final long serialVersionUID = -6496747280225411051L;
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
public ScmServerException() {}
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*
|
||||
* @param message
|
||||
*/
|
||||
|
||||
public ScmServerException(String message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*
|
||||
* @param throwable
|
||||
*/
|
||||
|
||||
public ScmServerException(Throwable throwable)
|
||||
{
|
||||
super(throwable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*
|
||||
* @param message
|
||||
* @param throwable
|
||||
*/
|
||||
|
||||
public ScmServerException(String message, Throwable throwable)
|
||||
{
|
||||
super(message, throwable);
|
||||
|
||||
Reference in New Issue
Block a user