Example usage for org.apache.commons.daemon DaemonContext getArguments

List of usage examples for org.apache.commons.daemon DaemonContext getArguments

Introduction

In this page you can find the example usage for org.apache.commons.daemon DaemonContext getArguments.

Prototype

public String[] getArguments();

Source Link

Document

Returns an array of String arguments supplied by the environment.

Usage

From source file:com.yahoo.athenz.container.AthenzDaemon.java

public void init(DaemonContext context) throws Exception {
    args = context.getArguments();
}

From source file:com.threecrickets.scripturian.ScripturianDaemon.java

public void init(DaemonContext context) throws Exception {
    arguments = context.getArguments();
}

From source file:com.microrisc.opengateway.OpenGateway.java

@Override
public void init(DaemonContext daemonContext) throws DaemonInitException, Exception {

    String[] args = daemonContext.getArguments();

    // creating runner instance
    runner = new OpenGatewayRunner();
}

From source file:com.pte.liquid.LiquidElastic.java

@Override
public void init(DaemonContext context) throws DaemonInitException, Exception {
    logger.info("Initializing liquid daemon");
    buildUp(context.getArguments());
}

From source file:fi.ilmoeuro.membertrack.elock.ElockDaemon.java

@Override
public void init(DaemonContext dc) throws DaemonInitException, Exception {
    final String[] args = dc.getArguments();
    init(args);//  w  w  w . j av  a  2s. com
}

From source file:com.gft.boot.daemon.SpringBootDaemon.java

public void init(DaemonContext context) throws Exception {
    System.out.println("Daemon initialized with arguments [" + Arrays.toString(context.getArguments()) + "]");
    this.springBootApp = ClassUtils.resolveClassName(context.getArguments()[0],
            SpringBootDaemon.class.getClassLoader());
}

From source file:com.yahoo.athenz.zts.ZTSDaemonTest.java

@Test
public void testZTSDaemon() throws Exception {

    ZTSDaemon daemon = new ZTSDaemon();

    DaemonContext ctxMock = Mockito.mock(DaemonContext.class);
    Mockito.when(ctxMock.getArguments()).thenReturn(null);

    daemon.init(ctxMock);//from   w w w.j  a v a  2  s  . c o m

    // nothing to do
    daemon.start();
    daemon.stop();
    daemon.destroy();
}

From source file:com.vaushell.superpipes.DaemonApp.java

@Override
public void init(final DaemonContext context) throws Exception {
    final String[] args = context.getArguments();

    // My config//  w ww . jav  a2  s  . co  m
    final XMLConfiguration config = new XMLConfiguration();
    config.setDelimiterParsingDisabled(true);

    final Path datas;
    switch (args.length) {
    case 1: {
        config.load(args[0]);
        datas = Paths.get("datas");
        break;
    }

    case 2: {
        config.load(args[0]);
        datas = Paths.get(args[1]);
        break;
    }

    default: {
        config.load("conf/configuration.xml");
        datas = Paths.get("datas");
        break;
    }
    }

    dispatcher.init(config, datas, new VC_FileFactory(datas));
}

From source file:com.aspectran.daemon.JsvcDaemon.java

@Override
public void init(DaemonContext daemonContext) throws Exception {
    if (defaultDaemon == null) {
        String[] args = daemonContext.getArguments();
        String basePath = AspectranConfig.determineBasePath(args);
        File aspectranConfigFile = AspectranConfig.determineAspectranConfigFile(args);

        try {// w w w .  j a v  a2s .  c o  m
            defaultDaemon = new DefaultDaemon();
            defaultDaemon.init(basePath, aspectranConfigFile);
        } catch (Exception e) {
            e.printStackTrace(System.err);
            throw e;
        }
    }
}

From source file:com.jkoolcloud.tnt4j.streams.StreamsDaemon.java

@Override
public void init(DaemonContext daemonContext) throws DaemonInitException, Exception {
    String[] arguments = daemonContext.getArguments();
    LOGGER.log(OpLevel.INFO,/*ww  w  .j a v a  2s  . com*/
            StreamsResources.getString(StreamsResources.RESOURCE_BUNDLE_NAME, "StreamsDaemon.init"),
            (Object[]) arguments);

    if (!Utils.isEmpty(arguments)) {
        LOGGER.log(OpLevel.INFO, StreamsResources.getString(StreamsResources.RESOURCE_BUNDLE_NAME,
                "StreamsDaemon.processing.args"), (Object[]) arguments);

        StreamsAgent.processArgs(arguments);
    } else {
        LOGGER.log(OpLevel.WARNING,
                StreamsResources.getString(StreamsResources.RESOURCE_BUNDLE_NAME, "StreamsDaemon.no.args"));
    }
}