Codota Logo
CloudStatistics$ProvisioningListener.get
Code IndexAdd Codota to your IDE (free)

How to use
get
method
in
org.jenkinsci.plugins.cloudstats.CloudStatistics$ProvisioningListener

Best Java code snippets using org.jenkinsci.plugins.cloudstats.CloudStatistics$ProvisioningListener.get (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: KostyaSha/yet-another-docker-plugin

  @Override
  public void tearDown(Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener)
      throws IOException, InterruptedException {
    LOG.info("Shutting down slave");
    listener.getLogger().println("Shutting down slave '" + slaveName + "'.");
    final Node slaveNode = Jenkins.getInstance().getNode(slaveName);
    if (isNull(slaveNode)) {
      throw new IllegalStateException("Can't get node " + slaveName);
    }
    final DockerSlaveSingle node = (DockerSlaveSingle) slaveNode;
    try {
      node.terminate();
    } catch (Throwable e) {
      LOG.error("Can't terminate node", e);
      CloudStatistics.ProvisioningListener.get().onFailure(node.getId(), e);
    }
  }
}
origin: KostyaSha/yet-another-docker-plugin

t.getNumExecutors(),
Computer.threadPoolForRemoting.submit(() -> {
  get().onStarted(id);
  try {
    final DockerSlave dockerSlave = provisionWithWait(t, id);
    get().onComplete(id, dockerSlave); //rename
    return dockerSlave;
  } catch (Exception ex) {
    LOG.error("Error in provisioning; template='{}' for cloud='{}'",
        t, getDisplayName(), ex);
    get().onFailure(id, ex);
    throw Throwables.propagate(ex);
  } finally {
origin: jenkinsci/azure-vm-agents-plugin

public void cleanCloudStatistics() {
  Jenkins jenkins = Jenkins.getInstance();
  Set<ProvisioningActivity.Id> plannedNodesSet = new HashSet<>();
  for (NodeProvisioner.PlannedNode node : jenkins.unlabeledNodeProvisioner.getPendingLaunches()) {
    if (node instanceof TrackedItem) {
      plannedNodesSet.add(((TrackedItem) node).getId());
    }
  }
  for (Label l : jenkins.getLabels()) {
    for (NodeProvisioner.PlannedNode node : l.nodeProvisioner.getPendingLaunches()) {
      if (node instanceof TrackedItem) {
        plannedNodesSet.add(((TrackedItem) node).getId());
      }
    }
  }
  for (Node node : jenkins.getNodes()) {
    if (node instanceof TrackedItem) {
      plannedNodesSet.add(((TrackedItem) node).getId());
    }
  }
  Collection<ProvisioningActivity> activities = CloudStatistics.get().getNotCompletedActivities();
  for (ProvisioningActivity activity : activities) {
    if (activity.getCurrentPhase().equals(ProvisioningActivity.Phase.PROVISIONING)
        && !plannedNodesSet.contains(activity.getId())) {
      Exception e = new Exception(String.format("Node %s has lost. Mark as failure",
          activity.getId().toString()));
      CloudStatistics.ProvisioningListener.get().onFailure(activity.getId(), e);
    }
  }
}
origin: jenkinsci/openstack-cloud-plugin

@Restricted(NoExternalUse.class)
public @Nonnull JCloudsSlave provisionSlave(JCloudsSlaveTemplate template) throws IOException, Openstack.ActionFailed{
  CloudStatistics.ProvisioningListener provisioningListener = CloudStatistics.ProvisioningListener.get();
  ProvisioningActivity.Id id = new ProvisioningActivity.Id(this.name, template.name);
  JCloudsSlave node;
  try {
    provisioningListener.onStarted(id);
    node = template.provisionSlave(this, id);
    provisioningListener.onComplete(id, node);
  } catch (Throwable ex) {
    provisioningListener.onFailure(id, ex);
    throw ex;
  }
  Jenkins.getActiveInstance().addNode(node);
  return node;
}
origin: KostyaSha/yet-another-docker-plugin

get().onStarted(activityId);
final String futureName = "yadp" + Integer.toString(activityId.getFingerprint());
} catch (Throwable e) {
  LOG.error("fd", e);
  CloudStatistics.ProvisioningListener.get().onFailure(node.getId(), e);
get().onFailure(activityId, e);
throw new AbortException("failed to run slave");
origin: jenkinsci/azure-vm-agents-plugin

    CloudStatistics.ProvisioningListener.get().onStarted(provisioningId);
    CloudStatistics.ProvisioningListener.get().onComplete(provisioningId, agent);
} catch (AzureCloudException e) {
  if (isProvisionOutside) {
    CloudStatistics.ProvisioningListener.get().onFailure(provisioningId, e);
org.jenkinsci.plugins.cloudstatsCloudStatistics$ProvisioningListenerget

Popular methods of CloudStatistics$ProvisioningListener

  • onComplete
  • onFailure
  • onStarted

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • getSystemService (Context)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now