Acceptor(TerminateSignaller terminateSignaller, ServerSocket serverSocket, ThreadModelType threadModelType,
             ExecutorService executorService, Serializer serializer, Class<T> serviceInterface,
             Class<V> serviceObjectClass, ThreadPoolOverflowPolicy threadPoolOverflowPolicy)
            throws ServerStartupException {

        this.terminateSignaller = terminateSignaller;
        this.serverSocket = serverSocket;
        this.executorService = executorService;
        this.serializer = serializer;
        this.serviceObjectClass = serviceObjectClass;
        this.reflectionCache = new ReflectionCache(serviceInterface);
        this.serviceObjectSingleton = null;
        this.threadModelType = threadModelType;
        this.threadPoolOverflowPolicy = threadPoolOverflowPolicy;

        switch (this.threadModelType) {
            case Singleton:
                try {
                    serviceObjectSingleton = serviceObjectClass.newInstance();
                } catch (InstantiationException e) {
                    throw new ServerStartupException("Cannot create service object singleton instance!", e);
                } catch (IllegalAccessException e) {
                    throw new ServerStartupException("Cannot create service object singleton instance!", e);
                }
                break;
            case InstancePerThread:
                serviceObjectSingleton = null;
                break;
            default:
                throw new ServerStartupException("Unknown threading model!");
        }
    }