本文整理汇总了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.
}
}
示例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);
}
示例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.
}
}
示例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);
}
}
示例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));
}
示例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;
}
}
示例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;
}
示例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;
}
}