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

io.github.factoryfx.jetty.HandlerCollectionFactory Maven / Gradle / Ivy

The newest version!
package io.github.factoryfx.jetty;

import io.github.factoryfx.factory.FactoryBase;
import io.github.factoryfx.factory.SimpleFactoryBase;
import io.github.factoryfx.factory.attribute.dependency.FactoryPolymorphicListAttribute;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.handler.HandlerCollection;

public class HandlerCollectionFactory> extends SimpleFactoryBase {
    public final FactoryPolymorphicListAttribute handlers = new FactoryPolymorphicListAttribute().labelText("Handlers");

    @Override
    protected HandlerCollection createImpl() {
        return new HandlerCollection(true,handlers.instances().toArray(new Handler[0]));
    }

    public HandlerCollectionFactory(){
        this.configLifeCycle().setUpdater(handlerCollection -> handlerCollection.setHandlers(handlers.instances().toArray(new Handler[0])));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy