All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.eureka2.server.service.EurekaServiceImpl Maven / Gradle / Ivy

There is a newer version: 2.0.0-DP4
Show newest version
package com.netflix.eureka2.server.service;

import com.netflix.eureka2.registry.InstanceInfo;
import com.netflix.eureka2.server.metric.EurekaServerMetricFactory;
import com.netflix.eureka2.server.registry.EurekaServerRegistry;
import com.netflix.eureka2.server.registry.EvictionQueue;
import com.netflix.eureka2.service.InterestChannel;
import com.netflix.eureka2.service.RegistrationChannel;
import com.netflix.eureka2.transport.MessageConnection;

/**
 * An implementation of {@link EurekaServerService} associated with strictly one {@link MessageConnection}
 *
 * 

Thread safety

* * See {@link EurekaServerService} for details. This service assumes sequential (single threaded) invocations. * * @author Nitesh Kant */ public class EurekaServiceImpl implements EurekaServerService { private final EurekaServerRegistry registry; private final EvictionQueue evictionQueue; private final MessageConnection connection; private final EurekaServerMetricFactory metricFactory; public EurekaServiceImpl(EurekaServerRegistry registry, EvictionQueue evictionQueue, MessageConnection connection, EurekaServerMetricFactory metricFactory) { this.registry = registry; this.evictionQueue = evictionQueue; this.connection = connection; this.metricFactory = metricFactory; } @Override public InterestChannel newInterestChannel() { return new InterestChannelImpl(registry, connection, metricFactory.getInterestChannelMetrics()); } @Override public RegistrationChannel newRegistrationChannel() { return new RegistrationChannelImpl(registry, evictionQueue, connection, metricFactory.getRegistrationChannelMetrics()); } @Override public ReplicationChannel newReplicationChannel() { return new ReplicationChannelImpl(connection, registry, evictionQueue, metricFactory.getReplicationChannelMetrics()); } @Override public void shutdown() { connection.shutdown(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy