@Override public void start(ServerListener listener) throws IOException { try { armeriaServer.start().get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } scheduler = Executors.newSingleThreadScheduledExecutor(); listener.transportCreated(new ServerTransport() { @Override public void shutdown() { armeriaServer.stop(); } @Override public void shutdownNow(Status reason) { armeriaServer.stop(); } @Override public ScheduledExecutorService getScheduledExecutorService() { return scheduler; } @Override public Future<Stats> getTransportStats() { return Futures.immediateFuture(null); } @Override public LogId getLogId() { return null; } }); }
GrpclbState( Helper helper, TimeProvider time, ScheduledExecutorService timerService, LogId logId) { this.helper = checkNotNull(helper, "helper"); this.time = checkNotNull(time, "time provider"); this.timerService = checkNotNull(timerService, "timerService"); this.serviceName = checkNotNull(helper.getAuthority(), "helper returns null authority"); this.logId = checkNotNull(logId, "logId"); }
@Override public LogId getLogId() { return logId; }