Examples of Lease


Examples of hudson.slaves.WorkspaceList.Lease

                listener.getLogger().print(node instanceof Jenkins ? Messages.AbstractBuild_BuildingOnMaster() :
                    Messages.AbstractBuild_BuildingRemotely(ModelHyperlinkNote.encodeTo("/computer/" + builtOn, builtOn)));
            else
              listener.getLogger().print(Messages.AbstractBuild_Building());
           
            final Lease lease = decideWorkspace(node,Computer.currentComputer().getWorkspaceList());

            try {
                workspace = lease.path.getRemote();
                listener.getLogger().println(Messages.AbstractBuild_BuildingInWorkspace(workspace));
                node.getFileSystemProvisioner().prepareWorkspace(AbstractBuild.this,lease.path,listener);
               
                for (WorkspaceListener wl : WorkspaceListener.all()) {
                    wl.beforeUse(AbstractBuild.this, lease.path, listener);
                }
                preCheckout(launcher,listener);
                checkout(listener);

                if (!preBuild(listener,project.getProperties()))
                    return Result.FAILURE;

                Result result = doRun(listener);

                Computer c = node.toComputer();
                if (c==null || c.isOffline()) {
                    // As can be seen in HUDSON-5073, when a build fails because of the slave connectivity problem,
                    // error message doesn't point users to the slave. So let's do it here.
                    listener.hyperlink("/computer/"+builtOn+"/log","Looks like the node went offline during the build. Check the slave log for the details.");

                    if (c != null) {
                        // grab the end of the log file. This might not work very well if the slave already
                        // starts reconnecting. Fixing this requires a ring buffer in slave logs.
                        AnnotatedLargeText<Computer> log = c.getLogText();
                        StringWriter w = new StringWriter();
                        log.writeHtmlTo(Math.max(0,c.getLogFile().length()-10240),w);

                        listener.getLogger().print(ExpandableDetailsNote.encodeTo("details",w.toString()));
                        listener.getLogger().println();
                    }
                }

                // kill run-away processes that are left
                // use multiple environment variables so that people can escape this massacre by overriding an environment
                // variable for some processes
                launcher.kill(getCharacteristicEnvVars());

                // this is ugly, but for historical reason, if non-null value is returned
                // it should become the final result.
                if (result==null)    result = getResult();
                if (result==null)    result = Result.SUCCESS;

                return result;
            } finally {
                lease.release();
                this.listener = null;
            }
        }
View Full Code Here

Examples of hudson.slaves.WorkspaceList.Lease

            // lock is done at the parent level, so that concurrent MatrixProjects get respective workspace,
            // but within MatrixConfigurations that belong to the same MatrixBuild.
            // if MatrixProject is configured with custom workspace, we assume that the user knows what he's doing
            // and try not to append unique random suffix.
            Lease baseLease = getParentWorkspaceLease(n,wsl);

            // resolve the relative path against the parent workspace, which needs locking
            FilePath baseDir = baseLease.path;

            // prepare variables that can be used in the child workspace setting
View Full Code Here

Examples of hudson.slaves.WorkspaceList.Lease

            return wsl.allocate(n.getWorkspaceFor(mp), getParentBuild());
        }

        @Override
        protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws InterruptedException, IOException {
            Lease baseLease = getParentWorkspaceLease(n, wsl);
            FilePath baseDir = baseLease.path;
            EnvVars env = getEnvironment(listener);
            env.putAll(getBuildVariables());
            String childWs = getParent().getName();
            return Lease.createLinkedDummyLease(baseDir.child(env.expand(childWs)), baseLease);
View Full Code Here

Examples of java.rmi.dgc.Lease

    log.entering ("com.sun.grid.jgrid.proxy.ComputeProxy", "processDirtyCall");
   
    //Read arguments
    ObjID[] ids = null;
    long seqNum = -1L;
    Lease lease = null;
   
    log.log (Level.FINEST, "Reading arguments");
    try {
      ids = (ObjID[])objIn.readObject ();
      seqNum = objIn.readLong ();
      lease = (Lease)objIn.readObject ();
     
      if (ids.length > 0) {
        log.log (Level.FINE, "Dirty call for " + ids[0].toString ());
      }
    }
    catch (ClassNotFoundException e) {
      this.processException (out, new RemoteException ("Unable to find class", e));
      log.throwing ("com.sun.grid.jgrid.ComputeEngine", "processDirtyCall", e);
     
      return;
    }
    catch (ClassCastException e) {
      this.processException (out, new RemoteException ("Incorrect argument type", e));
      log.throwing ("com.sun.grid.jgrid.ComputeEngine", "processDirtyCall", e);
     
      return;
    }

    //Write message type
    log.log (Level.FINEST, "Writing return header");
    out.writeByte (TransportConstants.Return);

    MarshalOutputStream objOut = new MarshalOutputStream (out);

    //Write message header
    objOut.writeByte (TransportConstants.NormalReturn);
    uid.write (objOut);

    //If the lease we were passed has a valid VM ID, write it
    if (lease.getVMID () != null) {
      log.log (Level.FINEST, "Writing old lease object");
      objOut.writeObject (lease);
    }
    //If not, create a valid lease and write it
    else {
      log.log (Level.FINEST, "Writing new lease object");
      objOut.writeObject (new Lease (new VMID (), lease.getValue ()));
    }

    objOut.flush ();
   
    log.exiting ("com.sun.grid.jgrid.proxy.ComputeProxy", "processDirtyCall");
View Full Code Here

Examples of net.jini.core.lease.Lease

    //Delete Queue services
    //Delete Job services
    //Delete leases
    try {
      while(!leaseList.isEmpty()) {
        Lease lease = (Lease)leaseList.firstElement();
        lease.cancel();
        leaseList.remove(lease);
        //System.out.println("--RMServer--: deleting lease");
      }
    } catch(Exception ex) {
      //System.out.println("--RMServer--: Exception in shutdown");
View Full Code Here

Examples of net.jini.core.lease.Lease

        ((SingleJobStatusTracer)
         tracerTable.remove(e.nextElement())).terminate();
      }
      while(!leaseList.isEmpty()) {
        //System.out.println("--RMAdapter--: deleting lease");
        Lease lease = (Lease)leaseList.firstElement();
        lease.cancel();
        leaseList.remove(lease);
      }
      if(nativeSGERMAdapter != null) {
        nativeSGERMAdapter.sgeGDIShutdown();
        nativeSGERMAdapter = null;
View Full Code Here

Examples of net.jini.core.lease.Lease

      message += "failed.";
      throw new TestException(message, ex);
  }     

  // trying to remove the lease should result in null value
  Lease managedLease = set.remove(testLease);
  if (managedLease != null) {
      String message = "Lease was added to renewal set in error\n";
      message += "from a call to renewFor with 0 membership.";
      throw new TestException(message);
  }
View Full Code Here

Examples of net.jini.core.lease.Lease

  sleepTime = doubleDuration * 3 / 4;
  rstUtil.sleepAndTell(sleepTime, "3/4 lease membership duration.");

  /* if the membership duration was honored we should be able
     to remove the lease */
  Lease managedLease = set.remove(testLease);
  if (managedLease == null) { // new membership was not honored
      String message = "The membership duration was apparently ";
      message += "not updated to the longer value\n";
      message += "when the lease was re-added to the set.";
      throw new TestException(message);
View Full Code Here

Examples of net.jini.core.lease.Lease

    "events.\n" + "Should have received exactly one.";
      throw new TestException(message);
  }

  // There is only one event received, now allow lease to expire
  Lease setLease = rrl.getLastLeaseRenewed();
  rstUtil.waitForLeaseExpiration(setLease,
               "for renewal set to expire.");
 
  // lease should now be expired, prove it ...
  try {
View Full Code Here

Examples of net.jini.core.lease.Lease

  logger.log(Level.FINE, "Assertion #3 passed.");

  /* ASSERTION #4
     The lease whose renewal failed should have been removed
     from the renewal set. */
  Lease managedLease = set.remove(failLease);
  if (managedLease != null) {
      String message = "Assertion #4 failed.\n" +
    "Failed lease was never removed from renewal set.";
      throw new TestException(message);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.