@Inject public EurekaWriteServerSelfRegistrationService(SelfInfoResolver resolver, SourcedEurekaRegistry registry) { super(resolver); this.registry = registry; this.selfSource = new Source(Source.Origin.LOCAL); }
public InterestChannelImpl(final SourcedEurekaRegistry<InstanceInfo> registry, BatchingRegistry<InstanceInfo> remoteBatchingRegistry, TransportClient client, InterestChannelMetrics metrics) { super(STATE.Idle, client, metrics); this.remoteBatchingRegistry = remoteBatchingRegistry; this.selfSource = new Source(Source.Origin.INTERESTED); this.registry = registry; channelInterestSubscriber = new ChannelInterestSubscriber(registry); channelInterestStream = createInterestStream(); }
@Override public Observable<ReplicationHelloReply> hello(final ReplicationHello hello) { logger.debug("Replication hello message: {}", hello); if(!moveToState(STATE.Idle, STATE.Handshake)) { return Observable.error(state.get() == STATE.Closed ? CHANNEL_CLOSED_EXCEPTION : HANDSHAKE_FINISHED_EXCEPTION); } replicationSource = new Source(Source.Origin.REPLICATED, hello.getSourceId()); return selfIdentityService.resolve().take(1).flatMap(new Func1<InstanceInfo, Observable<ReplicationHelloReply>>() { @Override public Observable<ReplicationHelloReply> call(InstanceInfo instanceInfo) { replicationLoop = instanceInfo.getId().equals(hello.getSourceId()); ReplicationHelloReply reply = new ReplicationHelloReply(instanceInfo.getId(), false); sendOnTransport(reply); moveToState(STATE.Handshake, STATE.Connected); return Observable.just(reply); } }); }
public BridgeChannelImpl(SourcedEurekaRegistry<InstanceInfo> registry, DiscoveryClient discoveryClient, int refreshRateSec, InstanceInfo self, BridgeChannelMetrics metrics, Scheduler scheduler) { super(STATE.Idle, null, registry, metrics); this.registry = registry; this.discoveryClient = discoveryClient; this.refreshRateSec = refreshRateSec; this.self = self; this.selfSource = new Source(Source.Origin.LOCAL); this.metrics = metrics; converter = new InstanceInfoConverterImpl(); worker = scheduler.createWorker(); lifecycle = ReplaySubject.create(); }
final Source source = new Source(Origin.BOOTSTRAP, "loaded@" + System.currentTimeMillis());
super(STATE.Idle, transport, registry, metrics); selfSource = new Source(Source.Origin.LOCAL); instanceInfoRef = new AtomicReference<>();