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

org.webpieces.webserver.test.MockServerChannel Maven / Gradle / Ivy

There is a newer version: 2.1.1
Show newest version
package org.webpieces.webserver.test;

import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.channels.ServerSocketChannel;
import java.util.concurrent.CompletableFuture;

import org.webpieces.nio.api.channels.TCPServerChannel;
import org.webpieces.nio.api.handlers.ConsumerFunc;

public class MockServerChannel implements TCPServerChannel {

	private InetSocketAddress addr;

	@Override
	public void setReuseAddress(boolean b) {
		
	}

	@Override
	public void setName(String string) {
		
	}

	@Override
	public String getChannelId() {
		return null;
	}

	@Override
	public String getName() {
		return null;
	}

	@Override
	public CompletableFuture bind(SocketAddress addr) {
		this.addr = (InetSocketAddress) addr;
		return CompletableFuture.completedFuture(null);
	}

	@Override
	public boolean isBlocking() {
		return false;
	}

	@Override
	public boolean isClosed() {
		return false;
	}

	@Override
	public boolean isBound() {
		return false;
	}

	@Override
	public InetSocketAddress getLocalAddress() {
		return addr;
	}

	@Override
	public void closeServerChannel() {
		
	}

	@Override
	public void configure(ConsumerFunc methodToConfigure) {
		
	}

	@Override
	public ServerSocketChannel getUnderlyingChannel() {
		return null;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy