com.netflix.eureka2.server.service.AbstractChannel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eureka-server Show documentation
Show all versions of eureka-server Show documentation
eureka-server developed by Netflix
package com.netflix.eureka2.server.service;
import com.netflix.eureka2.interests.ChangeNotification;
import com.netflix.eureka2.registry.InstanceInfo;
import com.netflix.eureka2.server.registry.EurekaServerRegistry;
import com.netflix.eureka2.service.AbstractServiceChannel;
import com.netflix.eureka2.transport.MessageConnection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Observable;
import rx.Subscriber;
import rx.functions.Action1;
/**
* An abstract {@link com.netflix.eureka2.service.ServiceChannel} implementation for common methods.
*
* @author Nitesh Kant
*/
public abstract class AbstractChannel extends AbstractServiceChannel {
protected static final Logger logger = LoggerFactory.getLogger(AbstractChannel.class);
protected final MessageConnection transport;
protected final EurekaServerRegistry registry;
protected AbstractChannel(STATE initState, MessageConnection transport, final EurekaServerRegistry registry) {
super(initState);
this.transport = transport;
this.registry = registry;
}
@Override
protected void _close() {
transport.shutdown(); // Idempotent so we can call it even if it is already shutdown.
}
protected void subscribeToTransportInput(final Action1