public void close() { if (scheduledExecutor != null) { Threads.shutdownGracefully(scheduledExecutor, 1000, 1000, TimeUnit.MILLISECONDS); } }
public void stop() { LOGGER.info("{} server is stopping", getServerName()); bossGroup.shutdownGracefully(); workerGroup.shutdownGracefully(); int timeoutMills = args.shutdownTimeoutMills; Threads.shutdownGracefully(userExecutor, timeoutMills, timeoutMills, TimeUnit.SECONDS); LOGGER.info("{} server stoped", getServerName()); }
/** * Close the database. */ public synchronized void close() { if (closing) { return; } if (userSessions.size() > 0) { Session[] all = new Session[userSessions.size()]; userSessions.toArray(all); for (Session s : all) { try { s.rollback(); s.close(); } catch (DbException e) { trace.error(e, "disconnecting session #{0}", s.getId()); } } } repository.close(); if (queryExecutor != null) { Threads.shutdownGracefully(queryExecutor, 1000, 1000, TimeUnit.MILLISECONDS); } closing = true; }