org.biojava.bio.structure.align.client
Class FarmJobRunnable

java.lang.Object
  extended by org.biojava.bio.structure.align.client.FarmJobRunnable
All Implemented Interfaces:
Runnable

public class FarmJobRunnable
extends Object
implements Runnable

Contains the single thread for a job that can run multiple alignments.

Author:
Andreas Prlic

Constructor Summary
FarmJobRunnable(FarmJobParameters params)
           
 
Method Summary
 void addAlignmentProgressListener(AlignmentProgressListener listener)
           
 String alignPair(String name1, String name2)
           
 String alignPair(String name1, String name2, String algorithmName)
           
 void clearListeners()
           
protected  PdbPairsMessage getAlignmentPairsFromServer()
          talk to centralized server and fetch all alignments to run.
protected static String getRandomUsername()
           
 boolean isWaitForAlignments()
           
static void log(String message)
           
 void run()
           
protected  void sendResultsToServer(List<String> results)
           
 void setWaitForAlignments(boolean waitForAlignments)
           
 void terminate()
          Send signal to terminate calculations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FarmJobRunnable

public FarmJobRunnable(FarmJobParameters params)
Method Detail

addAlignmentProgressListener

public void addAlignmentProgressListener(AlignmentProgressListener listener)

clearListeners

public void clearListeners()

getRandomUsername

protected static String getRandomUsername()

log

public static void log(String message)

run

public void run()
Specified by:
run in interface Runnable

alignPair

public String alignPair(String name1,
                        String name2)
                 throws StructureException,
                        IOException
Throws:
StructureException
IOException

alignPair

public String alignPair(String name1,
                        String name2,
                        String algorithmName)
                 throws StructureException,
                        IOException
Throws:
StructureException
IOException

getAlignmentPairsFromServer

protected PdbPairsMessage getAlignmentPairsFromServer()
talk to centralized server and fetch all alignments to run.

Returns:
a list of pairs to align.

sendResultsToServer

protected void sendResultsToServer(List<String> results)

terminate

public void terminate()
Send signal to terminate calculations


isWaitForAlignments

public boolean isWaitForAlignments()

setWaitForAlignments

public void setWaitForAlignments(boolean waitForAlignments)