Changeset 1130


Ignore:
Timestamp:
Jun 16, 2009, 1:34:46 PM (12 years ago)
Author:
Nicklas Nordborg
Message:

References #229: Implement API for additional GenePattern? web services

Added convenience method that waits (interruptable) for a GP job to complete.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.genepattern/trunk/src/net/sf/basedb/genepattern/wrapper/GPClient.java

    r1115 r1130  
    11package net.sf.basedb.genepattern.wrapper;
    22
     3import net.sf.basedb.core.signal.SignalException;
    34import net.sf.basedb.genepattern.GPServer;
    45import net.sf.basedb.util.filter.Filter;
     
    176177 
    177178  /**
     179    Submit a job to the GenePattern server and wait for the
     180    result to complete. This is a convenience method for calling
     181    {@link #runAnalysisNoWait(String, Parameter...)} and then
     182    {@link #waitFor(int, int)}, but it throws a {@link SignalException}
     183    instead of a {@link InterruptedException}.
     184   
     185    @param module The name or LSID of the module/pipeline to execute
     186    @param parameters An array with the parameter values
     187    @return The result of the job
     188    @throws WebServiceException If there is a problem submitting the job
     189    @throws SignalException If the wait was interrupted
     190  */
     191  public JobResult runAnalysis(String module, Parameter... parameters)
     192    throws WebServiceException
     193  {
     194    int jobId = runAnalysisNoWait(module, parameters);
     195    JobResult result = null;
     196    try
     197    {
     198      result = waitFor(jobId, 5);
     199    }
     200    catch (InterruptedException ex)
     201    {
     202      throw new SignalException("Aborted by user");
     203    }
     204    return result;
     205  }
     206 
     207  /**
    178208    Has the job finished?
    179209    @param jobId The ID of the job
Note: See TracChangeset for help on using the changeset viewer.