net.dongliu.prettypb.rpc.config.ServerProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of prettypb-rpc Show documentation
Show all versions of prettypb-rpc Show documentation
proto rpc libs, compatible with proto-rpc-pro
package net.dongliu.prettypb.rpc.config;
import net.dongliu.prettypb.rpc.protocol.ServerInfo;
import java.util.Collection;
/**
* rpc server provider interface
*
* @author dongliu
*/
public abstract class ServerProvider implements AutoCloseable {
protected ServerChangedNotifier serverChangedNotifier;
/**
* get available servers.
*
* @return the server address collection. empty if not exist, should not be null
*/
public abstract Collection availableServers();
public void setServerChangedNotifier(ServerChangedNotifier serverChangedNotifier) {
this.serverChangedNotifier = serverChangedNotifier;
}
public ServerChangedNotifier getServerChangedNotifier() {
return serverChangedNotifier;
}
}