本文整理汇总了Java中org.hawk.core.IModelIndexer.ShutdownRequestType类的典型用法代码示例。如果您正苦于以下问题:Java ShutdownRequestType类的具体用法?Java ShutdownRequestType怎么用?Java ShutdownRequestType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ShutdownRequestType类属于org.hawk.core.IModelIndexer包,在下文中一共展示了ShutdownRequestType类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stop
import org.hawk.core.IModelIndexer.ShutdownRequestType; //导入依赖的package包/类
@Override
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
HManager.getInstance().stopAllRunningInstances(
ShutdownRequestType.ONLY_LOCAL);
if (artemis != null) {
artemis.stop();
artemis = null;
}
if (tcpServer != null) {
tcpServer.stop();
tcpServer = null;
}
}
示例2: stop
import org.hawk.core.IModelIndexer.ShutdownRequestType; //导入依赖的package包/类
@Override
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
HManager.getInstance().stopAllRunningInstances(
ShutdownRequestType.ONLY_LOCAL);
if (artemis != null) {
artemis.stop();
artemis = null;
}
if (tcpServer != null) {
tcpServer.stop();
tcpServer = null;
}
}
示例3: delete
import org.hawk.core.IModelIndexer.ShutdownRequestType; //导入依赖的package包/类
public void delete() throws BackingStoreException {
removeHawkFromMetadata(getHawkConfig());
File f = hawk.getModelIndexer().getParentFolder();
if (this.isRunning()) {
try {
hawk.getModelIndexer().shutdown(ShutdownRequestType.ONLY_LOCAL);
} catch (Exception e) {
e.printStackTrace();
}
}
if (f.exists()) {
getConsole().println("Hawk instance removed from ui but persistence remains at: " + f);
}
}
示例4: stopInstance
import org.hawk.core.IModelIndexer.ShutdownRequestType; //导入依赖的package包/类
@Override
public void stopInstance(String name) throws HawkInstanceNotFound, TException {
final HModel model = getHawkByName(name);
if (model.isRunning()) {
model.stop(ShutdownRequestType.ALWAYS);
removeStateListener(model);
}
}
示例5: _hawkStopInstance
import org.hawk.core.IModelIndexer.ShutdownRequestType; //导入依赖的package包/类
public Object _hawkStopInstance(CommandInterpreter intp) throws Exception {
checkConnected();
final String name = requiredArgument(intp, "name");
final HModel hi = hawkManager.getHawkByName(name);
if (hi.isRunning()) {
hi.stop(ShutdownRequestType.ALWAYS);
return String.format("Stopped instance %s", name);
} else {
return String.format("Instance %s was already stopped", name);
}
}
示例6: consoleInteraction
import org.hawk.core.IModelIndexer.ShutdownRequestType; //导入依赖的package包/类
private static Thread consoleInteraction(final IModelIndexer i2) {
return new Thread() {
@Override
public void run() {
while (true) {
BufferedReader r = new BufferedReader(
new InputStreamReader(System.in));
try {
String s = r.readLine();
if (s.equalsIgnoreCase("quit")
|| s.equalsIgnoreCase("exit")
|| s.equalsIgnoreCase("e")) {
i2.shutdown(ShutdownRequestType.ONLY_LOCAL);
System.exit(0);
}
if (s.equalsIgnoreCase("query")
|| s.equalsIgnoreCase("q")) {
q.query(i, query, null);
}
if (s.equalsIgnoreCase("nuke")) {
i2.delete();
System.exit(0);
}
} catch (Exception e) {
e.printStackTrace();
}
}
};
};
}
示例7: consoleInteraction
import org.hawk.core.IModelIndexer.ShutdownRequestType; //导入依赖的package包/类
private static Thread consoleInteraction(final IModelIndexer i2) {
return new Thread() {
@Override
public void run() {
while (true) {
BufferedReader r = new BufferedReader(
new InputStreamReader(System.in));
try {
String s = r.readLine();
if (s.equalsIgnoreCase("quit")
|| s.equalsIgnoreCase("exit")
|| s.equalsIgnoreCase("e")) {
i2.shutdown(ShutdownRequestType.ONLY_LOCAL);
System.exit(0);
}
if (s.equalsIgnoreCase("query")
|| s.equalsIgnoreCase("q")) {
q.query(i, query3, null);
}
} catch (Exception e) {
e.printStackTrace();
}
}
};
};
}
示例8: stopAllRunningInstances
import org.hawk.core.IModelIndexer.ShutdownRequestType; //导入依赖的package包/类
public boolean stopAllRunningInstances(ShutdownRequestType reqType) {
HModel.getConsole().println("Shutting down hawk:");
for (HModel hm : all) {
if (hm.isRunning()) {
HModel.getConsole().println(String.format("Stopping %s (%s)", hm.getName(), hm.getFolder()));
hm.stop(reqType);
}
}
return true;
}
示例9: stop
import org.hawk.core.IModelIndexer.ShutdownRequestType; //导入依赖的package包/类
public void stop(ShutdownRequestType requestType) {
try {
hawk.getModelIndexer().shutdown(requestType);
} catch (Exception e) {
getConsole().printerrln(e);
}
}
示例10: preShutdown
import org.hawk.core.IModelIndexer.ShutdownRequestType; //导入依赖的package包/类
@Override
public boolean preShutdown(IWorkbench workbench, boolean forced) {
System.out.println("(PRE SHUTDOWN) Shutting down Hawk");
HUIManager.getInstance().stopAllRunningInstances(
ShutdownRequestType.ONLY_LOCAL);
return true;
}
示例11: teardown
import org.hawk.core.IModelIndexer.ShutdownRequestType; //导入依赖的package包/类
@After
public void teardown() throws Exception {
indexer.shutdown(ShutdownRequestType.ALWAYS);
db.delete();
}