@Override protected void onInitMilestoneAttained(InitMilestone milestone) { initLevel = milestone; if (milestone==PLUGINS_PREPARED) { // set up Guice to enable injection as early as possible // before this milestone, ExtensionList.ensureLoaded() won't actually try to locate instances ExtensionList.lookup(ExtensionFinder.class).getComponents(); } } }.run(reactor);
/** * Loading the descriptors in this case means filtering the descriptor from the master {@link ExtensionList}. */ @Override protected List<ExtensionComponent<D>> load() { if (jenkins == null) { // Should never happen on the real instance LOGGER.log(Level.WARNING, "Cannot load extension components, because Jenkins instance has not been assigned yet"); return Collections.emptyList(); } return _load(getDescriptorExtensionList().getComponents()); }
List<Tag> r = new ArrayList<Tag>(exts.size()); for (ExtensionComponent<Descriptor> c : exts.getComponents()) { Descriptor d = c.getInstance(); if (d.getGlobalConfigPage()==null) continue;
@Override protected void onInitMilestoneAttained(InitMilestone milestone) { initLevel = milestone; if (milestone==PLUGINS_PREPARED) { // set up Guice to enable injection as early as possible // before this milestone, ExtensionList.ensureLoaded() won't actually try to locate instances ExtensionList.lookup(ExtensionFinder.class).getComponents(); } } }.run(reactor);
/** * Loading the descriptors in this case means filtering the descriptor from the master {@link ExtensionList}. */ @Override protected List<ExtensionComponent<D>> load() { if (jenkins == null) { // Should never happen on the real instance LOGGER.log(Level.WARNING, "Cannot load extension components, because Jenkins instance has not been assigned yet"); return Collections.emptyList(); } return _load(jenkins.getExtensionList(Descriptor.class).getComponents()); }
public static List<String> getOrderedConditionNames() { List<String> orderedConditions = new ArrayList<>(); List<ExtensionComponent<BuildCondition>> extensionComponents = new ArrayList<>(all().getComponents()); Collections.sort(extensionComponents); for (ExtensionComponent<BuildCondition> extensionComponent: extensionComponents) { BuildCondition b = extensionComponent.getInstance(); Set<String> symbolValues = SymbolLookup.getSymbolValue(b); if (!symbolValues.isEmpty()) { orderedConditions.add(symbolValues.iterator().next()); } } return orderedConditions; }
/** * Loading the descriptors in this case means filtering the descriptor from the master {@link ExtensionList}. */ @Override protected List<ExtensionComponent<D>> load() { List<ExtensionComponent<D>> r = new ArrayList<ExtensionComponent<D>>(); for( ExtensionComponent<Descriptor> c : hudson.getExtensionList(Descriptor.class).getComponents() ) { Descriptor d = c.getInstance(); Type subTyping = Types.getBaseClass(d.getClass(), Descriptor.class); if (!(subTyping instanceof ParameterizedType)) { LOGGER.severe(d.getClass()+" doesn't extend Descriptor with a type parameter"); continue; // skip this one } if(Types.erasure(Types.getTypeArgument(subTyping,0))==(Class)describableType) r.add((ExtensionComponent)c); } return r; }
/** * Loading the descriptors in this case means filtering the descriptor from the master {@link ExtensionList}. */ @Override protected List<ExtensionComponent<D>> load() { List<ExtensionComponent<D>> r = new ArrayList<ExtensionComponent<D>>(); for( ExtensionComponent<Descriptor> c : hudson.getExtensionList(Descriptor.class).getComponents() ) { Descriptor d = c.getInstance(); Type subTyping = Types.getBaseClass(d.getClass(), Descriptor.class); if (!(subTyping instanceof ParameterizedType)) { LOGGER.severe(d.getClass()+" doesn't extend Descriptor with a type parameter"); continue; // skip this one } if(Types.erasure(Types.getTypeArgument(subTyping,0))==(Class)describableType) r.add((ExtensionComponent)c); } return r; }
/** * Loading the descriptors in this case means filtering the descriptor from the master {@link ExtensionList}. */ @Override protected List<ExtensionComponent<D>> load() { List<ExtensionComponent<D>> r = new ArrayList<ExtensionComponent<D>>(); for( ExtensionComponent<Descriptor> c : hudson.getExtensionList(Descriptor.class).getComponents() ) { Descriptor d = c.getInstance(); Type subTyping = Types.getBaseClass(d.getClass(), Descriptor.class); if (!(subTyping instanceof ParameterizedType)) { LOGGER.severe(d.getClass()+" doesn't extend Descriptor with a type parameter"); continue; // skip this one } if(Types.erasure(Types.getTypeArgument(subTyping,0))==(Class)describableType) r.add((ExtensionComponent)c); } return r; }
/** * Loading the descriptors in this case means filtering the descriptor from * the master {@link ExtensionList}. */ @Override protected List<ExtensionComponent<D>> load() { List<ExtensionComponent<D>> r = new ArrayList<ExtensionComponent<D>>(); for (ExtensionComponent<Descriptor> c : hudson.getExtensionList(Descriptor.class).getComponents()) { Descriptor d = c.getInstance(); Type subTyping = Types.getBaseClass(d.getClass(), Descriptor.class); if (!(subTyping instanceof ParameterizedType)) { LOGGER.severe(d.getClass() + " doesn't extend Descriptor with a type parameter"); continue; // skip this one } if (Types.erasure(Types.getTypeArgument(subTyping, 0)) == (Class) describableType) { r.add((ExtensionComponent) c); } } return r; } /**
List<Tag> r = new ArrayList<Tag>(exts.size()); for (ExtensionComponent<Descriptor> c : exts.getComponents()) { Descriptor d = c.getInstance(); if (d.getGlobalConfigPage()==null) continue;