@Override public void registerSession(String session) { register.registerName(identity.getServicePrefix() + "/" + session); }
/** * The container has no rpc methods, but we still need an RPC sever * to register in Slobrok to enable orchestration */ private Register registerInSlobrok(SlobroksConfig slobrokConfig, QrConfig qrConfig) { if ( ! qrConfig.rpc().enabled()) return null; // 1. Set up RPC server supervisor = new Supervisor(new Transport()); Spec listenSpec = new Spec(qrConfig.rpc().port()); try { acceptor = supervisor.listen(listenSpec); } catch (ListenFailedException e) { throw new RuntimeException("Could not create rpc server listening on " + listenSpec, e); } // 2. Register it in slobrok SlobrokList slobrokList = new SlobrokList(); slobrokList.setup(slobrokConfig.slobrok().stream().map(SlobroksConfig.Slobrok::connectionspec).toArray(String[]::new)); Spec mySpec = new Spec(HostName.getLocalhost(), acceptor.port()); slobrokRegistrator = new Register(supervisor, slobrokList, mySpec); slobrokRegistrator.registerName(qrConfig.rpc().slobrokId()); log.log(LogLevel.INFO, "Registered name '" + qrConfig.rpc().slobrokId() + "' at " + mySpec + " with: " + slobrokList); return slobrokRegistrator; }