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

org.caiguoqing.uyuni.rpc.server.ServerFactory Maven / Gradle / Ivy

The newest version!
/**
 * 
 */
package org.caiguoqing.uyuni.rpc.server;

import java.util.ArrayList;
import java.util.List;

import org.caiguoqing.uyuni.rpc.server.socketserver.SocketServer;

/**
 * @author org.caiguoqing
 * 
 */
public class ServerFactory {
	public static List createServer(List configs){
		List servers = new ArrayList();
		for(ServerConfig config : configs){
			Server server = ServerFactory.getServer(config);
			if(server != null){
				servers.add(server);
				server.run();
			}
		}
		return servers;
	}
	
	public static Server getServer(ServerConfig config){
		String type = config.getType();
		if(type.equals("socket")){
			return new SocketServer(config);
		}else{
			return null;
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy