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

restx.security.DefinitionFactoryMachine Maven / Gradle / Ivy

There is a newer version: 1.2.0-rc2
Show newest version
package restx.security;

import com.google.common.collect.ImmutableSet;
import restx.factory.*;
import restx.security.RestxSession.Definition;

@Machine
public class DefinitionFactoryMachine extends SingleNameFactoryMachine {
    public static final Name NAME = Name.of(restx.security.RestxSession.Definition.class, "Definition");

    public DefinitionFactoryMachine() {
        super(0, new StdMachineEngine(NAME, 0, BoundlessComponentBox.FACTORY) {
private final Factory.Query cacheManager = Factory.Query.byClass(restx.security.RestxSession.Definition.EntryCacheManager.class).mandatory();
private final Factory.Query entries = Factory.Query.byClass(restx.security.RestxSession.Definition.Entry.class).optional();

            @Override
            public BillOfMaterials getBillOfMaterial() {
                return new BillOfMaterials(ImmutableSet.>of(
cacheManager,
entries
                ));
            }

            @Override
            protected restx.security.RestxSession.Definition doNewComponent(SatisfiedBOM satisfiedBOM) {
                return new Definition(
satisfiedBOM.getOne(cacheManager).get().getComponent(),
satisfiedBOM.getAsComponents(entries)
                );
            }
        });
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy