package zero.downtime.soa.api;

import org.apache.camel.builder.RouteBuilder;
import org.eclipse.jetty.server.Server;

/**
 * @author magonzal
 * @version 1.0.0
 */
public class HelloServiceApi extends RouteBuilder {

	@Override
	public void configure() throws Exception {

		//@formatter:off
		restConfiguration().component("jetty")
			.host("localhost")
			.port(getRandomServerPort())
			.contextPath("hello-service-api/rest");

		rest("/{user}").description("Say hello to User")
			.get().route().to("direct-vm:hello");
		//@formatter:on
	}

	private int getRandomServerPort() throws Exception {
		Server server = new Server(0);
		server.start();
		int port = server.getConnectors()[0].getLocalPort();
		server.stop();
		return port;
	}
}


@@ -544,15 +544,240 @@
 %7D%0A%0A%09
-private
+/**%0A%09 * Looks up an available port number on the host%0A%09 * by creating a dummy Jetty Server.%0A%09 *%0A%09 * TODO: there's probably a better way to do this%0A%09 *%0A%09 * @return a port number available for use%0A%09 * @throws Exception%0A%09 */%0A%09protected
  int

Add javadoc to random port method