@Override
	public void run() {
		if (executorService == null)
			executorService = Executors.newSingleThreadExecutor();
		if (!isServing()) {
			beforeStart(getServerConfiguration().getServerAspect());
			executorService.execute(() -> {
				try {
					start();
				} catch (IkasoaException e) {
					throw new RuntimeException(e);
				}
			});
			Runtime.getRuntime().addShutdownHook(new Thread(() -> stop()));
			afterStart(getServerConfiguration().getServerAspect());
		}
	}
@ Override public void run ( ) { if ( executorService == null ) executorService = Executors . newSingleThreadExecutor ( ) ; if ( ! isServing ( ) ) { beforeStart ( getServerConfiguration ( ) . getServerAspect ( ) ) ; executorService . execute ( ( ) -> { try { start ( ) ; } catch ( IkasoaException e ) { throw new RuntimeException ( e ) ; } } ) ; Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( ( ) -> stop ( ) ) ) ; afterStart ( getServerConfiguration ( ) . getServerAspect ( ) ) ; } }
运行一个Thrift服务线程