当前位置: 首页>>代码示例>>Java>>正文


Java DaemonController类代码示例

本文整理汇总了Java中org.apache.commons.daemon.DaemonController的典型用法代码示例。如果您正苦于以下问题:Java DaemonController类的具体用法?Java DaemonController怎么用?Java DaemonController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DaemonController类属于org.apache.commons.daemon包,在下文中一共展示了DaemonController类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
@Override
public synchronized void init(DaemonContext context) {
    if (state != State.NONE) {
        throw new IllegalStateException("initialized already");
    }

    final JCommander commander = new JCommander(this);
    commander.setProgramName(getClass().getName());
    commander.parse(context.getArguments());

    if (help != null && help) {
        commander.usage();
        final DaemonController controller = context.getController();
        if (controller != null) {
            controller.fail();
        }
        return;
    }

    state = State.INITIALIZED;
}
 
开发者ID:line,项目名称:centraldogma,代码行数:22,代码来源:Main.java

示例2: main

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
public static void main(String[] args) throws Exception {

        QuotaServerDaemon daemon = new QuotaServerDaemon();
        try {
            DaemonContext dc = new DaemonContext() {
                @Override
                public DaemonController getController() {
                    return null;
                }

                @Override
                public String[] getArguments() {
                    return new String[]{"/home/edgar/Documents/stackSync/stacksync-quota-server/config.properties"};
                }
            };

            daemon.init(dc);
            daemon.start();
        } catch (Exception e) {
            throw e;
        }
    }
 
开发者ID:stacksync,项目名称:stacksync-quota-server,代码行数:23,代码来源:ServerTest.java

示例3: main

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
public static void main(String[] args) throws Exception  {
	
	SyncServiceDaemon daemon = new SyncServiceDaemon();
	try {
		DaemonContext dc = new DaemonContext() {
			
			@Override
			public DaemonController getController() {
				return null;
			}
			
			@Override
			public String[] getArguments() {
				return new String[]{"/home/edgar/Documents/stackSync/sync-service/config.properties"};
			}
		};
		
		daemon.init(dc);
		daemon.start();
	} catch (Exception e) {
		throw e;
	}
}
 
开发者ID:stacksync,项目名称:sync-service,代码行数:24,代码来源:ServerTest.java

示例4: DaemonStarter

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
public DaemonStarter ( final Class<?> className, final String[] args ) throws Exception
{
    final Object o = className.newInstance ();
    if ( ! ( o instanceof Daemon ) )
    {
        throw new RuntimeException ( String.format ( "Class must implement '%s'", Daemon.class ) );
    }

    final DaemonController controller = this;
    this.daemon = (Daemon)o;
    this.daemon.init ( new DaemonContext () {

        @Override
        public String[] getArguments ()
        {
            return args;
        }

        @Override
        public DaemonController getController ()
        {
            return controller;
        }
    } );
    this.daemon.start ();

}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:28,代码来源:DaemonStarter.java

示例5: getController

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
@Override
public DaemonController getController() {
    return null;
}
 
开发者ID:envirover,项目名称:SPLGroundControl,代码行数:5,代码来源:SPLGroundControl.java

示例6: WatchDog

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
public WatchDog(DaemonController controller, Context cxt) {
  this.controller = controller;
  this.cxt = cxt;
  this.setDaemon(true);
  this.setName("WatchDog");
}
 
开发者ID:HashDataInc,项目名称:bireme,代码行数:7,代码来源:Context.java

示例7: startWatchDog

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
public void startWatchDog(DaemonController controller) {
  watchDog = new WatchDog(controller, this);
  watchDog.start();
}
 
开发者ID:HashDataInc,项目名称:bireme,代码行数:5,代码来源:Context.java

示例8: getController

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
public DaemonController getController()
{
    return daemonController;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:5,代码来源:DaemonLoader.java

示例9: setController

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
public void setController(DaemonController controller)
{
    this.daemonController = controller;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:5,代码来源:DaemonLoader.java

示例10: getController

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
public DaemonController getController() {
    return controller;
}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:4,代码来源:BootstrapServiceContext.java

示例11: setController

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
public void setController(DaemonController controller) {
    this.controller = controller;
}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:4,代码来源:BootstrapServiceContext.java

示例12: DummyDaemonContext

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
public DummyDaemonContext(String[] args, DaemonController dc){
	this.args = args;
	this.dc = dc;
}
 
开发者ID:emanuelecasadio,项目名称:CliDispatcher,代码行数:5,代码来源:DummyDaemonContext.java

示例13: getController

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
public DaemonController getController() {
	return dc;
}
 
开发者ID:emanuelecasadio,项目名称:CliDispatcher,代码行数:4,代码来源:DummyDaemonContext.java

示例14: getController

import org.apache.commons.daemon.DaemonController; //导入依赖的package包/类
@Override
public DaemonController getController() {
	return daemonController;
}
 
开发者ID:ngerakines,项目名称:elasticservices,代码行数:5,代码来源:SimpleDaemonContext.java


注:本文中的org.apache.commons.daemon.DaemonController类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。