[jboss-svn-commits] JBoss Common SVN: r2892 - common-core/trunk/src/main/java/org/jboss/util/threadpool.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Aug 4 08:19:21 EDT 2008
Author: alesj
Date: 2008-08-04 08:19:20 -0400 (Mon, 04 Aug 2008)
New Revision: 2892
Modified:
common-core/trunk/src/main/java/org/jboss/util/threadpool/BasicThreadPool.java
common-core/trunk/src/main/java/org/jboss/util/threadpool/RunnableTaskWrapper.java
common-core/trunk/src/main/java/org/jboss/util/threadpool/TaskWrapper.java
common-core/trunk/src/main/java/org/jboss/util/threadpool/ThreadPool.java
Log:
javadocs
Modified: common-core/trunk/src/main/java/org/jboss/util/threadpool/BasicThreadPool.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/threadpool/BasicThreadPool.java 2008-07-31 16:03:02 UTC (rev 2891)
+++ common-core/trunk/src/main/java/org/jboss/util/threadpool/BasicThreadPool.java 2008-08-04 12:19:20 UTC (rev 2892)
@@ -185,8 +185,8 @@
wrapper.acceptTask();
long completionTimeout = wrapper.getTaskCompletionTimeout();
- TimeoutInfo info = null;
- if( completionTimeout > 0 )
+ TimeoutInfo info;
+ if(completionTimeout > 0)
{
checkTimeoutMonitor();
// Install the task in the
@@ -275,8 +275,7 @@
public int getMaximumQueueSize()
{
- int maxSize = queue.remainingCapacity() + queue.size();
- return maxSize;
+ return queue.remainingCapacity() + queue.size();
}
/**
@@ -605,8 +604,7 @@
TimeoutInfo ti = (TimeoutInfo) o;
long to0 = timeoutMS;
long to1 = ti.timeoutMS;
- int diff = (int) (to0 - to1);
- return diff;
+ return (int) (to0 - to1);
}
TaskWrapper getTaskWrapper()
{
Modified: common-core/trunk/src/main/java/org/jboss/util/threadpool/RunnableTaskWrapper.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/threadpool/RunnableTaskWrapper.java 2008-07-31 16:03:02 UTC (rev 2891)
+++ common-core/trunk/src/main/java/org/jboss/util/threadpool/RunnableTaskWrapper.java 2008-08-04 12:19:20 UTC (rev 2892)
@@ -134,7 +134,6 @@
{
return started == true && runThread == null;
}
- // Runnable implementation ---------------------------------------
public void run()
{
@@ -155,12 +154,4 @@
log.warn("Unhandled throwable for runnable: " + runnable, t);
}
}
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
}
Modified: common-core/trunk/src/main/java/org/jboss/util/threadpool/TaskWrapper.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/threadpool/TaskWrapper.java 2008-07-31 16:03:02 UTC (rev 2891)
+++ common-core/trunk/src/main/java/org/jboss/util/threadpool/TaskWrapper.java 2008-08-04 12:19:20 UTC (rev 2892)
@@ -29,10 +29,6 @@
*/
public interface TaskWrapper extends Runnable
{
- // Constants -----------------------------------------------------
-
- // Public --------------------------------------------------------
-
/**
* Get the type of wait
*
@@ -84,6 +80,10 @@
*/
void rejectTask(RuntimeException e);
- // Inner classes -------------------------------------------------
+ /**
+ * Is the task complete.
+ *
+ * @return true if compelet, false otherwise
+ */
boolean isComplete();
}
Modified: common-core/trunk/src/main/java/org/jboss/util/threadpool/ThreadPool.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/threadpool/ThreadPool.java 2008-07-31 16:03:02 UTC (rev 2891)
+++ common-core/trunk/src/main/java/org/jboss/util/threadpool/ThreadPool.java 2008-08-04 12:19:20 UTC (rev 2892)
@@ -29,10 +29,6 @@
*/
public interface ThreadPool
{
- // Constants -----------------------------------------------------
-
- // Public --------------------------------------------------------
-
/**
* Stop the pool
*
@@ -40,18 +36,20 @@
*/
public void stop(boolean immediate);
- /** Wait on the queued tasks to complete. This can only be called after
- * after stop.
+ /**
+ * Wait on the queued tasks to complete.
+ * This can only be called after stop.
*
- * @throws InterruptedException
+ * @throws InterruptedException for any iterruption error
*/
public void waitForTasks() throws InterruptedException;
- /** Wait on the queued tasks to complete upto maxWaitTime milliseconds. This
- * can only be called after after stop.
+ /**
+ * Wait on the queued tasks to complete upto maxWaitTime milliseconds.
+ * This can only be called after stop.
*
- * @param maxWaitTime
- * @throws InterruptedException
+ * @param maxWaitTime the max wait time
+ * @throws InterruptedException for any interruption error
*/
public void waitForTasks(long maxWaitTime) throws InterruptedException;
@@ -79,10 +77,12 @@
public void run(Runnable runnable);
/**
+ * Run runnable with start and complete time out set explicitely.
*
- * @param runnable
- * @param startTimeout
- * @param completeTimeout
- */
+ * @param runnable the runnable
+ * @param startTimeout the start timeout
+ * @param completeTimeout the complete timeout
+ * @throws IllegalArgumentException for a null runnable
+ */
public void run(Runnable runnable, long startTimeout, long completeTimeout);
}
More information about the jboss-svn-commits
mailing list