@Provides private PluginManager getPluginManager() { PluginManager target = plugins != null ? plugins : getHudson().getPluginManager(); checkState(target !=null); return target; }
public PluginRestoreJob(UpdateSite site, Authentication auth, Plugin plugin, String version) { super(site, auth); this.plugin = plugin; this.version = version; this.pm = Hudson.getInstance().getPluginManager(); }
/** * Checks if Jenkins is run from inside a HudsonTestCase. For some reason the buildQueue fails to render when run * under test but works fine when run with hpi:run. So the jelly file skips the inclusion of the sidepanel if we are * running under test to work around this problem. The check is done via looking at the class name of {@link * hudson.model.Hudson#getPluginManager()}. * * @return true if we are running under test. */ public boolean isUnderTest() { return "org.jvnet.hudson.test.TestPluginManager". equals(Hudson.getInstance().getPluginManager().getClass().getName()); }
@Provides private PluginManager getPluginManager() { PluginManager target = plugins != null ? plugins : getHudson().getPluginManager(); checkState(target !=null); return target; }
/** * Loads all the extensions. */ protected List<ExtensionComponent<T>> load() { if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE,"Loading ExtensionList: "+extensionType); return hudson.getPluginManager().getPluginStrategy().findComponents(extensionType, hudson); }
/** * Loads all the extensions. */ protected List<ExtensionComponent<T>> load() { if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE,"Loading ExtensionList: "+extensionType); return hudson.getPluginManager().getPluginStrategy().findComponents(extensionType, hudson); }
/** * Loads all the extensions. */ protected List<ExtensionComponent<T>> load() { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Loading ExtensionList: " + extensionType); } return hudson.getPluginManager().getPluginStrategy().findComponents(extensionType, hudson); }
private FilePath getTargetFile() { return new FilePath(new File(Hudson.getInstance().getPluginManager().rootDir, name + ".hpi")); } }
private FilePath getTargetFile() { return new FilePath(new File(Hudson.getInstance().getPluginManager().rootDir,name+".hpi")); } }
public static String getIconPath(String icon) { if(icon == null) return null; if(icon.startsWith("/")) return icon; // Try plugin images dir, fallback to Hudson images dir PluginWrapper wrapper = Hudson.getInstance().getPluginManager().getPlugin(GroovyPostbuildPlugin.class); boolean pluginIconExists = (wrapper != null) && new File(wrapper.baseResourceURL.getPath() + "/images/" + icon).exists(); return pluginIconExists ? "/plugin/" + wrapper.getShortName() + "/images/" + icon : Hudson.RESOURCE_PATH + "/images/16x16/" + icon; } }
/** * Loads all the extensions. */ protected List<ExtensionComponent<T>> load() { if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE,"Loading ExtensionList: "+extensionType); return hudson.getPluginManager().getPluginStrategy().findComponents(extensionType, hudson); }
public boolean isFailedToLoad() { for (FailedPlugin p : Hudson.getInstance().getPluginManager().getFailedPlugins()) { if (p.name.equals(shortName)) { return true; } } return false; }
/** * If some version of this plugin is currently installed, return * {@link PluginWrapper}. Otherwise null. */ public PluginWrapper getInstalled() { PluginManager pm = Hudson.getInstance().getPluginManager(); return pm.getPlugin(name); }
/** * If some version of this plugin is currently installed, return {@link PluginWrapper}. * Otherwise null. */ public PluginWrapper getInstalled() { PluginManager pm = Hudson.getInstance().getPluginManager(); return pm.getPlugin(name); }
/** * Finds a resolved method annotated with {@link CLIResolver}. */ private Method findResolver(Class type) throws IOException { List<Method> resolvers = Util.filter(Index.list(CLIResolver.class, Hudson.getInstance().getPluginManager().uberClassLoader), Method.class); for ( ; type!=null; type=type.getSuperclass()) for (Method m : resolvers) if (m.getReturnType()==type) return m; return null; }
/** * If some version of this plugin is currently installed, return {@link PluginWrapper}. * Otherwise null. */ public PluginWrapper getInstalled() { PluginManager pm = Hudson.getInstance().getPluginManager(); return pm.getPlugin(name); }
/** * Finds a resolved method annotated with {@link CLIResolver}. */ private Method findResolver(Class type) throws IOException { List<Method> resolvers = Util.filter(Index.list(CLIResolver.class, Hudson.getInstance().getPluginManager().uberClassLoader), Method.class); for ( ; type!=null; type=type.getSuperclass()) for (Method m : resolvers) if (m.getReturnType()==type) return m; return null; }
/** * Finds a resolved method annotated with {@link CLIResolver}. */ private Method findResolver(Class type) throws IOException { List<Method> resolvers = Util.filter(Index.list(CLIResolver.class, Hudson.getInstance().getPluginManager().uberClassLoader), Method.class); for ( ; type!=null; type=type.getSuperclass()) for (Method m : resolvers) if (m.getReturnType()==type) return m; return null; }
/** * Returns true if it is possible to add parameters to the trigger. This is the case when the * parameterized-trigger plugin is both installed and active. * * @return true if it is possible to add parameters to the trigger */ public boolean canAddParameters() { final PluginWrapper plugin = Hudson.getInstance().getPluginManager().getPlugin("parameterized-trigger"); //$NON-NLS-1$ return plugin != null && plugin.isActive(); }
public String getPluginResourcePath() { PluginWrapper wrapper = Hudson.getInstance().getPluginManager().getPlugin(ScriptlerPluginImpl.class); return Hudson.getInstance().getRootUrl() + "plugin/" + wrapper.getShortName() + "/"; }