From: pvtroshin Date: Fri, 12 Aug 2011 13:35:18 +0000 (+0000) Subject: Javadoc fixes X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ba2d4e920e433bd080f448248e7dacade69a27a0;p=jabaws.git Javadoc fixes git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@4508 e3abac25-378b-4346-85de-24260fe3988d --- diff --git a/datamodel/compbio/data/sequence/ClustalAlignmentUtil.java b/datamodel/compbio/data/sequence/ClustalAlignmentUtil.java index 2656046..fc44c44 100644 --- a/datamodel/compbio/data/sequence/ClustalAlignmentUtil.java +++ b/datamodel/compbio/data/sequence/ClustalAlignmentUtil.java @@ -200,7 +200,7 @@ public final class ClustalAlignmentUtil { * consensus. Potential bug - records 60 chars length alignment where * Clustal would have recorded 50 chars. * - * @param outStream + * @param out * * @param alignment * @throws IOException diff --git a/datamodel/compbio/data/sequence/FastaReader.java b/datamodel/compbio/data/sequence/FastaReader.java index 38f1ccb..1641d34 100644 --- a/datamodel/compbio/data/sequence/FastaReader.java +++ b/datamodel/compbio/data/sequence/FastaReader.java @@ -71,7 +71,7 @@ public class FastaReader implements Iterator { /** * Header data can contain non-ASCII symbols and read in UTF8 * - * @param input + * @param inputFile * the file containing the list of FASTA formatted sequences to * read from * @throws FileNotFoundException diff --git a/datamodel/compbio/data/sequence/Score.java b/datamodel/compbio/data/sequence/Score.java index c8cbfb4..ec4cadc 100644 --- a/datamodel/compbio/data/sequence/Score.java +++ b/datamodel/compbio/data/sequence/Score.java @@ -128,7 +128,7 @@ public class Score implements Comparable { /** * Return Ranges if any Collections.EMPTY_SET otherwise * - * @return + * @return ordered set of Range */ public TreeSet getRanges() { return ranges; @@ -200,8 +200,7 @@ public class Score implements Comparable { * * @param scores * the list of scores to output - * @param output - * the stream to output the data to + * @param writer * @throws IOException * if the OutputStream cannot be written into * @throws NullPointerException diff --git a/datamodel/compbio/data/sequence/SequenceUtil.java b/datamodel/compbio/data/sequence/SequenceUtil.java index 16b65f2..6e20988 100644 --- a/datamodel/compbio/data/sequence/SequenceUtil.java +++ b/datamodel/compbio/data/sequence/SequenceUtil.java @@ -290,7 +290,7 @@ public final class SequenceUtil { * Read IUPred output * * @param result - * @return + * @return Map key->sequence name, value->Score * @throws IOException * @throws UnknownFileFormatException */ @@ -427,7 +427,7 @@ public final class SequenceUtil { * * @param inStream * the InputStream connected to the JRonn output file - * @return List of {@link AnnotatedSequence} objects + * @return Map key=sequence name value=Score * @throws IOException * is thrown if the inStream has problems accessing the data * @throws UnknownFileFormatException @@ -533,7 +533,8 @@ public final class SequenceUtil { * * * @param input - * @return + * the InputStream + * @return Map key=sequence name, value=set of score * @throws IOException * @throws UnknownFileFormatException */ @@ -655,7 +656,7 @@ public final class SequenceUtil { * * * @param input - * @return + * @return Map key=sequence name, value=set of score * @throws IOException * @throws UnknownFileFormatException */ diff --git a/engine/compbio/engine/Cleaner.java b/engine/compbio/engine/Cleaner.java index e4e2923..4813388 100644 --- a/engine/compbio/engine/Cleaner.java +++ b/engine/compbio/engine/Cleaner.java @@ -26,6 +26,7 @@ import compbio.engine.client.ConfiguredExecutable; import compbio.engine.client.PathValidator; import compbio.engine.local.ExecutableWrapper; +@Deprecated public class Cleaner { private static final Logger log = Logger.getLogger(Cleaner.class); @@ -37,7 +38,8 @@ public class Cleaner { * * @param workDirectory * @param files - * @return + * @return This method returns true if all files specified by List files + * were successfully removed, false otherwise */ public static boolean deleteFiles(ConfiguredExecutable exec) { @@ -71,12 +73,11 @@ public class Cleaner { if (success) { log.trace(type + filename + " was successfully removed"); } else { - log - .debug("Could not remove " - + type - + ": " - + filename - + " reportedly created by executable. Insufficient access right?"); + log.debug("Could not remove " + + type + + ": " + + filename + + " reportedly created by executable. Insufficient access right?"); } } else { log.debug("File: " + filename diff --git a/engine/compbio/engine/FilePuller.java b/engine/compbio/engine/FilePuller.java index d040838..98a44bc 100644 --- a/engine/compbio/engine/FilePuller.java +++ b/engine/compbio/engine/FilePuller.java @@ -32,284 +32,285 @@ import compbio.util.FileWatcher; public class FilePuller implements Delayed { - private static final Logger log = Logger.getLogger(FilePuller.class); - - // 5 minutes in nanosec - private static long defaultDelay = 1000 * 1000 * 1000L * 5 * 60; - private final File file; - private long lastAccessTime; - private FileWatcher watcher; - final int chunkSize; - - // used for testing only - long delay = 0; - - private FilePuller(String file, int size) { - FileWatcher.validateInput(file, size); - if (compbio.util.Util.isEmpty(file)) { - throw new NullPointerException("File name must be provided!"); + private static final Logger log = Logger.getLogger(FilePuller.class); + + // 5 minutes in nanosec + private static long defaultDelay = 1000 * 1000 * 1000L * 5 * 60; + private final File file; + private long lastAccessTime; + private FileWatcher watcher; + final int chunkSize; + + // used for testing only + long delay = 0; + + private FilePuller(String file, int size) { + FileWatcher.validateInput(file, size); + if (compbio.util.Util.isEmpty(file)) { + throw new NullPointerException("File name must be provided!"); + } + // The fact that the file may not exist at a time does not matter here + if (!PathValidator.isAbsolutePath(file)) { + throw new IllegalArgumentException("Absolute path to the File " + + file + " is expected but not provided!"); + } + this.file = new File(file); + this.chunkSize = size; + this.lastAccessTime = System.nanoTime(); } - // The fact that the file may not exist at a time does not matter here - if (!PathValidator.isAbsolutePath(file)) { - throw new IllegalArgumentException("Absolute path to the File " - + file + " is expected but not provided!"); + + private FilePuller(String file) { + if (compbio.util.Util.isEmpty(file)) { + throw new NullPointerException("File name must be provided!"); + } + // The fact that the file may not exist at a time does not matter here + if (!PathValidator.isAbsolutePath(file)) { + throw new IllegalArgumentException("Absolute path to the File " + + file + " is expected but not provided!"); + } + this.file = new File(file); + this.chunkSize = 3; + this.lastAccessTime = System.nanoTime(); } - this.file = new File(file); - this.chunkSize = size; - this.lastAccessTime = System.nanoTime(); - } - - private FilePuller(String file) { - if (compbio.util.Util.isEmpty(file)) { - throw new NullPointerException("File name must be provided!"); + + public static FilePuller newFilePuller(String file, int chunkSize) { + return new FilePuller(file, chunkSize); } - // The fact that the file may not exist at a time does not matter here - if (!PathValidator.isAbsolutePath(file)) { - throw new IllegalArgumentException("Absolute path to the File " - + file + " is expected but not provided!"); + + /** + * Progress Puller is designed to read 3 characters from the beginning of + * the file, nothing more. Intended to be used in conjunction with a tool + * which output progress as a percent value from 0 to 100. In any cases + * progress could not be more than the largest byte value 255. + * + * @param file + * @return instance + */ + public static FilePuller newProgressPuller(String file) { + return new FilePuller(file); } - this.file = new File(file); - this.chunkSize = 3; - this.lastAccessTime = System.nanoTime(); - } - - public static FilePuller newFilePuller(String file, int chunkSize) { - return new FilePuller(file, chunkSize); - } - - /** - * Progress Puller is designed to read 3 characters from the beginning of - * the file, nothing more. Intended to be used in conjunction with a tool - * which output progress as a percent value from 0 to 100. In any cases - * progress could not be more than the largest byte value 255. - * - * @param file - * @return - */ - public static FilePuller newProgressPuller(String file) { - return new FilePuller(file); - } - - public ChunkHolder pull(long position) throws IOException { - initPull(); - String valueUTF16 = watcher.pull(position); - String value = null; - if (valueUTF16 != null) { - value = removeInvalidXMLCharacters(valueUTF16); + + public ChunkHolder pull(long position) throws IOException { + initPull(); + String valueUTF16 = watcher.pull(position); + String value = null; + if (valueUTF16 != null) { + value = removeInvalidXMLCharacters(valueUTF16); + } + return new ChunkHolder(value, watcher.getCursorPosition()); } - return new ChunkHolder(value, watcher.getCursorPosition()); - } - - /** - * This method ensures that the output String has only valid XML unicode - * characters as specified by the XML 1.0 standard. For reference, please - * see the standard. - * - * @param The - * String whose non-valid characters we want to remove. - * - * @return The in String, stripped of non-valid characters. - */ - static String removeInvalidXMLCharacters(String str) { - assert str != null; - - StringBuilder out = new StringBuilder(); // Used to hold the output. - int codePoint; // Used to reference the current character. - - // For test - // String ss = "\ud801\udc00"; // This is actualy one unicode character, - // represented by two code units!!!. - // System.out.println(ss.codePointCount(0, ss.length()));// See: 1 - int i = 0; - String value = null; - try { - // make sure the string contain only UTF-8 characters - value = new String(str.getBytes("UTF-8"), "UTF-8"); - } catch (UnsupportedEncodingException e) { - // will not happen - throw new AssertionError("UTF-8 charset is not supported!!!"); + + /** + * This method ensures that the output String has only valid XML unicode + * characters as specified by the XML 1.0 standard. For reference, please + * see the standard. + * + * @param The + * String whose non-valid characters we want to remove. + * + * @return The in String, stripped of non-valid characters. + */ + static String removeInvalidXMLCharacters(String str) { + assert str != null; + + StringBuilder out = new StringBuilder(); // Used to hold the output. + int codePoint; // Used to reference the current character. + + // For test + // String ss = "\ud801\udc00"; // This is actualy one unicode character, + // represented by two code units!!!. + // System.out.println(ss.codePointCount(0, ss.length()));// See: 1 + int i = 0; + String value = null; + try { + // make sure the string contain only UTF-8 characters + value = new String(str.getBytes("UTF-8"), "UTF-8"); + } catch (UnsupportedEncodingException e) { + // will not happen + throw new AssertionError("UTF-8 charset is not supported!!!"); + } + while (i < value.length()) { + codePoint = value.codePointAt(i); // This is the unicode code of the + // character. + if ((codePoint == 0x9) + || // Consider testing larger ranges first to + // improve speed. + (codePoint == 0xA) || (codePoint == 0xD) + || ((codePoint >= 0x20) && (codePoint <= 0xD7FF)) + || ((codePoint >= 0xE000) && (codePoint <= 0xFFFD)) + || ((codePoint >= 0x10000) && (codePoint <= 0x10FFFF))) { + + out.append(Character.toChars(codePoint)); + } + + i += Character.charCount(codePoint); + /* + * Increment with the number of code units(java chars) needed to + * represent a Unicode char. + */ + } + return out.toString(); } - while (i < value.length()) { - codePoint = value.codePointAt(i); // This is the unicode code of the - // character. - if ((codePoint == 0x9) - || // Consider testing larger ranges first to - // improve speed. - (codePoint == 0xA) || (codePoint == 0xD) - || ((codePoint >= 0x20) && (codePoint <= 0xD7FF)) - || ((codePoint >= 0xE000) && (codePoint <= 0xFFFD)) - || ((codePoint >= 0x10000) && (codePoint <= 0x10FFFF))) { - - out.append(Character.toChars(codePoint)); - } - - i += Character.charCount(codePoint); - /* - * Increment with the number of code units(java chars) needed to - * represent a Unicode char. - */ + + public void initPull() { + this.lastAccessTime = System.nanoTime(); + if (!isFileCreated()) { + throw new IllegalStateException("File " + file.getAbsolutePath() + + " has not been created yet! Cannot pull."); + } + if (watcher == null) { + init(); + } } - return out.toString(); - } - - public void initPull() { - this.lastAccessTime = System.nanoTime(); - if (!isFileCreated()) { - throw new IllegalStateException("File " + file.getAbsolutePath() - + " has not been created yet! Cannot pull."); + + public String getFile() { + return file.getAbsolutePath(); } - if (watcher == null) { - init(); + + public boolean isFileCreated() { + this.lastAccessTime = System.nanoTime(); + return file.exists(); } - } - - public String getFile() { - return file.getAbsolutePath(); - } - - public boolean isFileCreated() { - this.lastAccessTime = System.nanoTime(); - return file.exists(); - } - - public void waitForFile(long maxWaitSeconds) { - long waited = 0; - int step = 500; - while (true) { - if (isFileCreated()) { - break; - } - try { - Thread.sleep(step); - // TODO is this needed? this.lastAccessTime = System.nanoTime(); - } catch (InterruptedException e) { - // Propagate interruption up the stack trace for anyone - // interested - Thread.currentThread().interrupt(); - log.debug("Thread interruped during waiting for file " - + file.getAbsolutePath() + " to be created. Message: " - + e.getMessage()); - break; - } - waited += step; - if (waited / 1000 >= maxWaitSeconds) { - break; - } + + public void waitForFile(long maxWaitSeconds) { + long waited = 0; + int step = 500; + while (true) { + if (isFileCreated()) { + break; + } + try { + Thread.sleep(step); + // TODO is this needed? this.lastAccessTime = System.nanoTime(); + } catch (InterruptedException e) { + // Propagate interruption up the stack trace for anyone + // interested + Thread.currentThread().interrupt(); + log.debug("Thread interruped during waiting for file " + + file.getAbsolutePath() + " to be created. Message: " + + e.getMessage()); + break; + } + waited += step; + if (waited / 1000 >= maxWaitSeconds) { + break; + } + } } - } - public boolean hasMoreData() throws IOException { - this.lastAccessTime = System.nanoTime(); - if (!isFileCreated()) { - throw new IllegalStateException("File " + file.getAbsolutePath() - + " has not been created yet! Cannot pull."); + public boolean hasMoreData() throws IOException { + this.lastAccessTime = System.nanoTime(); + if (!isFileCreated()) { + throw new IllegalStateException("File " + file.getAbsolutePath() + + " has not been created yet! Cannot pull."); + } + if (watcher == null) { + init(); + } + return watcher.hasMore(); } - if (watcher == null) { - init(); + + private synchronized void init() { + // Check watcher==null is duplicated to avoid adding synchronization to + // access methods + if (watcher == null) { + if (chunkSize < FileWatcher.MIN_CHUNK_SIZE_BYTES) { + watcher = FileWatcher + .newProgressWatcher(file.getAbsolutePath()); + log.debug("Init Progress watcher with file: " + + file.getAbsolutePath()); + } else { + watcher = FileWatcher.newFileWatcher(file.getAbsolutePath(), + chunkSize); + log.debug("Init File watcher with file: " + + file.getAbsolutePath()); + } + + } } - return watcher.hasMore(); - } - - private synchronized void init() { - // Check watcher==null is duplicated to avoid adding synchronization to - // access methods - if (watcher == null) { - if (chunkSize < FileWatcher.MIN_CHUNK_SIZE_BYTES) { - watcher = FileWatcher - .newProgressWatcher(file.getAbsolutePath()); - log.debug("Init Progress watcher with file: " - + file.getAbsolutePath()); - } else { - watcher = FileWatcher.newFileWatcher(file.getAbsolutePath(), - chunkSize); - log.debug("Init File watcher with file: " - + file.getAbsolutePath()); - } + @Override + public int compareTo(Delayed o) { + return new Long(this.getDelay(TimeUnit.NANOSECONDS)).compareTo(o + .getDelay(TimeUnit.NANOSECONDS)); } - } - - @Override - public int compareTo(Delayed o) { - return new Long(this.getDelay(TimeUnit.NANOSECONDS)).compareTo(o - .getDelay(TimeUnit.NANOSECONDS)); - } - - /* - * This must return remaining delay associated with the object! - * (non-Javadoc) - * - * @see java.util.concurrent.Delayed#getDelay(java.util.concurrent.TimeUnit) - */ - @Override - public long getDelay(final TimeUnit unit) { - long idleTime = System.nanoTime() - lastAccessTime; - long delayVal = (delay == 0 ? defaultDelay : delay); - return unit.convert(delayVal - idleTime, TimeUnit.NANOSECONDS); - } - - void setDelay(long delay, TimeUnit unit) { - assert delay > 0; - this.delay = TimeUnit.NANOSECONDS.convert(delay, unit); - assert delay < defaultDelay; - } - - long getDelayValue(TimeUnit unit) { - return (delay == 0 ? unit.convert(defaultDelay, TimeUnit.NANOSECONDS) - : unit.convert(delay, TimeUnit.NANOSECONDS)); - } - - public void disconnect() { - synchronized (this) { - if (watcher != null) { - watcher.disconnect(); - watcher = null; - } + + /* + * This must return remaining delay associated with the object! + * (non-Javadoc) + * + * @see java.util.concurrent.Delayed#getDelay(java.util.concurrent.TimeUnit) + */ + @Override + public long getDelay(final TimeUnit unit) { + long idleTime = System.nanoTime() - lastAccessTime; + long delayVal = (delay == 0 ? defaultDelay : delay); + return unit.convert(delayVal - idleTime, TimeUnit.NANOSECONDS); } - } - - boolean disconnected() { - return watcher == null; - } - - @Override - public String toString() { - String value = "File: " + this.file.getAbsolutePath() + "\n"; - value += "Delay (s): " + getDelayValue(TimeUnit.SECONDS) + "\n"; - long exp = getDelay(TimeUnit.MILLISECONDS); - if (exp > 0) { - value += "Expire in (ms): " + exp + "\n"; - } else { - value += "This object has expired" + "\n"; + + void setDelay(long delay, TimeUnit unit) { + assert delay > 0; + this.delay = TimeUnit.NANOSECONDS.convert(delay, unit); + assert delay < defaultDelay; } - value += "ChunkSize " + this.chunkSize + "\n"; - return value; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; + + long getDelayValue(TimeUnit unit) { + return (delay == 0 + ? unit.convert(defaultDelay, TimeUnit.NANOSECONDS) + : unit.convert(delay, TimeUnit.NANOSECONDS)); + } + + public void disconnect() { + synchronized (this) { + if (watcher != null) { + watcher.disconnect(); + watcher = null; + } + } } - if (!(obj instanceof FilePuller)) { - return false; + + boolean disconnected() { + return watcher == null; + } + + @Override + public String toString() { + String value = "File: " + this.file.getAbsolutePath() + "\n"; + value += "Delay (s): " + getDelayValue(TimeUnit.SECONDS) + "\n"; + long exp = getDelay(TimeUnit.MILLISECONDS); + if (exp > 0) { + value += "Expire in (ms): " + exp + "\n"; + } else { + value += "This object has expired" + "\n"; + } + value += "ChunkSize " + this.chunkSize + "\n"; + return value; } - FilePuller fp = (FilePuller) obj; - if (!this.file.equals(fp.file)) { - return false; + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (!(obj instanceof FilePuller)) { + return false; + } + FilePuller fp = (FilePuller) obj; + if (!this.file.equals(fp.file)) { + return false; + } + // Other fields does not matter + return true; + } + + @Override + public int hashCode() { + return this.file.hashCode(); + } + + public byte getProgress() throws IOException { + initPull(); + return watcher.getProgress(); } - // Other fields does not matter - return true; - } - - @Override - public int hashCode() { - return this.file.hashCode(); - } - - public byte getProgress() throws IOException { - initPull(); - return watcher.getProgress(); - } } diff --git a/engine/compbio/engine/PulledFileCache.java b/engine/compbio/engine/PulledFileCache.java index 50a75c2..8e464c6 100644 --- a/engine/compbio/engine/PulledFileCache.java +++ b/engine/compbio/engine/PulledFileCache.java @@ -49,7 +49,7 @@ public final class PulledFileCache { * the called to ensure this will not happen! * * @param fpuller - * @return + * @return true if the same filepooler is already in cache */ public static boolean put(final FilePuller fpuller) { sweep(); diff --git a/engine/compbio/engine/client/CommandBuilder.java b/engine/compbio/engine/client/CommandBuilder.java index dae6696..db5992b 100644 --- a/engine/compbio/engine/client/CommandBuilder.java +++ b/engine/compbio/engine/client/CommandBuilder.java @@ -116,9 +116,10 @@ public class CommandBuilder { } boolean setParam(Parameter param) { - boolean overriden= paramList.put(param.name, param) != null; - if(overriden) { - log.warn("Key " + param.name + " in the command list has been overriden! "); + boolean overriden = paramList.put(param.name, param) != null; + if (overriden) { + log.warn("Key " + param.name + + " in the command list has been overriden! "); } return overriden; } @@ -137,10 +138,9 @@ public class CommandBuilder { // paramValue! // e.g. paramName could be a path to the file with spaces if (paramValue != null && paramName.contains(nameValueSeparator)) { - log - .warn("WARN: paramName " - + paramName - + " contains nameValue separator. Removing the separator..."); + log.warn("WARN: paramName " + + paramName + + " contains nameValue separator. Removing the separator..."); paramName = paramName.trim().substring(0, paramName.length() - 1); } if (paramValue != null && paramName.contains(nameValueSeparator)) { @@ -163,7 +163,7 @@ public class CommandBuilder { } public boolean setParam(String paramName, String paramValue) { - return setParam( new Parameter(paramName, paramValue)); + return setParam(new Parameter(paramName, paramValue)); } public List getCommands() { @@ -198,7 +198,7 @@ public class CommandBuilder { * is that it accepts a List of Options as an input * * @param arguments - * @return + * @return the instance of the CommandBuilder */ public static CommandBuilder newCommandBuilder( List> arguments, String nameValueSeparator) { @@ -216,7 +216,7 @@ public class CommandBuilder { } boolean isWhiteSpaceSeparator() { - return nameValueSeparator.trim().length()==0; + return nameValueSeparator.trim().length() == 0; } List getCommandList() { diff --git a/engine/compbio/engine/client/ConfExecutable.java b/engine/compbio/engine/client/ConfExecutable.java index 23d0793..14c023f 100644 --- a/engine/compbio/engine/client/ConfExecutable.java +++ b/engine/compbio/engine/client/ConfExecutable.java @@ -249,7 +249,7 @@ public class ConfExecutable implements ConfiguredExecutable { * * @param * @param clazz - * @return + * @return LimitsManager instance * @throws IOException */ public static LimitsManager getRunnerLimits(Class clazz) diff --git a/engine/compbio/engine/client/PathValidator.java b/engine/compbio/engine/client/PathValidator.java index 92c5999..a10d82e 100644 --- a/engine/compbio/engine/client/PathValidator.java +++ b/engine/compbio/engine/client/PathValidator.java @@ -82,7 +82,7 @@ public final class PathValidator { * Whether a certain path is absolute or not is operation system dependent! * * @param path - * @return + * @return true is the path is absolute, false otherwise */ public static boolean isAbsolutePath(String path) { assert path != null : "Path is NULL! Not NULL path expected"; diff --git a/engine/compbio/engine/client/PipedExecutable.java b/engine/compbio/engine/client/PipedExecutable.java index a460062..058cc9c 100644 --- a/engine/compbio/engine/client/PipedExecutable.java +++ b/engine/compbio/engine/client/PipedExecutable.java @@ -25,7 +25,7 @@ package compbio.engine.client; * handling * * @author pvtroshin - * @date October 2009 + * @version 1.0 October 2009 * @param */ public interface PipedExecutable extends Executable { diff --git a/engine/compbio/engine/client/Util.java b/engine/compbio/engine/client/Util.java index 634112f..aff3ca5 100644 --- a/engine/compbio/engine/client/Util.java +++ b/engine/compbio/engine/client/Util.java @@ -272,7 +272,7 @@ public final class Util { /** * Returns the absolute path to the Java executable from JAVA_HOME * - * @return + * @return returns the absolute path to the Java executable from JAVA_HOME */ public static String getJava() { String javahome = System.getProperty("java.home"); diff --git a/engine/compbio/engine/cluster/drmaa/AsyncJobRunner.java b/engine/compbio/engine/cluster/drmaa/AsyncJobRunner.java index 46debcc..940c4ad 100644 --- a/engine/compbio/engine/cluster/drmaa/AsyncJobRunner.java +++ b/engine/compbio/engine/cluster/drmaa/AsyncJobRunner.java @@ -33,11 +33,11 @@ import compbio.metadata.ResultNotAvailableException; * Single cluster job runner class * * @author pvtroshin - * @date August 2009 + * @version 1.0 August 2009 * - * TODO after call to submitJob() no setters really work as the job - * template gets deleted, this needs to be taken into account in this - * class design! + * TODO after call to submitJob() no setters really work as the job + * template gets deleted, this needs to be taken into account in this + * class design! */ public class AsyncJobRunner implements AsyncExecutor { diff --git a/engine/compbio/engine/cluster/drmaa/ClusterSession.java b/engine/compbio/engine/cluster/drmaa/ClusterSession.java index e8b17b9..ca2f531 100644 --- a/engine/compbio/engine/cluster/drmaa/ClusterSession.java +++ b/engine/compbio/engine/cluster/drmaa/ClusterSession.java @@ -207,8 +207,9 @@ public final class ClusterSession { // Once the job has been waited for it will be finished // Next time it will not be found in the session, so removed from the // job list - compbio.engine.client.Util.writeStatFile(compbio.engine.Configurator - .getWorkDirectory(jobId), JobStatus.FINISHED.toString()); + compbio.engine.client.Util.writeStatFile( + compbio.engine.Configurator.getWorkDirectory(jobId), + JobStatus.FINISHED.toString()); return status; } @@ -285,46 +286,46 @@ public final class ClusterSession { * in therms of a Sessions, not a JobStatus Should only be used for testing! * * @param status - * @return + * @return job status * @throws DrmaaException */ @Deprecated public static String getJobStatus(final int status) throws DrmaaException { String statusString = null; switch (status) { - case Session.UNDETERMINED: - statusString = "Job status cannot be determined\n"; - break; - case Session.QUEUED_ACTIVE: - statusString = "Job is queued and active\n"; - break; - case Session.SYSTEM_ON_HOLD: - statusString = "Job is queued and in system hold\n"; - break; - case Session.USER_ON_HOLD: - statusString = "Job is queued and in user hold\n"; - break; - case Session.USER_SYSTEM_ON_HOLD: - statusString = "Job is queued and in user and system hold\n"; - break; - case Session.RUNNING: - statusString = "Job is running\n"; - break; - case Session.SYSTEM_SUSPENDED: - statusString = "Job is system suspended\n"; - break; - case Session.USER_SUSPENDED: - statusString = "Job is user suspended\n"; - break; - case Session.USER_SYSTEM_SUSPENDED: - statusString = "Job is user and system suspended\n"; - break; - case Session.DONE: - statusString = "Job finished normally\n"; - break; - case Session.FAILED: - statusString = "Job finished, but failed\n"; - break; + case Session.UNDETERMINED : + statusString = "Job status cannot be determined\n"; + break; + case Session.QUEUED_ACTIVE : + statusString = "Job is queued and active\n"; + break; + case Session.SYSTEM_ON_HOLD : + statusString = "Job is queued and in system hold\n"; + break; + case Session.USER_ON_HOLD : + statusString = "Job is queued and in user hold\n"; + break; + case Session.USER_SYSTEM_ON_HOLD : + statusString = "Job is queued and in user and system hold\n"; + break; + case Session.RUNNING : + statusString = "Job is running\n"; + break; + case Session.SYSTEM_SUSPENDED : + statusString = "Job is system suspended\n"; + break; + case Session.USER_SUSPENDED : + statusString = "Job is user suspended\n"; + break; + case Session.USER_SYSTEM_SUSPENDED : + statusString = "Job is user and system suspended\n"; + break; + case Session.DONE : + statusString = "Job finished normally\n"; + break; + case Session.FAILED : + statusString = "Job finished, but failed\n"; + break; } return statusString; } diff --git a/engine/compbio/engine/cluster/drmaa/_DrmaaExample.java b/engine/compbio/engine/cluster/drmaa/_DrmaaExample.java index 0e8b4ba..dbb312f 100644 --- a/engine/compbio/engine/cluster/drmaa/_DrmaaExample.java +++ b/engine/compbio/engine/cluster/drmaa/_DrmaaExample.java @@ -29,7 +29,7 @@ import org.ggf.drmaa.JobTemplate; import org.ggf.drmaa.Session; import org.ggf.drmaa.SessionFactory; -public class _DrmaaExample { +class _DrmaaExample { private static int NBULKS = 3; private static int JOB_CHUNK = 8; diff --git a/engine/compbio/engine/cluster/drmaa/_JobStatus.java b/engine/compbio/engine/cluster/drmaa/_JobStatus.java index 8ddaa5f..38b7410 100644 --- a/engine/compbio/engine/cluster/drmaa/_JobStatus.java +++ b/engine/compbio/engine/cluster/drmaa/_JobStatus.java @@ -22,10 +22,8 @@ import org.ggf.drmaa.Session; import org.ggf.drmaa.SessionFactory; import org.ggf.drmaa.Version; -public class _JobStatus { +class _JobStatus { - - public static void main(String[] args) { SessionFactory factory = SessionFactory.getFactory(); diff --git a/engine/compbio/engine/cluster/dundee/_Queue.java b/engine/compbio/engine/cluster/dundee/_Queue.java index c0fbb0b..3ee2e0a 100644 --- a/engine/compbio/engine/cluster/dundee/_Queue.java +++ b/engine/compbio/engine/cluster/dundee/_Queue.java @@ -16,37 +16,37 @@ * must include this copyright and license notice. */ package compbio.engine.cluster.dundee; -import static compbio.engine.cluster.dundee._QueueConstraints.*; +import static compbio.engine.cluster.dundee._QueueConstraints.FIRST_MEMORY_LIMIT; +import static compbio.engine.cluster.dundee._QueueConstraints.LONG_TIME_LIMIT; +import static compbio.engine.cluster.dundee._QueueConstraints.MAX_MEMORY_LIMIT; +import static compbio.engine.cluster.dundee._QueueConstraints.SHORT_TIME_LIMIT; +@Deprecated public enum _Queue { /* - * devel.q 4Gb or 16Gb 8 hour I - 64bit-pri.q 4Gb or 16Gb 24 hours B - 64bit.q 4Gb or 16Gb None B - bigint.q 32Gb 8 h I - bigmem.q 32Gb None B + * devel.q 4Gb or 16Gb 8 hour I 64bit-pri.q 4Gb or 16Gb 24 hours B 64bit.q + * 4Gb or 16Gb None B bigint.q 32Gb 8 h I bigmem.q 32Gb None B */ /** * Order of the constraint reflect the priority of the queue */ - DEVEL(FIRST_MEMORY_LIMIT, SHORT_TIME_LIMIT,"devel.q"), - PRIBIT64(FIRST_MEMORY_LIMIT,LONG_TIME_LIMIT,"64bit-pri.q"), - BIT64(FIRST_MEMORY_LIMIT,0,"64bit.q"), - BIGINT(MAX_MEMORY_LIMIT,SHORT_TIME_LIMIT,"bigint.q"), - BIGMEM(MAX_MEMORY_LIMIT,0,"bigmem.q"); - - + DEVEL(FIRST_MEMORY_LIMIT, SHORT_TIME_LIMIT, "devel.q"), PRIBIT64( + FIRST_MEMORY_LIMIT, LONG_TIME_LIMIT, "64bit-pri.q"), BIT64( + FIRST_MEMORY_LIMIT, 0, "64bit.q"), BIGINT(MAX_MEMORY_LIMIT, + SHORT_TIME_LIMIT, "bigint.q"), BIGMEM(MAX_MEMORY_LIMIT, 0, + "bigmem.q"); + int maxMemory; int maxRuntime; String qname; private _Queue(int maxMemory, int maxRuntime, String qname) { - this.maxMemory=maxMemory; - this.maxRuntime=maxRuntime; - this.qname = qname; + this.maxMemory = maxMemory; + this.maxRuntime = maxRuntime; + this.qname = qname; } - + // -q 64bit.q -l qname=64bit.q -l h_vmem=8000M -l ram=8000M @Override public String toString() { @@ -55,92 +55,98 @@ public enum _Queue { /** * 0 - unlimited + * * @return max runtime in hours */ - public int getTimeLimit() { + public int getTimeLimit() { return this.maxRuntime; } - + /** * - * @return true if the queue has time limit, false overwise + * @return true if the queue has time limit, false overwise */ - public boolean hasTimeLimit() { - return this.maxRuntime != 0; + public boolean hasTimeLimit() { + return this.maxRuntime != 0; } /** * return max memory limit in Mb + * * @return */ - public int getMemoryLimit() { + public int getMemoryLimit() { return this.maxMemory; } - - public static _Queue getQueueByMemoryRequirements(int maxMemory) { - if(maxMemory>FIRST_MEMORY_LIMIT) { + + public static _Queue getQueueByMemoryRequirements(int maxMemory) { + if (maxMemory > FIRST_MEMORY_LIMIT) { return BIGMEM; - } else if(maxMemory 8 - if(timeLimitInHours <= LONG_TIME_LIMIT && maxMemory <=FIRST_MEMORY_LIMIT) { - return PRIBIT64; - } else if( maxMemory<= MAX_MEMORY_LIMIT){ + if (timeLimitInHours <= LONG_TIME_LIMIT + && maxMemory <= FIRST_MEMORY_LIMIT) { + return PRIBIT64; + } else if (maxMemory <= MAX_MEMORY_LIMIT) { return BIGMEM; - } else { - throw new UnsupportedOperationException("Cluster does not support tasks requiring more than 30000M of memory"); + } else { + throw new UnsupportedOperationException( + "Cluster does not support tasks requiring more than 30000M of memory"); } } } } - - public _Queue getQueue(String queueName) { - switch(this) { - case DEVEL: - if ( queueName.equals(DEVEL.toString())) { - return DEVEL; - } - break; - case PRIBIT64: - if ( queueName.equals(PRIBIT64.toString())) { - return PRIBIT64; - } - break; - case BIT64: - if ( queueName.equals(BIT64.toString())) { - return BIT64; - } - break; - case BIGMEM: - if ( queueName.equals(BIGMEM.toString())) { - return BIGMEM; - } - break; - case BIGINT: - if ( queueName.equals(BIGINT.toString())) { - return BIGINT; - } - break; + + public _Queue getQueue(String queueName) { + switch (this) { + case DEVEL : + if (queueName.equals(DEVEL.toString())) { + return DEVEL; + } + break; + case PRIBIT64 : + if (queueName.equals(PRIBIT64.toString())) { + return PRIBIT64; + } + break; + case BIT64 : + if (queueName.equals(BIT64.toString())) { + return BIT64; + } + break; + case BIGMEM : + if (queueName.equals(BIGMEM.toString())) { + return BIGMEM; + } + break; + case BIGINT : + if (queueName.equals(BIGINT.toString())) { + return BIGINT; + } + break; } // such queue appears to be not defined in the system! - return null; + return null; } } diff --git a/engine/compbio/engine/cluster/dundee/_QueueConstraints.java b/engine/compbio/engine/cluster/dundee/_QueueConstraints.java index 2f69728..637136f 100644 --- a/engine/compbio/engine/cluster/dundee/_QueueConstraints.java +++ b/engine/compbio/engine/cluster/dundee/_QueueConstraints.java @@ -17,14 +17,15 @@ */ package compbio.engine.cluster.dundee; -public final class _QueueConstraints { +@Deprecated +final class _QueueConstraints { - private _QueueConstraints() {} + private _QueueConstraints() { + } public static final int SHORT_TIME_LIMIT = 8; - public static final int LONG_TIME_LIMIT = 24; + public static final int LONG_TIME_LIMIT = 24; public static final int FIRST_MEMORY_LIMIT = 14000; - public static final int MAX_MEMORY_LIMIT = 30000; - + public static final int MAX_MEMORY_LIMIT = 30000; } diff --git a/engine/compbio/engine/conf/PropertyHelperManager.java b/engine/compbio/engine/conf/PropertyHelperManager.java index 939e5fe..fb35362 100644 --- a/engine/compbio/engine/conf/PropertyHelperManager.java +++ b/engine/compbio/engine/conf/PropertyHelperManager.java @@ -23,8 +23,6 @@ import java.io.IOException; import java.net.URISyntaxException; import java.net.URL; -import javax.naming.ConfigurationException; - import org.apache.log4j.Logger; import compbio.util.PropertyHelper; @@ -52,7 +50,7 @@ public final class PropertyHelperManager { * * Try 1 - succeed. * - * @return + * @return an instance */ public static PropertyHelper getPropertyHelper() { if (ph == null) { @@ -91,8 +89,9 @@ public final class PropertyHelperManager { * binaries WEB-INF classes compbio engine conf If the structure changes it * must be reflected in this method * - * @return - * @throws ConfigurationException + * @return the local path + * @throws RuntimeException + * if cannot determine the local path */ public static String getLocalPath() { String clname = PropertyHelperManager.class.getSimpleName(); diff --git a/engine/compbio/engine/conf/RunnerConfigMarshaller.java b/engine/compbio/engine/conf/RunnerConfigMarshaller.java index 570b43c..4fbd3a0 100644 --- a/engine/compbio/engine/conf/RunnerConfigMarshaller.java +++ b/engine/compbio/engine/conf/RunnerConfigMarshaller.java @@ -60,8 +60,8 @@ public class RunnerConfigMarshaller { throws JAXBException { if (classes != null) { - List> classesList = new ArrayList>(Arrays - .asList(classes)); + List> classesList = new ArrayList>( + Arrays.asList(classes)); classesList.add(rootClass); ctx = JAXBContext.newInstance(classesList.toArray(new Class[0])); } else { @@ -109,7 +109,7 @@ public class RunnerConfigMarshaller { /** * - * @return + * @return validator instance * @throws SAXException */ public static Validator getValidator(String schemafile) throws SAXException { @@ -182,8 +182,8 @@ public class RunnerConfigMarshaller { } JAXBContext ctx = null; if (classes != null) { - List> classesList = new ArrayList>(Arrays - .asList(classes)); + List> classesList = new ArrayList>( + Arrays.asList(classes)); classesList.add(resultElemType); ctx = JAXBContext.newInstance(classesList.toArray(new Class[0])); } else { diff --git a/engine/compbio/engine/conf/_Key.java b/engine/compbio/engine/conf/_Key.java index 67343c7..a40abf3 100644 --- a/engine/compbio/engine/conf/_Key.java +++ b/engine/compbio/engine/conf/_Key.java @@ -22,6 +22,7 @@ import javax.management.openmbean.InvalidKeyException; import compbio.util.Util; +@Deprecated public final class _Key { public final static String DELIM = "#"; diff --git a/engine/compbio/engine/local/AsyncLocalRunner.java b/engine/compbio/engine/local/AsyncLocalRunner.java index cfc2916..d269aad 100644 --- a/engine/compbio/engine/local/AsyncLocalRunner.java +++ b/engine/compbio/engine/local/AsyncLocalRunner.java @@ -47,10 +47,9 @@ public final class AsyncLocalRunner implements AsyncExecutor { .getTask(jobId); // The job has already finished or cancelled. if (future == null) { - log - .debug("Did not find future for local job " - + jobId - + " will not cancel it. Perhaps it has finished or cancelled already."); + log.debug("Did not find future for local job " + + jobId + + " will not cancel it. Perhaps it has finished or cancelled already."); return false; } LocalEngineUtil.cancelJob(future, getWorkDirectory(jobId)); @@ -88,7 +87,7 @@ public final class AsyncLocalRunner implements AsyncExecutor { /** * * @param jobId - * @return + * @return true if all files were removed, false otherwise */ @Override public boolean cleanup(String jobId) { diff --git a/engine/compbio/engine/local/LocalExecutorService.java b/engine/compbio/engine/local/LocalExecutorService.java index 04a0bd5..cbed001 100644 --- a/engine/compbio/engine/local/LocalExecutorService.java +++ b/engine/compbio/engine/local/LocalExecutorService.java @@ -50,7 +50,7 @@ public final class LocalExecutorService extends ThreadPoolExecutor { * This method returns the single instance of CachedThreadPoolExecutor which * it cashes internally * - * @return + * @return the instance */ public synchronized static LocalExecutorService getExecutor() { if (INSTANCE == null) { diff --git a/engine/compbio/engine/local/_TrackingExecutor.java b/engine/compbio/engine/local/_TrackingExecutor.java index 5204049..ac0f848 100644 --- a/engine/compbio/engine/local/_TrackingExecutor.java +++ b/engine/compbio/engine/local/_TrackingExecutor.java @@ -37,9 +37,11 @@ import java.util.concurrent.TimeUnit; * TODO it may be better to persists task from different place * * @author pvtroshin - * @Date October 2009 + * @version 1.0 October 2009 + * @deprecated */ -public class _TrackingExecutor extends AbstractExecutorService { +@Deprecated +class _TrackingExecutor extends AbstractExecutorService { private final ExecutorService executor; diff --git a/runner/compbio/runner/_NativeSpecHelper.java b/runner/compbio/runner/_NativeSpecHelper.java index 6f4125f..57ec660 100644 --- a/runner/compbio/runner/_NativeSpecHelper.java +++ b/runner/compbio/runner/_NativeSpecHelper.java @@ -21,6 +21,7 @@ import java.net.UnknownServiceException; import compbio.engine.cluster.dundee._Queue; +@Deprecated public class _NativeSpecHelper { int maxCalculationTime; diff --git a/runner/compbio/runner/_SkeletalCommandBuilder.java b/runner/compbio/runner/_SkeletalCommandBuilder.java index c8f1373..3767ffb 100644 --- a/runner/compbio/runner/_SkeletalCommandBuilder.java +++ b/runner/compbio/runner/_SkeletalCommandBuilder.java @@ -27,8 +27,10 @@ import compbio.engine.client.RunConfiguration; import compbio.metadata.Limit; import compbio.metadata.LimitsManager; -public abstract class _SkeletalCommandBuilder implements - Executable<_SkeletalCommandBuilder> { +@Deprecated +public abstract class _SkeletalCommandBuilder + implements + Executable<_SkeletalCommandBuilder> { String tmpDirectory; String name; @@ -109,11 +111,11 @@ public abstract class _SkeletalCommandBuilder implements // TODO Auto-generated method stub return null; } - + @Override public String getClusterJobSettings() { // TODO Auto-generated method stub - return null; + return null; } } diff --git a/runner/compbio/runner/msa/Muscle.java b/runner/compbio/runner/msa/Muscle.java index e627462..54c7732 100644 --- a/runner/compbio/runner/msa/Muscle.java +++ b/runner/compbio/runner/msa/Muscle.java @@ -50,7 +50,6 @@ public class Muscle extends SkeletalExecutable { * * -clwstrict - write output in clustal format * - * @param workDirectory */ public Muscle() { /* diff --git a/runner/compbio/runner/msa/Probcons.java b/runner/compbio/runner/msa/Probcons.java index 3d0f86a..532ba30 100644 --- a/runner/compbio/runner/msa/Probcons.java +++ b/runner/compbio/runner/msa/Probcons.java @@ -43,8 +43,6 @@ public class Probcons extends SkeletalExecutable public static final String KEY_VALUE_SEPARATOR = Util.SPACE; /** - * - * @param workDirectory */ public Probcons() { addParameters(Arrays.asList("-v", "-clustalw", "-annot", ANNOTATION)); diff --git a/runner/compbio/runner/msa/Tcoffee.java b/runner/compbio/runner/msa/Tcoffee.java index 0c76d21..645b994 100644 --- a/runner/compbio/runner/msa/Tcoffee.java +++ b/runner/compbio/runner/msa/Tcoffee.java @@ -37,7 +37,8 @@ import compbio.runner.Util; import compbio.util.PropertyHelper; public class Tcoffee extends SkeletalExecutable - implements PipedExecutable { + implements + PipedExecutable { private static Logger log = Logger.getLogger(Tcoffee.class); @@ -58,8 +59,6 @@ public class Tcoffee extends SkeletalExecutable private final static String ncorePrm = "-n_core"; /** - * - * @param workDirectory */ public Tcoffee() { super(KEY_VALUE_SEPARATOR); @@ -128,12 +127,11 @@ public class Tcoffee extends SkeletalExecutable int cpunum = SkeletalExecutable.getClusterCpuNum(getType()); if (cpunum != 0) { setNCore(cpunum); - } + } } return super.getParameters(provider); } - @SuppressWarnings("unchecked") @Override public Class getType() { diff --git a/webservices/compbio/data/msa/RegistryWS.java b/webservices/compbio/data/msa/RegistryWS.java index e06d58e..faaea67 100644 --- a/webservices/compbio/data/msa/RegistryWS.java +++ b/webservices/compbio/data/msa/RegistryWS.java @@ -49,7 +49,7 @@ public interface RegistryWS extends JABAService { * tested or tested less then a one second ago. * * @param service - * @return + * @return when last time tested */ int getLastTested(Services service); /** diff --git a/webservices/compbio/ws/server/GenericMetadataService.java b/webservices/compbio/ws/server/GenericMetadataService.java index 61d9393..c094283 100644 --- a/webservices/compbio/ws/server/GenericMetadataService.java +++ b/webservices/compbio/ws/server/GenericMetadataService.java @@ -113,7 +113,7 @@ public abstract class GenericMetadataService { * * @param jobId * @param position - * @return + * @return ChunkHolder */ public ChunkHolder pullExecStatistics(String jobId, long position) { // Execution stat is not supported diff --git a/webservices/compbio/ws/server/SimpleWSPublisher.java b/webservices/compbio/ws/server/SimpleWSPublisher.java index 3230317..3e3a34b 100644 --- a/webservices/compbio/ws/server/SimpleWSPublisher.java +++ b/webservices/compbio/ws/server/SimpleWSPublisher.java @@ -28,46 +28,47 @@ import javax.xml.ws.Endpoint; * @author pvtroshin * @date October 2009 */ +@Deprecated public class SimpleWSPublisher { - public SimpleWSPublisher(Object exec, String context) { + public SimpleWSPublisher(Object exec, String context) { - } + } - public static void main(String[] args) { - if (args.length != 2) { - System.out.println("Usage: "); - System.out.println("SimpleWSPublisher context class"); - System.out - .println("where context is a context name, the name after the address by " - + "which web service can be called e.g. Clustal " - + " and class is a web service implementation class"); + public static void main(String[] args) { + if (args.length != 2) { + System.out.println("Usage: "); + System.out.println("SimpleWSPublisher context class"); + System.out + .println("where context is a context name, the name after the address by " + + "which web service can be called e.g. Clustal " + + " and class is a web service implementation class"); + } + String context = args[0]; + String clazzName = args[1]; + try { + Class clazz = Class.forName(clazzName); + if (!clazz.isAnnotationPresent(WebService.class)) { + System.out.println("Can only start web services. " + + "Please check whether the class provided is " + + "annotated with Webservice annotation"); + System.exit(1); + } + Endpoint.publish("http://127.0.0.1:7979/" + context, + clazz.newInstance()); + } catch (InstantiationException e) { + e.printStackTrace(); + System.exit(1); + } catch (IllegalAccessException e) { + e.printStackTrace(); + System.exit(1); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + System.exit(1); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + System.exit(1); + } } - String context = args[0]; - String clazzName = args[1]; - try { - Class clazz = Class.forName(clazzName); - if (!clazz.isAnnotationPresent(WebService.class)) { - System.out.println("Can only start web services. " - + "Please check whether the class provided is " - + "annotated with Webservice annotation"); - System.exit(1); - } - Endpoint.publish("http://127.0.0.1:7979/" + context, clazz - .newInstance()); - } catch (InstantiationException e) { - e.printStackTrace(); - System.exit(1); - } catch (IllegalAccessException e) { - e.printStackTrace(); - System.exit(1); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - System.exit(1); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - System.exit(1); - } - } }