package org.kne.cloud.network.klalb;

import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;

import javax.net.ServerSocketFactory;

public class KLALBVirtualServerSocketFactory extends ServerSocketFactory {

	private KLALBController controller;
	
	public KLALBVirtualServerSocketFactory(KLALBController controller) {
		super();
		this.controller = controller;
	}

	public KLALBController getController() {
		return controller;
	}
	@Override
	public ServerSocket createServerSocket() throws IOException {
		return new KLALBVirtualServerSocket(controller);
	}

	@Override
	public ServerSocket createServerSocket(int port) throws IOException {
		return new KLALBVirtualServerSocket(controller,port);
	}

	@Override
	public ServerSocket createServerSocket(int port, int backlog) throws IOException {
		return new KLALBVirtualServerSocket(controller, port,backlog);
	}

	@Override
	public ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress) throws IOException {
		return new KLALBVirtualServerSocket(controller, port, backlog, ifAddress);
	}

}
