code: public static int jobSignal(GramJob job, int signal, String arg)
  	throws GramException, GSSException {
  
  	GlobusURL jobURL  = job.getID();
  	GSSCredential cred = getJobCredentials(job);
  
  	String msg = GRAMProtocol.SIGNAL(jobURL.getURL(),
  					 jobURL.getHost(),
  					 signal,
  					 arg);
  
  	GatekeeperReply hd = null;
  
  	hd = jmConnect(cred, jobURL, msg);
  
  	switch(signal) {
  	case GramJob.SIGNAL_PRIORITY:
  	    return hd.failureCode;
  	case GramJob.SIGNAL_STDIO_SIZE:
  	case GramJob.SIGNAL_STDIO_UPDATE:
  	case GramJob.SIGNAL_COMMIT_REQUEST:
  	case GramJob.SIGNAL_COMMIT_EXTEND:
  	case GramJob.SIGNAL_COMMIT_END:
  	case GramJob.SIGNAL_STOP_MANAGER:
  	    if (hd.failureCode != 0 && hd.status == GramJob.STATUS_FAILED) {
  		throw new GramException(hd.failureCode);
  	    } else if (hd.failureCode == 0 && hd.jobFailureCode != 0) {
  		job.setError( hd.jobFailureCode );
  		job.setStatus(GramJob.STATUS_FAILED);
  		return hd.failureCode;
  	    } else {
  		job.setStatus(hd.status);
  		return 0;
  	    }
  	default:
  	    job.setStatus( hd.status );
  	    job.setError( hd.failureCode );
  	    return 0;
  	}
      }
docs: This function sends a signal to a job.
  
  @throws GramException if an error occurs during cancel
  @param job the signaled job
  @param signal type of the signal
  @param arg argument of the signal