io.github.factoryfx.jetty.HandlerCollectionFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jettyFactory Show documentation
Show all versions of jettyFactory Show documentation
factoryfx dependency injection framework
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])));
}
}