code: public static void jobStatus(GramJob job)
  	throws GramException, GSSException {
  
  	GlobusURL jobURL  = job.getID();
  	GSSCredential cred = getJobCredentials(job);
  
  	String msg = GRAMProtocol.STATUS_POLL(jobURL.getURL(),
  					      jobURL.getHost());
  
  	GatekeeperReply hd = null;
  
  	try {
  	    hd = jmConnect(cred, jobURL, msg);
  	} catch(GramException e) {
  	    // this is exactly what C does
  	    if (e.getErrorCode() == GramException.ERROR_CONNECTION_FAILED) {
  		job.setError( GramException.ERROR_CONTACTING_JOB_MANAGER );
  		e.setErrorCode( GramException.ERROR_CONTACTING_JOB_MANAGER );
  	    }
  	    throw e;
  	}
  
  	// We didn't seem to care much about setting things
  	// before the status here, presumably because of the
  	// assumption that, when polling, listeners are not used
  	// on the GramJob. I disagree. There is no good reason
  	// why that couldn't happen
  	job.setExitCode( hd.exitCode );
  	job.setError( hd.failureCode );
  	job.setStatus( hd.status );
      }
docs: This function updates the status of a job (within the job object),
  and throws an exception if the status is not OK. If the
  job manager cannot be contacted the job error code is
  set to GramException.ERROR_CONTACTING_JOB_MANAGER and an
  exception with the same error code is thrown.
  
  @throws GramException if an error occurs during status update.
  @param job the job whose status is to be updated.