@Inject public DashboardServerSelfInfoResolver(final EurekaCommonConfig config, final WebSocketServer webSocketServer) { SelfInfoResolverChain resolverChain = new SelfInfoResolverChain( new ConfigSelfInfoResolver(config), // dashboard server specific resolver new ChainableSelfInfoResolver(Observable.just(new HashSet<ServicePort>()) .map(new Func1<HashSet<ServicePort>, Builder>() { @Override public InstanceInfo.Builder call(HashSet<ServicePort> ports) { ports.add(new ServicePort(WEB_SOCKET_SERVICE, webSocketServer.serverPort(), false)); return new InstanceInfo.Builder().withPorts(ports); } }) ), new PeriodicDataCenterInfoResolver(config), // TODO override with more meaningful health check new ChainableSelfInfoResolver(Observable.just(new InstanceInfo.Builder().withStatus(InstanceInfo.Status.UP))) ); this.delegate = new CachingSelfInfoResolver(resolverChain); }
@Inject public EurekaBridgeServerSelfInfoResolver( final EurekaServerConfig config, final TcpDiscoveryServer discoveryServer) { SelfInfoResolverChain resolverChain = new SelfInfoResolverChain( new ConfigSelfInfoResolver(config), // read server specific resolver new ChainableSelfInfoResolver(Observable.just(new HashSet<ServicePort>()) .map(new Func1<HashSet<ServicePort>, InstanceInfo.Builder>() { @Override public InstanceInfo.Builder call(HashSet<ServicePort> ports) { ports.add(new ServicePort(Names.DISCOVERY, discoveryServer.serverPort(), false)); return new InstanceInfo.Builder().withPorts(ports); } }) ), new PeriodicDataCenterInfoResolver(config), // TODO override with more meaningful health check new ChainableSelfInfoResolver(Observable.just(new InstanceInfo.Builder().withStatus(InstanceInfo.Status.UP))) ); delegate = new CachingSelfInfoResolver(resolverChain); }
@Inject public EurekaWriteServerSelfInfoResolver( final EurekaServerConfig config, final EurekaHttpServer httpServer, final TcpRegistrationServer registrationServer, final TcpReplicationServer replicationServer, final TcpDiscoveryServer discoveryServer) { SelfInfoResolverChain resolverChain = new SelfInfoResolverChain( new ConfigSelfInfoResolver(config), // write server specific resolver new ChainableSelfInfoResolver(Observable.just(new HashSet<ServicePort>()) .map(new Func1<HashSet<ServicePort>, InstanceInfo.Builder>() { @Override public InstanceInfo.Builder call(HashSet<ServicePort> ports) { ports.add(new ServicePort(Names.EUREKA_HTTP, httpServer.serverPort(), false)); ports.add(new ServicePort(Names.REGISTRATION, registrationServer.serverPort(), false)); ports.add(new ServicePort(Names.REPLICATION, replicationServer.serverPort(), false)); ports.add(new ServicePort(Names.DISCOVERY, discoveryServer.serverPort(), false)); return new InstanceInfo.Builder().withPorts(ports); } }) ), new PeriodicDataCenterInfoResolver(config), // TODO override with more meaningful health check new ChainableSelfInfoResolver(Observable.just(new InstanceInfo.Builder().withStatus(InstanceInfo.Status.UP))) ); delegate = new CachingSelfInfoResolver(resolverChain); }