public ChainedComponentModel build() { return new ChainedComponentModel(bundleInstantiationSpec, dependencies); }
private static boolean allAdded(Collection<ChainedComponentModel> searcherModels, Set<ComponentId> componentIds) { for (ChainedComponentModel model : searcherModels) { if (!componentIds.add(model.getComponentId())) return false; } return true; }
@Override public void getConfig(HttpFilterConfig.Builder builder) { builder.filterName(filterModel.getComponentId().stringValue()) .filterClass(filterModel.getClassId().stringValue()); for (Map.Entry<String, String> param : configMap.entrySet()) { builder.param( new Param.Builder() .name(param.getKey()) .value(param.getValue())); } }
@Override public ComponentId getGlobalComponentId() { return model.getComponentId().nestInNamespace(namespace()); }
@SafeVarargs private static final Collection<ChainedComponentModel> toSearcherModels(Class<? extends Searcher>... searchers) { List<ChainedComponentModel> searcherModels = new ArrayList<>(); for (Class<? extends Searcher> c : searchers) { searcherModels.add( new ChainedComponentModel( BundleInstantiationSpecification.getInternalSearcherSpecificationFromStrings( c.getName(), null), Dependencies.emptyDependencies())); } return ImmutableList.copyOf(searcherModels); } }
private static <COMPONENT extends ChainedComponent> void initDependencies( ChainsModel model, ComponentRegistry<COMPONENT> allComponents) { for (ChainedComponentModel componentModel : model.allComponents()) { COMPONENT component = getComponentOrThrow(allComponents, componentModel.getComponentId().toSpecification()); component.initDependencies(componentModel.dependencies); } }
private static Collection<ChainedComponentModel> toSearcherModels(Class<? extends Searcher>... searchers) { List<ChainedComponentModel> searcherModels = new ArrayList<>(); for (Class c : searchers) { searcherModels.add( new ChainedComponentModel( BundleInstantiationSpecification.getInternalSearcherSpecificationFromStrings(c.getName(), null), Dependencies.emptyDependencies())); } return searcherModels; } }
public static ChainsModel buildFromConfig(ChainsConfig chainsConfig) { ChainsModel model = createChainsModel(chainsConfig); for (ChainsConfig.Components component : chainsConfig.components()) { ChainedComponentModel componentModel = createChainedComponentModel(component); model.register(componentModel.getComponentId(), componentModel); } return model; }
private static ChainedComponentModel createChainedComponentModel(ChainsConfig.Components component) { return new ChainedComponentModel( new BundleInstantiationSpecification(new ComponentSpecification(component.id()), null, null), createDependencies( component.dependencies().provides(), component.dependencies().before(), component.dependencies().after()), null); }
public FilterConfigProvider(ChainedComponentModel filterModel) { super(new ComponentModel( new BundleInstantiationSpecification( configProviderId(filterModel.getComponentId()), filterConfigProviderClass, null))); this.filterModel = filterModel; }
public void register(ComponentId globalComponentId, ChainedComponentModel componentModel) { assert (componentModel.getComponentId().withoutNamespace().equals( globalComponentId.withoutNamespace())); componentModels.register(globalComponentId, ComponentAdaptor.create(globalComponentId, componentModel)); }