You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by cs...@apache.org on 2011/08/19 14:18:33 UTC
svn commit: r1159608 - in
/camel/trunk/camel-core/src/main/java/org/apache/camel/spi:
ExecutorServiceManager.java ThreadPoolFactory.java ThreadPoolProfile.java
Author: cschneider
Date: Fri Aug 19 12:18:33 2011
New Revision: 1159608
URL: http://svn.apache.org/viewvc?rev=1159608&view=rev
Log:
CAMEL-4244 Add some javadoc and small polishing
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExecutorServiceManager.java
camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ThreadPoolFactory.java
camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ThreadPoolProfile.java
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExecutorServiceManager.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExecutorServiceManager.java?rev=1159608&r1=1159607&r2=1159608&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExecutorServiceManager.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ExecutorServiceManager.java Fri Aug 19 12:18:33 2011
@@ -221,6 +221,14 @@ public interface ExecutorServiceManager
*/
ScheduledExecutorService newSingleThreadScheduledExecutor(Object source, String name);
+ /**
+ * Creates a new scheduled thread pool using a profile
+ *
+ * @param source the source object, usually it should be <tt>this</tt> passed in as parameter
+ * @param name name which is appended to the thread name
+ * @param profile
+ * @return created thread pool
+ */
ScheduledExecutorService newScheduledThreadPool(Object source, String name, ThreadPoolProfile profile);
/**
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ThreadPoolFactory.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ThreadPoolFactory.java?rev=1159608&r1=1159607&r2=1159608&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ThreadPoolFactory.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ThreadPoolFactory.java Fri Aug 19 12:18:33 2011
@@ -41,17 +41,17 @@ public interface ThreadPoolFactory {
/**
* Create a thread pool using the given thread pool profile
*
- * @param profile
- * @param threadFactory
- * @return
+ * @param profile parameters of the thread pool
+ * @param threadFactory factory for creating threads
+ * @return the created thread pool
*/
ExecutorService newThreadPool(ThreadPoolProfile profile, ThreadFactory threadFactory);
/**
* Create a scheduled thread pool using the given thread pool profile
- * @param profile
- * @param threadFactory
- * @return
+ * @param profile parameters of the thread pool
+ * @param threadFactory factory for creating threads
+ * @return the created thread pool
*/
ScheduledExecutorService newScheduledThreadPool(ThreadPoolProfile profile, ThreadFactory threadFactory);
}
\ No newline at end of file
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ThreadPoolProfile.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ThreadPoolProfile.java?rev=1159608&r1=1159607&r2=1159608&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ThreadPoolProfile.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ThreadPoolProfile.java Fri Aug 19 12:18:33 2011
@@ -29,7 +29,7 @@ import org.apache.camel.ThreadPoolReject
*
* @version
*/
-public class ThreadPoolProfile implements Serializable {
+public class ThreadPoolProfile implements Serializable, Cloneable {
// TODO: Camel 2.9/3.0 consider moving to org.apache.camel
@@ -222,29 +222,29 @@ public class ThreadPoolProfile implement
/**
* Overwrites each attribute that is null with the attribute from defaultProfile
*
- * @param defaultProfile2
+ * @param defaultProfile profile with default values
*/
- public void addDefaults(ThreadPoolProfile defaultProfile2) {
- if (defaultProfile2 == null) {
+ public void addDefaults(ThreadPoolProfile defaultProfile) {
+ if (defaultProfile == null) {
return;
}
if (poolSize == null) {
- poolSize = defaultProfile2.getPoolSize();
+ poolSize = defaultProfile.getPoolSize();
}
if (maxPoolSize == null) {
- maxPoolSize = defaultProfile2.getMaxPoolSize();
+ maxPoolSize = defaultProfile.getMaxPoolSize();
}
if (keepAliveTime == null) {
- keepAliveTime = defaultProfile2.getKeepAliveTime();
+ keepAliveTime = defaultProfile.getKeepAliveTime();
}
if (timeUnit == null) {
- timeUnit = defaultProfile2.getTimeUnit();
+ timeUnit = defaultProfile.getTimeUnit();
}
if (maxQueueSize == null) {
- maxQueueSize = defaultProfile2.getMaxQueueSize();
+ maxQueueSize = defaultProfile.getMaxQueueSize();
}
if (rejectedPolicy == null) {
- rejectedPolicy = defaultProfile2.getRejectedPolicy();
+ rejectedPolicy = defaultProfile.getRejectedPolicy();
}
}