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

io.higgs.http.server.protocol.HttpDetectorFactory Maven / Gradle / Ivy

There is a newer version: 0.0.24
Show newest version
package io.higgs.http.server.protocol;

import io.higgs.core.ProtocolDetector;
import io.higgs.core.ProtocolDetectorFactory;

/**
 * @author Courtney Robinson 
 */
public class HttpDetectorFactory implements ProtocolDetectorFactory {
    private final HttpProtocolConfiguration config;
    protected int priority;

    public HttpDetectorFactory(HttpProtocolConfiguration config) {
        this.config = config;
    }

    @Override
    public ProtocolDetector newProtocolDetector() {
        return new HttpDetector(config);
    }

    @Override
    public int setPriority(int value) {
        int old = priority;
        priority = value;
        return old;
    }

    @Override
    public int priority() {
        return priority;
    }

    @Override
    public int compareTo(ProtocolDetectorFactory that) {
        return that.priority() - this.priority();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy