use of com.orientechnologies.orient.core.OSignalHandler in project orientdb by orientechnologies.
the class OConsoleDatabaseApp method main.
public static void main(final String[] args) {
int result = 0;
try {
boolean tty = false;
try {
if (setTerminalToCBreak())
tty = true;
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
restoreTerminal();
}
});
} catch (Exception ignored) {
}
new OSignalHandler().installDefaultSignals(new SignalHandler() {
public void handle(Signal signal) {
restoreTerminal();
}
});
final OConsoleDatabaseApp console = new OConsoleDatabaseApp(args);
if (tty)
console.setReader(new TTYConsoleReader());
result = console.run();
} finally {
restoreTerminal();
}
Orient.instance().shutdown();
System.exit(result);
}
Aggregations