restx.security.EmptySessionProviderFactoryMachine Maven / Gradle / Ivy
package restx.security;
import com.google.common.collect.ImmutableSet;
import restx.factory.*;
import restx.security.EmptySessionProvider;
@Machine
public class EmptySessionProviderFactoryMachine extends SingleNameFactoryMachine {
public static final Name NAME = Name.of(restx.security.EmptySessionProvider.class, "EmptySessionProvider");
public EmptySessionProviderFactoryMachine() {
super(0, new StdMachineEngine(NAME, 0, BoundlessComponentBox.FACTORY) {
private final Factory.Query definition = Factory.Query.byClass(restx.security.RestxSession.Definition.class).mandatory();
@Override
public BillOfMaterials getBillOfMaterial() {
return new BillOfMaterials(ImmutableSet.>of(
definition
));
}
@Override
protected restx.security.EmptySessionProvider doNewComponent(SatisfiedBOM satisfiedBOM) {
return new EmptySessionProvider(
satisfiedBOM.getOne(definition).get().getComponent()
);
}
});
}
}