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

net.dongliu.prettypb.rpc.config.ServerProvider Maven / Gradle / Ivy

There is a newer version: 0.3.5
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy