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


Java WrapperManager.stop方法代码示例

本文整理汇总了Java中org.tanukisoftware.wrapper.WrapperManager.stop方法的典型用法代码示例。如果您正苦于以下问题:Java WrapperManager.stop方法的具体用法?Java WrapperManager.stop怎么用?Java WrapperManager.stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.tanukisoftware.wrapper.WrapperManager的用法示例。


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

示例1: controlEvent

import org.tanukisoftware.wrapper.WrapperManager; //导入方法依赖的package包/类
/**
 * Called whenever the native wrapper code traps a system control signal
 * against the Java process. It is up to the callback to take any actions
 * necessary. Possible values are: WrapperManager.WRAPPER_CTRL_C_EVENT,
 * WRAPPER_CTRL_CLOSE_EVENT, WRAPPER_CTRL_LOGOFF_EVENT, or
 * WRAPPER_CTRL_SHUTDOWN_EVENT
 */
@Override
public void controlEvent(int event) {
	if ((event == WrapperManager.WRAPPER_CTRL_LOGOFF_EVENT) && WrapperManager.isLaunchedAsService()) {
		// Ignore
		if (logger.isInfoEnabled()) {
			logger.info("ServiceWrapper: controlEvent(" + event + ") Ignored");
		}

	} else {
		if (logger.isInfoEnabled()) {
			logger.info("ServiceWrapper: controlEvent(" + event + ") Stopping");
		}
		WrapperManager.stop(0);
		// Will not get here.
	}
}
 
开发者ID:SOBotics,项目名称:SOCVFinder,代码行数:24,代码来源:SOCVFinderServiceWrapper.java

示例2: handleRequestInternal

import org.tanukisoftware.wrapper.WrapperManager; //导入方法依赖的package包/类
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request,
    HttpServletResponse response) throws Exception {

  boolean done = false;
  try {
    Class.forName("org.tanukisoftware.wrapper.WrapperManager");
    logger.info("JVM is STOPPED by {}", request.getRemoteAddr());
    WrapperManager.stop(stopExitCode);
    done = true;
  } catch (ClassNotFoundException e) {
    logger.info("WrapperManager not found. Do you have wrapper.jar in the classpath?");
    logger.trace("", e);
  }
  return new ModelAndView(getViewName(), "done", done);
}
 
开发者ID:psi-probe,项目名称:psi-probe,代码行数:17,代码来源:StopJvmController.java

示例3: controlEvent

import org.tanukisoftware.wrapper.WrapperManager; //导入方法依赖的package包/类
public void controlEvent(int event) {
if ((event == WrapperManager.WRAPPER_CTRL_LOGOFF_EVENT)
	&& (WrapperManager.isLaunchedAsService() || WrapperManager.isLaunchedAsService())) {
    // Ignore
} else {
    WrapperManager.stop(0);
    // Will not get here.
}
   }
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:10,代码来源:HelloWorld.java

示例4: controlEvent

import org.tanukisoftware.wrapper.WrapperManager; //导入方法依赖的package包/类
@Override
public void controlEvent(int event) {
    if ((WrapperManager.WRAPPER_CTRL_LOGOFF_EVENT == event)
        && WrapperManager.isLaunchedAsService()) {
        // Ignore
    } else {
        WrapperManager.stop(0);
    }
}
 
开发者ID:InstantCom,项目名称:Keiko,代码行数:10,代码来源:KeikoSniffer.java

示例5: handleRequestInternal

import org.tanukisoftware.wrapper.WrapperManager; //导入方法依赖的package包/类
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
    boolean done = false;
    try {
        Class.forName("org.tanukisoftware.wrapper.WrapperManager");
        logger.info("JVM is STOPPED by "+request.getRemoteAddr());
        WrapperManager.stop(stopExitCode);
        done = true;
    } catch (ClassNotFoundException e) {
        logger.info("WrapperManager not found. Do you have wrapper.jar in the classpath?");
    }
    return new ModelAndView(getViewName(), "done", Boolean.valueOf(done));
}
 
开发者ID:andresol,项目名称:psi-probe-plus,代码行数:13,代码来源:StopJvmController.java

示例6: boot

import org.tanukisoftware.wrapper.WrapperManager; //导入方法依赖的package包/类
public static void boot() {
	System.out.println(GlobalContext.VERSION + " master server starting.");
	System.out.println("http://drftpd.org/");
	System.out.println("Further logging will be done using (mostly) log4j, check logs/");
	// Set current thread name to make it clear in logfiles what is coming from the main master process 
	// instead of being named after the wrapper
	Thread.currentThread().setName("Master Main Thread");

	try {
		logger.info("Starting ConnectionManager");

		GlobalContext.getGlobalContext().init();

		getConnectionManager().loadCommands();
		Properties cfg = GlobalContext.getConfig().getMainProperties();
		/** initialise command manager before accepting connections **/
		getConnectionManager().initCommandManager();

		/** listen for connections * */
		String bindip = null;
		ServerSocket server = null;
		boolean useIP;

		try {
			bindip = PropertyHelper.getProperty(cfg, "master.ip");
               useIP = !bindip.equals("");
		} catch (NullPointerException e) {
			useIP = false;
		}

		if (useIP) {
			server = new ServerSocket();
			server.bind(new InetSocketAddress(bindip, Integer
					.parseInt(PropertyHelper
							.getProperty(cfg, "master.port"))));
			_bindIP = bindip;
			logger.info("Listening on " + server.getInetAddress() + ":"
					+ server.getLocalPort());
		} else {
			server = new ServerSocket(Integer.parseInt(PropertyHelper
					.getProperty(cfg, "master.port")));
			logger.info("Listening on port " + server.getLocalPort());
		}

		getConnectionManager().createThreadPool();

		while (true) {		
			getConnectionManager().start(server.accept());
		}

		// catches subclasses of Error and Exception
	} catch (Throwable th) {
		th.printStackTrace();
		logger.error("", th);
		WrapperManager.stop(0);

		return;
	}
}
 
开发者ID:drftpd-ng,项目名称:drftpd3,代码行数:60,代码来源:ConnectionManager.java

示例7: handleShutdown

import org.tanukisoftware.wrapper.WrapperManager; //导入方法依赖的package包/类
public AsyncResponse handleShutdown(AsyncCommandArgument ac) {
	logger.info("The master has requested that I shutdown");
	WrapperManager.stop(0);
	return null;
}
 
开发者ID:drftpd-ng,项目名称:drftpd3,代码行数:6,代码来源:BasicHandler.java

示例8: boot

import org.tanukisoftware.wrapper.WrapperManager; //导入方法依赖的package包/类
public static void boot() {
	System.out.println(GlobalContext.VERSION + " master server starting.");
	System.out.println("http://drftpd.org/");
	System.out.println("Further logging will be done using (mostly) log4j, check logs/");
	// Set current thread name to make it clear in logfiles what is coming from the main master process 
	// instead of being named after the wrapper
	Thread.currentThread().setName("Master Main Thread");

	try {
		logger.info("Starting ConnectionManager");

		GlobalContext.getGlobalContext().init();

		getConnectionManager().loadCommands();
		Properties cfg = GlobalContext.getConfig().getMainProperties();
		/** initialise command manager before accepting connections **/
		getConnectionManager().initCommandManager();

		/** listen for connections * */
		String bindip = null;
		ServerSocket server = null;
		boolean useIP;

		try {
			bindip = PropertyHelper.getProperty(cfg, "master.ip");
			if (bindip.equals(""))
				useIP = false;
			else
				useIP = true;
		} catch (NullPointerException e) {
			useIP = false;
		}

		if (useIP) {
			server = new ServerSocket();
			server.bind(new InetSocketAddress(bindip, Integer
					.parseInt(PropertyHelper
							.getProperty(cfg, "master.port"))));
			_bindIP = bindip;
			logger.info("Listening on " + server.getInetAddress() + ":"
					+ server.getLocalPort());
		} else {
			server = new ServerSocket(Integer.parseInt(PropertyHelper
					.getProperty(cfg, "master.port")));
			logger.info("Listening on port " + server.getLocalPort());
		}

		getConnectionManager().createThreadPool();

		while (true) {		
			getConnectionManager().start(server.accept());
		}

		// catches subclasses of Error and Exception
	} catch (Throwable th) {
		th.printStackTrace();
		logger.error("", th);
		WrapperManager.stop(0);

		return;
	}
}
 
开发者ID:f4bio,项目名称:drftpd3-extended,代码行数:63,代码来源:ConnectionManager.java


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