camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r643931 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadType.java
Date Wed, 02 Apr 2008 15:13:31 GMT
Author: jstrachan
Date: Wed Apr  2 08:13:21 2008
New Revision: 643931

URL: http://svn.apache.org/viewvc?rev=643931&view=rev
Log:
fixed up the Thread XSD so that the attributes are optional

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadType.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadType.java?rev=643931&r1=643930&r2=643931&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadType.java Wed
Apr  2 08:13:21 2008
@@ -17,7 +17,6 @@
 package org.apache.camel.model;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
@@ -36,29 +35,28 @@
 
 /**
  * Represents an XML <thread/> element
+ *
  * @version $Revision$
  */
 @XmlRootElement(name = "thread")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class ThreadType extends ProcessorType<ProcessorType> {
-
-    @XmlAttribute
-    private int coreSize = 1;
-    @XmlAttribute
-    private boolean daemon = true;
-    @XmlAttribute
-    private long keepAliveTime;
-    @XmlAttribute
-    private int maxSize = 1;
-    @XmlAttribute
+    @XmlAttribute(required = false)
+    private Integer coreSize = 1;
+    @XmlAttribute(required = false)
+    private Boolean daemon = Boolean.TRUE;
+    @XmlAttribute(required = false)
+    private Long keepAliveTime;
+    @XmlAttribute(required = false)
+    private Integer maxSize = 1;
+    @XmlAttribute(required = false)
     private String name = "Thread Processor";
-    @XmlAttribute
-    private int priority = Thread.NORM_PRIORITY;
-    @XmlAttribute
-    private long stackSize;
+    @XmlAttribute(required = false)
+    private Integer priority = Thread.NORM_PRIORITY;
+    @XmlAttribute(required = false)
+    private Long stackSize;
     @XmlElementRef
     private List<ProcessorType<?>> outputs = new ArrayList<ProcessorType<?>>();
-
     @XmlTransient
     private BlockingQueue<Runnable> taskQueue;
     @XmlTransient
@@ -98,13 +96,23 @@
 
         ThreadProcessor thread = new ThreadProcessor();
         thread.setExecutor(executor);
-        thread.setCoreSize(coreSize);
-        thread.setDaemon(daemon);
-        thread.setKeepAliveTime(keepAliveTime);
-        thread.setMaxSize(maxSize);
+        if (coreSize != null) {
+            thread.setCoreSize(coreSize);
+        }
+        if (daemon != null) {
+            thread.setDaemon(daemon);
+        }
+        if (keepAliveTime != null) {
+            thread.setKeepAliveTime(keepAliveTime);
+        }
+        if (maxSize != null) {
+            thread.setMaxSize(maxSize);
+        }
         thread.setName(name);
         thread.setPriority(priority);
-        thread.setStackSize(stackSize);
+        if (stackSize != null) {
+            thread.setStackSize(stackSize);
+        }
         thread.setTaskQueue(taskQueue);
         thread.setThreadGroup(threadGroup);
 



Mime
View raw message