jenkins.model.Jenkins.get()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(485)

本文整理了Java中jenkins.model.Jenkins.get()方法的一些代码示例,展示了Jenkins.get()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jenkins.get()方法的具体详情如下:
包路径:jenkins.model.Jenkins
类名称:Jenkins
方法名:get

Jenkins.get介绍

[英]Gets the Jenkins singleton.
[中]得到詹金斯单身汉。

代码示例

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Returns all the registered {@link Cloud} descriptors.
  3. */
  4. public static DescriptorExtensionList<Cloud,Descriptor<Cloud>> all() {
  5. return Jenkins.get().getDescriptorList(Cloud.class);
  6. }

代码示例来源:origin: jenkinsci/jenkins

  1. @Override
  2. public boolean isActivated() {
  3. return Jenkins.get().getCrumbIssuer() == null;
  4. }
  5. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Gets the directory where Hudson stores user information.
  3. */
  4. static File getRootDir() {
  5. return new File(Jenkins.get().getRootDir(), "users");
  6. }

代码示例来源:origin: jenkinsci/jenkins

  1. public Executor(@Nonnull Computer owner, int n) {
  2. super("Executor #"+n+" for "+owner.getDisplayName());
  3. this.owner = owner;
  4. this.queue = Jenkins.get().getQueue();
  5. this.number = n;
  6. }

代码示例来源:origin: jenkinsci/jenkins

  1. @CheckForNull
  2. public PluginWrapper getPlugin(@Nonnull UpdateSite.Warning warning) {
  3. if (warning.type != UpdateSite.Warning.Type.PLUGIN) {
  4. return null;
  5. }
  6. return Jenkins.get().getPluginManager().getPlugin(warning.component);
  7. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * @deprecated This is a verbose historical alias for {@link #get}.
  3. * @since 1.590
  4. */
  5. @Deprecated
  6. @Nonnull
  7. public static Jenkins getActiveInstance() throws IllegalStateException {
  8. return get();
  9. }

代码示例来源:origin: jenkinsci/jenkins

  1. @Override
  2. @Nonnull
  3. public ACL getACL() {
  4. ACL base = Jenkins.get().getAuthorizationStrategy().getACL(this);
  5. // always allow a non-anonymous user full control of himself.
  6. return ACL.lambda((a, permission) -> (idStrategy().equals(a.getName(), id) && !(a instanceof AnonymousAuthenticationToken))
  7. || base.hasPermission(a, permission));
  8. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public boolean filter(@CheckForNull Object context, @Nonnull Descriptor descriptor) {
  6. return descriptor.clazz != JNLPLauncher.class || Jenkins.get().getTcpSlaveAgentListener() != null;
  7. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Sets up the Setup Wizard filter if the current state requires it.
  3. */
  4. private void checkFilter() {
  5. if (!Jenkins.get().getInstallState().isSetupComplete()) {
  6. setUpFilter();
  7. }
  8. }
  9. }

代码示例来源:origin: jenkinsci/jenkins

  1. public void initializeState() {
  2. Jenkins j = Jenkins.get();
  3. try {
  4. j.getSetupWizard().completeSetup();
  5. } catch (Exception e) {
  6. throw new RuntimeException(e);
  7. }
  8. j.setInstallState(RUNNING);
  9. }
  10. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Returns all login page decorators.
  3. * @since 2.156
  4. */
  5. public static List<SimplePageDecorator> all() {
  6. return Jenkins.get().getDescriptorList(SimplePageDecorator.class);
  7. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * File that captures the state of upgrade.
  3. *
  4. * This file records the version number that the installation has upgraded to.
  5. */
  6. /*package*/ static File getUpdateStateFile() {
  7. return new File(Jenkins.get().getRootDir(),"jenkins.install.UpgradeWizard.state");
  8. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Returns true if this monitor {@link #disable(boolean) isn't disabled} earlier.
  3. *
  4. * <p>
  5. * This flag implements the ability for the admin to say "no thank you" to the monitor that
  6. * he wants to ignore.
  7. */
  8. public boolean isEnabled() {
  9. return !((AbstractCIBase)Jenkins.get()).disabledAdministrativeMonitors.contains(id);
  10. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Returns all the registered {@link NodeDescriptor} descriptors.
  3. */
  4. public static DescriptorExtensionList<Node,NodeDescriptor> all() {
  5. return Jenkins.get().getDescriptorList(Node.class);
  6. }

代码示例来源:origin: jenkinsci/jenkins

  1. @Override
  2. @Restricted(NoExternalUse.class)
  3. public Object getTarget() {
  4. if (!SKIP_PERMISSION_CHECK) {
  5. if (!Jenkins.get().hasPermission(Jenkins.READ)) {
  6. return null;
  7. }
  8. }
  9. return this;
  10. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Returns all the registered {@link RetentionStrategy} descriptors.
  3. */
  4. public static DescriptorExtensionList<RetentionStrategy<?>,Descriptor<RetentionStrategy<?>>> all() {
  5. return (DescriptorExtensionList) Jenkins.get().getDescriptorList(RetentionStrategy.class);
  6. }

代码示例来源:origin: jenkinsci/jenkins

  1. @Override
  2. public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
  3. try {
  4. Jenkins.get().clouds.rebuildHetero(req,json, Cloud.all(), "cloud");
  5. return true;
  6. } catch (IOException e) {
  7. throw new FormException(e,"clouds");
  8. }
  9. }
  10. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Returns all the registered {@link GlobalConfiguration} descriptors.
  3. */
  4. public static @Nonnull ExtensionList<GlobalConfiguration> all() {
  5. return Jenkins.get().getDescriptorList(GlobalConfiguration.class);
  6. // pointless type parameters help work around bugs in javac in earlier versions http://codepad.org/m1bbFRrH
  7. }
  8. }

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Gets the list of {@link Build}s that include changes by this user,
  3. * by the timestamp order.
  4. */
  5. @SuppressWarnings("unchecked")
  6. @WithBridgeMethods(List.class)
  7. public @Nonnull
  8. RunList getBuilds() {
  9. return RunList.fromJobs((Iterable) Jenkins.get().
  10. allItems(Job.class)).filter((Predicate<Run<?, ?>>) r -> r instanceof AbstractBuild && relatedTo((AbstractBuild<?, ?>) r));
  11. }

代码示例来源:origin: jenkinsci/jenkins

  1. @Override
  2. public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
  3. // for compatibility reasons, the actual value is stored in Jenkins
  4. Jenkins j = Jenkins.get();
  5. if (json.has("myViewsTabBar")) {
  6. j.setMyViewsTabBar(req.bindJSON(MyViewsTabBar.class,json.getJSONObject("myViewsTabBar")));
  7. } else {
  8. j.setMyViewsTabBar(new DefaultMyViewsTabBar());
  9. }
  10. return true;
  11. }
  12. }

相关文章

Jenkins类方法