public static CompositeIndex createMerged(final CompositeIndex... indexes) { ArrayList<IndexView> list = new ArrayList<IndexView>(); for (CompositeIndex index : indexes) { list.addAll(index.indexes); } return create(list); }
IndexView createDeploymentIndex(Archive<?> deployment) { List<IndexView> indexes = new ArrayList<IndexView>(); try { index(deployment, indexes); } catch (IOException e) { throw new RuntimeException(e); } return CompositeIndex.create(indexes); }
IndexView createDeploymentIndex(Archive<?> deployment) { List<IndexView> indexes = new ArrayList<IndexView>(); try { index(deployment, indexes); } catch (IOException e) { throw new RuntimeException(e); } return CompositeIndex.create(indexes); }
IndexView createDeploymentIndex(Archive<?> deployment) { List<IndexView> indexes = new ArrayList<IndexView>(); try { index(deployment, indexes); } catch (IOException e) { throw new RuntimeException(e); } return CompositeIndex.create(indexes); }
@Override protected void beforeDiscovery(Collection<BeanArchiveBuilder> builders) { List<IndexView> indexes = new ArrayList<IndexView>(); for (BeanArchiveBuilder builder : builders) { IndexView index = (IndexView) builder.getAttribute(Jandex.INDEX_ATTRIBUTE_NAME); if (index != null) { indexes.add(index); } } cindex = CompositeIndex.create(indexes); beanDefiningAnnotations = buildBeanDefiningAnnotationSet(initialBeanDefiningAnnotations, cindex); classFileServices = new JandexClassFileServices(this); }
@Override protected void beforeDiscovery(Collection<BeanArchiveBuilder> builders) { List<IndexView> indexes = new ArrayList<IndexView>(); for (BeanArchiveBuilder builder : builders) { IndexView index = (IndexView) builder.getAttribute(Jandex.INDEX_ATTRIBUTE_NAME); if (index != null) { indexes.add(index); } } cindex = CompositeIndex.create(indexes); beanDefiningAnnotations = buildBeanDefiningAnnotationSet(initialBeanDefiningAnnotations, cindex); classFileServices = new JandexClassFileServices(this); }
@Override protected void beforeDiscovery(Collection<BeanArchiveBuilder> builders) { List<IndexView> indexes = new ArrayList<IndexView>(); for (BeanArchiveBuilder builder : builders) { IndexView index = (IndexView) builder.getAttribute(Jandex.INDEX_ATTRIBUTE_NAME); if (index != null) { indexes.add(index); } } cindex = CompositeIndex.create(indexes); beanDefiningAnnotations = buildBeanDefiningAnnotationSet(initialBeanDefiningAnnotations, cindex); classFileServices = new JandexClassFileServices(this); }
@Override protected void beforeDiscovery(Collection<BeanArchiveBuilder> builders) { List<IndexView> indexes = new ArrayList<IndexView>(); for (BeanArchiveBuilder builder : builders) { IndexView index = (IndexView) builder.getAttribute(Jandex.INDEX_ATTRIBUTE_NAME); if (index != null) { indexes.add(index); } } cindex = CompositeIndex.create(indexes); beanDefiningAnnotations = buildBeanDefiningAnnotationSet(initialBeanDefiningAnnotations, cindex); classFileServices = new JandexClassFileServices(this); }
@Override protected void beforeDiscovery(Collection<BeanArchiveBuilder> builders) { List<IndexView> indexes = new ArrayList<IndexView>(); for (BeanArchiveBuilder builder : builders) { IndexView index = (IndexView) builder.getAttribute(Jandex.INDEX_ATTRIBUTE_NAME); if (index != null) { indexes.add(index); } } cindex = CompositeIndex.create(indexes); beanDefiningAnnotations = buildBeanDefiningAnnotationSet(initialBeanDefiningAnnotations, cindex); classFileServices = new JandexClassFileServices(this); }
@Override protected void beforeDiscovery(Collection<BeanArchiveBuilder> builders) { List<IndexView> indexes = new ArrayList<IndexView>(); for (BeanArchiveBuilder builder : builders) { IndexView index = (IndexView) builder.getAttribute(Jandex.INDEX_ATTRIBUTE_NAME); if (index != null) { indexes.add(index); } } cindex = CompositeIndex.create(indexes); beanDefiningAnnotations = buildBeanDefiningAnnotationSet(initialBeanDefiningAnnotations, cindex); classFileServices = new JandexClassFileServices(this); }
@Override protected void beforeDiscovery(Collection<BeanArchiveBuilder> builders) { List<IndexView> indexes = new ArrayList<IndexView>(); for (BeanArchiveBuilder builder : builders) { IndexView index = (IndexView) builder.getAttribute(Jandex.INDEX_ATTRIBUTE_NAME); if (index != null) { indexes.add(index); } } cindex = CompositeIndex.create(indexes); beanDefiningAnnotations = buildBeanDefiningAnnotationSet(initialBeanDefiningAnnotations, cindex); classFileServices = new JandexClassFileServices(this); }
protected List<Class<? extends ServerConfiguration>> findServerConfigurationImpls(Module module, List<Index> parentIndexes) throws ModuleLoadException, IOException, NoSuchFieldException, IllegalAccessException { List<Index> indexes = new ArrayList<>(); resolveBuildTimeIndex(module, indexes); //resolveRuntimeIndex(module, indexes); indexes.addAll(parentIndexes); CompositeIndex compositeIndex = CompositeIndex.create(indexes.toArray(new Index[indexes.size()])); List<Class<? extends ServerConfiguration>> impls = new ArrayList<>(); Set<ClassInfo> infos = compositeIndex.getAllKnownImplementors(DotName.createSimple(ServerConfiguration.class.getName())); for (ClassInfo info : infos) { if (info.name().toString().equals(AnnotationBasedServerConfiguration.class.getName())) { continue; } try { Class<? extends ServerConfiguration> cls = (Class<? extends ServerConfiguration>) module.getClassLoader().loadClass(info.name().toString()); if (!Modifier.isAbstract(cls.getModifiers())) { impls.add(cls); } } catch (ClassNotFoundException e) { e.printStackTrace(); } } return impls; }
protected List<ServerConfiguration> findAnnotationServerConfigurations(Module apiModule, List<Index> parentIndexes) throws ModuleLoadException, IOException, NoSuchFieldException, IllegalAccessException { List<Index> indexes = new ArrayList<>(); resolveBuildTimeIndex(apiModule, indexes); //resolveRuntimeIndex(module, indexes); indexes.addAll(parentIndexes); CompositeIndex compositeIndex = CompositeIndex.create(indexes.toArray(new Index[indexes.size()])); List<ServerConfiguration> impls = new ArrayList<>(); DotName configAnno = DotName.createSimple(Configuration.class.getName()); Set<ClassInfo> infos = compositeIndex.getAllKnownImplementors(DotName.createSimple(Fraction.class.getName())); for (ClassInfo info : infos) { for (AnnotationInstance anno : info.classAnnotations()) { if (anno.name().equals(configAnno)) { try { ServerConfiguration config = fromAnnotation(apiModule, anno); impls.add(config); } catch (ClassNotFoundException e) { e.printStackTrace(); } } } } return impls; }