public static boolean portAvailable(int port) {
		InetSocketAddress addr = new InetSocketAddress(port);
		try {
			ServerSocket socket = new ServerSocket();
			socket.bind(addr);
			socket.close();
		}
		catch (IOException e) {
			return false;
		}
		return true;

	}
A simple driver class to run a Gemfire cache server.

@author David Turanski
spring-xd-gemfire-server/src/main/java/org/springframework/xd/gemfire/server/CacheServer.java