本文整理汇总了Java中org.jivesoftware.openfire.container.AdminConsolePlugin类的典型用法代码示例。如果您正苦于以下问题:Java AdminConsolePlugin类的具体用法?Java AdminConsolePlugin怎么用?Java AdminConsolePlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AdminConsolePlugin类属于org.jivesoftware.openfire.container包,在下文中一共展示了AdminConsolePlugin类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restartHTTPServer
import org.jivesoftware.openfire.container.AdminConsolePlugin; //导入依赖的package包/类
/**
* Restarts the HTTP server only when running in stand alone mode. The restart
* process will be done in another thread that will wait 1 second before doing
* the actual restart. The delay will give time to the page that requested the
* restart to fully render its content.
*/
public void restartHTTPServer() {
Thread restartThread = new Thread() {
@Override
public void run() {
if (isStandAlone()) {
// Restart the HTTP server manager. This covers the case
// of changing the ports, as well as generating self-signed certificates.
// Wait a short period before shutting down the admin console.
// Otherwise, this page won't render properly!
try {
Thread.sleep(1000);
((AdminConsolePlugin) pluginManager.getPlugin("admin")).shutdown();
((AdminConsolePlugin) pluginManager.getPlugin("admin")).startup();
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
restartThread.setContextClassLoader(loader);
restartThread.start();
}
示例2: restartHTTPServer
import org.jivesoftware.openfire.container.AdminConsolePlugin; //导入依赖的package包/类
/**
* Restarts the HTTP server only when running in stand alone mode. The restart
* process will be done in another thread that will wait 1 second before doing
* the actual restart. The delay will give time to the page that requested the
* restart to fully render its content.
*/
public void restartHTTPServer() {
Thread restartThread = new Thread() {
@Override
public void run() {
if (isStandAlone()) {
// Restart the HTTP server manager. This covers the case
// of changing the ports, as well as generating self-signed certificates.
// Wait a short period before shutting down the admin console.
// Otherwise, this page won't render properly!
try {
Thread.sleep(1000);
((AdminConsolePlugin) pluginManager.getPlugin("admin")).shutdown();
((AdminConsolePlugin) pluginManager.getPlugin("admin")).startup();
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
restartThread.setContextClassLoader(loader);
restartThread.start();
}
示例3: destroyPlugin
import org.jivesoftware.openfire.container.AdminConsolePlugin; //导入依赖的package包/类
public void destroyPlugin() {
PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
((AdminConsolePlugin) pluginManager.getPlugin("admin")
).getContexts().removeHandler(context);
try {
context.stop();
}
catch (Exception e) {
Log.error(e);
}
context = null;
}