use of javax.annotation.PreDestroy in project che by eclipse.
the class ServerInitializerImpl method shutdown.
@PreDestroy
protected void shutdown() {
for (LanguageServer server : serversToInitResult.keySet()) {
server.shutdown();
server.exit();
}
}
use of javax.annotation.PreDestroy in project che by eclipse.
the class CheEnvironmentEngine method cleanup.
/**
* Removes all descriptors from the in-memory storage, while
* {@link MachineProcessManager#cleanup()} is responsible for machines destroying.
*/
@PreDestroy
@VisibleForTesting
@SuppressWarnings("unused")
void cleanup() {
isPreDestroyInvoked = true;
final java.io.File[] files = machineLogsDir.listFiles();
if (files != null && files.length > 0) {
for (java.io.File f : files) {
if (!IoUtil.deleteRecursive(f)) {
LOG.warn("Failed delete {}", f);
}
}
}
}
use of javax.annotation.PreDestroy in project presto by prestodb.
the class SqlQueryManager method stop.
@PreDestroy
public void stop() {
boolean queryCancelled = false;
for (QueryExecution queryExecution : queries.values()) {
if (queryExecution.getState().isDone()) {
continue;
}
log.info("Server shutting down. Query %s has been cancelled", queryExecution.getQueryId());
queryExecution.fail(new PrestoException(SERVER_SHUTTING_DOWN, "Server is shutting down. Query " + queryExecution.getQueryId() + " has been cancelled"));
queryCancelled = true;
}
if (queryCancelled) {
try {
TimeUnit.SECONDS.sleep(5);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
queryManagementExecutor.shutdownNow();
queryExecutor.shutdownNow();
}
use of javax.annotation.PreDestroy in project rocketmq-externals by apache.
the class TestRocketMQServer method shutdown.
@PreDestroy
private void shutdown() {
brokerController.shutdown();
namesrvController.shutdown();
deleteFile(new File(TEST_FILE_ROOT_DIR));
}
use of javax.annotation.PreDestroy in project PublicCMS-preview by sanluan.
the class CacheComponent method clear.
/**
*/
@PreDestroy
public void clear() {
for (Cache cache : cacheableList) {
cache.clear();
}
clearViewCache();
hqlService.clear();
}
Aggregations