*
* @param handler The handler for connections.
*/
void accept(final IncomingConnectionHandler handler) {
DefaultExecutorFactory executorFactory = new DefaultExecutorFactory();
TcpIncomingConnector incomingConnector = new TcpIncomingConnector(executorFactory, getClass().getClassLoader());
final CompletionHandler finished = new CompletionHandler();
LOGGER.lifecycle("Awaiting requests.");
URI uri = incomingConnector.accept(new Action<ConnectEvent<Connection<Object>>>() {
public void execute(ConnectEvent<Connection<Object>> connectionConnectEvent) {
try {
finished.onStartActivity();
handler.handle(connectionConnectEvent.getConnection(), finished);
} finally {