Skip to content
Snippets Groups Projects
Commit ed2d6918 authored by tjc's avatar tjc
Browse files

tidy

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@13780 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 5fa42b52
No related branches found
No related tags found
No related merge requests found
...@@ -128,119 +128,89 @@ public class ExternalProgram ...@@ -128,119 +128,89 @@ public class ExternalProgram
// sequence_file_names will be set by prepareRun() // sequence_file_names will be set by prepareRun()
final File file_of_filenames = prepareRun(features, sequence_file_names); final File file_of_filenames = prepareRun(features, sequence_file_names);
// final Integer job_control_id = try
// Options.getOptions().getIntegerProperty("jcon_" + getName() + {
// "_program_id"); if( System.getProperty("j2ssh") != null &&
!System.getProperty("j2ssh").equals("false") &&
// final Integer min_jc_jobs = (getRealName().indexOf("blast") > -1 || getRealName().startsWith("fast")))
// Options.getOptions().getIntegerProperty("jcon_min_jobs");
// String jcon_template =
// Options.getOptions().getProperty("jcon_" + getName() + "_template");
// final String jcon_batch_queue =
// Options.getOptions().getProperty("jcon_batch_queue");
// if(job_control_id != null &&
// min_jc_jobs != null &&
// jcon_template != null &&
// jcon_batch_queue != null &&
// features.size() >= min_jc_jobs.intValue())
// {
// return ExternalProgramUtils.runJConProgram(this, features,
// sequence_file_names, logger);
// }
// else
// {
try
{ {
if( System.getProperty("j2ssh") != null && logger4j.debug("GET READY TO CALL SSH CLIENT " + getRealName());
!System.getProperty("j2ssh").equals("false") &&
(getRealName().indexOf("blast") > -1 || getRealName().startsWith("fast")) )
{
logger4j.debug("GET READY TO CALL SSH CLIENT "+getRealName()); final Feature this_feature = features.elementAt(0);
Entry entry = this_feature.getEntry();
String[] args;
final Feature this_feature = features.elementAt(0); if (((DocumentEntry) entry.getEMBLEntry()).getDocument() instanceof RemoteFileDocument)
Entry entry = this_feature.getEntry(); {
String [] args; RemoteFileDocument nodeDoc = (RemoteFileDocument) (((DocumentEntry) entry
.getEMBLEntry()).getDocument());
if(((DocumentEntry)entry.getEMBLEntry()).getDocument() RemoteFileNode node = nodeDoc.getRemoteFileNode();
instanceof RemoteFileDocument)
{ String wdir = node.getRootDir() + "/" + node.getFullName();
RemoteFileDocument nodeDoc = int index = wdir.lastIndexOf("/");
(RemoteFileDocument)(((DocumentEntry)entry.getEMBLEntry()).getDocument()); wdir = wdir.substring(0, index);
RemoteFileNode node = nodeDoc.getRemoteFileNode();
args = new String[9];
String wdir = node.getRootDir()+"/"+node.getFullName();
int index = wdir.lastIndexOf("/"); args[0] = "-f";
wdir = wdir.substring(0,index); args[1] = file_of_filenames.getPath();
args[2] = "-cmd";
args = new String[9]; args[3] = getRealName();
args[4] = "-wdir";
args[0] = "-f"; args[1] = file_of_filenames.getPath(); args[5] = wdir;
args[2] = "-cmd"; args[3] = getRealName(); args[6] = "-d";
args[4] = "-wdir"; args[5] = wdir; args[7] = getProgramOptions();
args[6] = "-d"; args[7] = getProgramOptions(); args[8] = "-keep";
args[8] = "-keep";
}
else
{
args = new String[6];
args[0] = "-f"; args[1] = file_of_filenames.getPath();
args[2] = "-cmd"; args[3] = getRealName();
args[4] = "-d"; args[5] = getProgramOptions();
}
logger4j.debug("CALL SSH CLIENT "+getRealName());
uk.ac.sanger.artemis.j2ssh.SshPSUClient ssh =
new uk.ac.sanger.artemis.j2ssh.SshPSUClient(args);
ssh.start();
new ProgressBarFrame(1, getName());
return null;
} }
else
final String [] arguments;
switch(program_type)
{ {
case DNA_PROGRAM: args = new String[6];
// fall through
case AA_PROGRAM: args[0] = "-f";
arguments = new String [] args[1] = file_of_filenames.getPath();
{ args[2] = "-cmd";
file_of_filenames.getPath(), args[3] = getRealName();
getProgramOptions() args[4] = "-d";
}; args[5] = getProgramOptions();
break;
case APPLICATION:
arguments = new String []
{
file_of_filenames.getPath(),
};
break;
default:
throw new Error("internal error - unknown program type");
} }
final Process process = logger4j.debug("CALL SSH CLIENT " + getRealName());
startProgram("run_" + getRealName(), arguments); uk.ac.sanger.artemis.j2ssh.SshPSUClient ssh = new uk.ac.sanger.artemis.j2ssh.SshPSUClient(
args);
// ssh.start();
//
new ProgressBarFrame(1, getName()); new ProgressBarFrame(1, getName());
return new ProcessMonitor(process, getName(), logger); return null;
} }
catch(SecurityException e)
final String[] arguments;
switch (program_type)
{ {
// re-throw as an ExternalProgramException case DNA_PROGRAM:
throw new ExternalProgramException("SecurityException while running " + // fall through
getName() + ": " + case AA_PROGRAM:
e.getMessage()); arguments = new String[]
{ file_of_filenames.getPath(), getProgramOptions() };
break;
case APPLICATION:
arguments = new String[]
{ file_of_filenames.getPath(), };
break;
default:
throw new Error("internal error - unknown program type");
} }
// }
final Process process = startProgram("run_" + getRealName(), arguments);
//
new ProgressBarFrame(1, getName());
return new ProcessMonitor(process, getName(), logger);
}
catch (SecurityException e)
{
// re-throw as an ExternalProgramException
throw new ExternalProgramException("SecurityException while running "
+ getName() + ": " + e.getMessage());
}
} }
...@@ -298,7 +268,7 @@ public class ExternalProgram ...@@ -298,7 +268,7 @@ public class ExternalProgram
File first_directory = null; File first_directory = null;
// stores the number of features in each directory // stores the number of features in each directory
final Hashtable feature_count_hash = new Hashtable(); final Hashtable<File, Long> feature_count_hash = new Hashtable<File, Long>();
for(int i = 0 ; i < features.size() ; ++i) for(int i = 0 ; i < features.size() ; ++i)
{ {
...@@ -341,12 +311,12 @@ public class ExternalProgram ...@@ -341,12 +311,12 @@ public class ExternalProgram
node = nodeDoc.getRemoteFileNode(); node = nodeDoc.getRemoteFileNode();
} }
final java.util.Hashtable file_number_hash = new java.util.Hashtable(); final Hashtable<File, Long> file_number_hash = new Hashtable<File, Long>();
for(final Enumeration e = feature_count_hash.keys() ; for(final Enumeration<File> e = feature_count_hash.keys() ;
e.hasMoreElements() ;) e.hasMoreElements() ;)
{ {
final File directory =(File) e.nextElement(); final File directory = e.nextElement();
final long old_file_number = getFileNumber(directory, node); final long old_file_number = getFileNumber(directory, node);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment