private void shutdownServer() {
		logger.info("HSQL Server Shutdown sequence initiated");
		if (server != null) {
			server.signalCloseAllServerConnections();
			server.stop();
			server.shutdown();
			// Wait until the server shuts down or timeout after 5 seconds.
			int attempts = 0;
			while (server.getState() != ServerConstants.SERVER_STATE_SHUTDOWN
					&& attempts++ < 50) {
				try {
					Thread.sleep(100);
				}
				catch (InterruptedException e) {
					Thread.currentThread().interrupt();
					break;
				}
			}
			if (server.getState() == ServerConstants.SERVER_STATE_SHUTDOWN) {
				logger.info("HSQL Server Shutdown completed.");
			}
			else {
				logger.warn("HSQL Server Shutdown timed out or was interrupted. Server State: " + server.getState());
			}
			server = null;
		}
	}
On UNIX operating systems, return the number of open file descriptors. On non UNIX operating systems this returns
-1.

@return number of open file descriptors if this is executing on a UNIX operating system
spring-xd-batch/src/main/java/org/springframework/xd/batch/hsqldb/server/HSQLServerBean.java