camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1073239 - in /camel/trunk/camel-core/src/main/java/org/apache/camel/model: ./ config/ dataformat/ loadbalancer/
Date Tue, 22 Feb 2011 08:00:33 GMT
Author: davsclaus
Date: Tue Feb 22 08:00:32 2011
New Revision: 1073239

URL: http://svn.apache.org/viewvc?rev=1073239&view=rev
Log:
CAMEL-3692: Fixed Boolean getter/setter being java bean spec compliant. Make it easier to
use introspection in toolling etc.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnCompletionDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/RollbackDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadPoolProfileDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/WireTapDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/config/BatchResequencerConfig.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CastorDataFormat.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XMLSecurityDataFormat.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/FailoverLoadBalancerDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/WeightedLoadBalancerDefinition.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java Tue
Feb 22 08:00:32 2011
@@ -193,19 +193,19 @@ public class AggregateDefinition extends
         if (getCompletionSize() != null) {
             answer.setCompletionSize(getCompletionSize());
         }
-        if (isCompletionFromBatchConsumer() != null) {
+        if (getCompletionFromBatchConsumer() != null) {
             answer.setCompletionFromBatchConsumer(isCompletionFromBatchConsumer());
         }
-        if (isEagerCheckCompletion() != null) {
+        if (getEagerCheckCompletion() != null) {
             answer.setEagerCheckCompletion(isEagerCheckCompletion());
         }
-        if (isIgnoreInvalidCorrelationKeys() != null) {
+        if (getIgnoreInvalidCorrelationKeys() != null) {
             answer.setIgnoreInvalidCorrelationKeys(isIgnoreInvalidCorrelationKeys());
         }
         if (getCloseCorrelationKeyOnCompletion() != null) {
             answer.setCloseCorrelationKeyOnCompletion(getCloseCorrelationKeyOnCompletion());
         }
-        if (isDiscardOnCompletionTimeout() != null) {
+        if (getDiscardOnCompletionTimeout() != null) {
             answer.setDiscardOnCompletionTimeout(isDiscardOnCompletionTimeout());
         }
 
@@ -307,18 +307,26 @@ public class AggregateDefinition extends
         this.completionSizeExpression = completionSizeExpression;
     }
 
-    public Boolean isGroupExchanges() {
+    public Boolean getGroupExchanges() {
         return groupExchanges;
     }
 
+    public boolean isGroupExchanges() {
+        return groupExchanges != null && groupExchanges;
+    }
+
     public void setGroupExchanges(Boolean groupExchanges) {
         this.groupExchanges = groupExchanges;
     }
 
-    public Boolean isCompletionFromBatchConsumer() {
+    public Boolean getCompletionFromBatchConsumer() {
         return completionFromBatchConsumer;
     }
 
+    public boolean isCompletionFromBatchConsumer() {
+        return completionFromBatchConsumer != null && completionFromBatchConsumer;
+    }
+
     public void setCompletionFromBatchConsumer(Boolean completionFromBatchConsumer) {
         this.completionFromBatchConsumer = completionFromBatchConsumer;
     }
@@ -331,6 +339,10 @@ public class AggregateDefinition extends
         this.executorService = executorService;
     }
 
+    public Boolean getParallelProcessing() {
+        return parallelProcessing;
+    }
+
     public boolean isParallelProcessing() {
         return parallelProcessing != null && parallelProcessing;
     }
@@ -355,18 +367,26 @@ public class AggregateDefinition extends
         this.strategyRef = strategyRef;
     }
 
-    public Boolean isEagerCheckCompletion() {
+    public Boolean getEagerCheckCompletion() {
         return eagerCheckCompletion;
     }
 
+    public boolean isEagerCheckCompletion() {
+        return eagerCheckCompletion != null && eagerCheckCompletion;
+    }
+
     public void setEagerCheckCompletion(Boolean eagerCheckCompletion) {
         this.eagerCheckCompletion = eagerCheckCompletion;
     }
 
-    public Boolean isIgnoreInvalidCorrelationKeys() {
+    public Boolean getIgnoreInvalidCorrelationKeys() {
         return ignoreInvalidCorrelationKeys;
     }
 
+    public boolean isIgnoreInvalidCorrelationKeys() {
+        return ignoreInvalidCorrelationKeys != null && ignoreInvalidCorrelationKeys;
+    }
+
     public void setIgnoreInvalidCorrelationKeys(Boolean ignoreInvalidCorrelationKeys) {
         this.ignoreInvalidCorrelationKeys = ignoreInvalidCorrelationKeys;
     }
@@ -395,10 +415,14 @@ public class AggregateDefinition extends
         this.aggregationRepositoryRef = aggregationRepositoryRef;
     }
 
-    public Boolean isDiscardOnCompletionTimeout() {
+    public Boolean getDiscardOnCompletionTimeout() {
         return discardOnCompletionTimeout;
     }
 
+    public boolean isDiscardOnCompletionTimeout() {
+        return discardOnCompletionTimeout != null && discardOnCompletionTimeout;
+    }
+
     public void setDiscardOnCompletionTimeout(Boolean discardOnCompletionTimeout) {
         this.discardOnCompletionTimeout = discardOnCompletionTimeout;
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerDefinition.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerDefinition.java
Tue Feb 22 08:00:32 2011
@@ -124,7 +124,7 @@ public class IdempotentConsumerDefinitio
         this.idempotentRepository = idempotentRepository;
     }
 
-    public Boolean isEager() {
+    public Boolean getEager() {
         return eager;
     }
 
@@ -132,6 +132,11 @@ public class IdempotentConsumerDefinitio
         this.eager = eager;
     }
 
+    public boolean isEager() {
+        // defaults to true if not configured
+        return eager != null ? eager : true;
+    }
+
     @Override
     @SuppressWarnings("unchecked")
     public Processor createProcessor(RouteContext routeContext) throws Exception {
@@ -145,10 +150,8 @@ public class IdempotentConsumerDefinitio
         routeContext.getCamelContext().addService(idempotentRepository);
 
         Expression expression = getExpression().createExpression(routeContext);
-        // should be eager by default
-        boolean isEager = isEager() != null ? isEager() : true;
 
-        return new IdempotentConsumer(expression, idempotentRepository, isEager, childProcessor);
+        return new IdempotentConsumer(expression, idempotentRepository, isEager(), childProcessor);
     }
 
     /**

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java Tue
Feb 22 08:00:32 2011
@@ -186,30 +186,42 @@ public class MulticastDefinition extends
         return this;
     }
 
-    public boolean isParallelProcessing() {
-        return parallelProcessing != null ? parallelProcessing : false;
+    public Boolean getParallelProcessing() {
+        return parallelProcessing;
     }
 
-    public void setParallelProcessing(boolean parallelProcessing) {
-        this.parallelProcessing = parallelProcessing;        
+    public void setParallelProcessing(Boolean parallelProcessing) {
+        this.parallelProcessing = parallelProcessing;
     }
 
-    public boolean isStreaming() {
-        return streaming != null ? streaming : false;
+    public boolean isParallelProcessing() {
+        return parallelProcessing != null && parallelProcessing;
     }
 
-    public void setStreaming(boolean streaming) {
+    public Boolean getStreaming() {
+        return streaming;
+    }
+
+    public void setStreaming(Boolean streaming) {
         this.streaming = streaming;
     }
 
-    public Boolean isStopOnException() {
-        return stopOnException != null ? stopOnException : false;
+    public boolean isStreaming() {
+        return streaming != null && streaming;
+    }
+
+    public Boolean getStopOnException() {
+        return stopOnException;
     }
 
     public void setStopOnException(Boolean stopOnException) {
         this.stopOnException = stopOnException;
     }
 
+    public Boolean isStopOnException() {
+        return stopOnException != null && stopOnException;
+    }
+
     public ExecutorService getExecutorService() {
         return executorService;
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnCompletionDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnCompletionDefinition.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnCompletionDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnCompletionDefinition.java
Tue Feb 22 08:00:32 2011
@@ -225,10 +225,6 @@ public class OnCompletionDefinition exte
         this.outputs = outputs;
     }
 
-    public boolean isOnCompleteOnly() {
-        return onCompleteOnly != null && onCompleteOnly.booleanValue();
-    }
-
     public Boolean getOnCompleteOnly() {
         return onCompleteOnly;
     }
@@ -237,8 +233,8 @@ public class OnCompletionDefinition exte
         this.onCompleteOnly = onCompleteOnly;
     }
 
-    public boolean isOnFailureOnly() {
-        return onFailureOnly != null && onFailureOnly.booleanValue();
+    public boolean isOnCompleteOnly() {
+        return onCompleteOnly != null && onCompleteOnly;
     }
 
     public Boolean getOnFailureOnly() {
@@ -249,6 +245,10 @@ public class OnCompletionDefinition exte
         this.onFailureOnly = onFailureOnly;
     }
 
+    public boolean isOnFailureOnly() {
+        return onFailureOnly != null && onFailureOnly;
+    }
+
     public WhenDefinition getOnWhen() {
         return onWhen;
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
Tue Feb 22 08:00:32 2011
@@ -801,16 +801,14 @@ public class OnExceptionDefinition exten
         return useOriginalMessagePolicy;
     }
 
-    @XmlTransient
-    public boolean isUseOriginalMessage() {
-        // should be false by default
-        return useOriginalMessagePolicy != null ? useOriginalMessagePolicy : false;
-    }
-
     public void setUseOriginalMessagePolicy(Boolean useOriginalMessagePolicy) {
         this.useOriginalMessagePolicy = useOriginalMessagePolicy;
     }
 
+    public boolean isUseOriginalMessage() {
+        return useOriginalMessagePolicy != null && useOriginalMessagePolicy;
+    }
+
     public boolean isAsyncDelayedRedelivery(CamelContext context) {
         if (getRedeliveryPolicy() != null) {
             return getRedeliveryPolicy().isAsyncDelayedRedelivery(context);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
Tue Feb 22 08:00:32 2011
@@ -241,14 +241,18 @@ public class RecipientListDefinition<Typ
         this.delimiter = delimiter;
     }
 
-    public boolean isParallelProcessing() {
-        return parallelProcessing != null && parallelProcessing;
+    public Boolean getParallelProcessing() {
+        return parallelProcessing;
     }
 
-    public void setParallelProcessing(boolean parallelProcessing) {
+    public void setParallelProcessing(Boolean parallelProcessing) {
         this.parallelProcessing = parallelProcessing;
     }
 
+    public boolean isParallelProcessing() {
+        return parallelProcessing != null && parallelProcessing;
+    }
+
     public String getStrategyRef() {
         return strategyRef;
     }
@@ -264,8 +268,8 @@ public class RecipientListDefinition<Typ
     public void setExecutorServiceRef(String executorServiceRef) {
         this.executorServiceRef = executorServiceRef;
     }
-    
-    public Boolean isIgnoreInvalidEndpoints() {
+
+    public Boolean getIgnoreInvalidEndpoints() {
         return ignoreInvalidEndpoints;
     }
 
@@ -273,7 +277,11 @@ public class RecipientListDefinition<Typ
         this.ignoreInvalidEndpoints = ignoreInvalidEndpoints;
     }
 
-    public Boolean isStopOnException() {
+    public boolean isIgnoreInvalidEndpoints() {
+        return ignoreInvalidEndpoints != null && ignoreInvalidEndpoints;
+    }
+
+    public Boolean getStopOnException() {
         return stopOnException;
     }
 
@@ -281,6 +289,10 @@ public class RecipientListDefinition<Typ
         this.stopOnException = stopOnException;
     }
 
+    public boolean isStopOnException() {
+        return stopOnException != null && stopOnException;
+    }
+
     public AggregationStrategy getAggregationStrategy() {
         return aggregationStrategy;
     }
@@ -297,12 +309,16 @@ public class RecipientListDefinition<Typ
         this.executorService = executorService;
     }
 
-    public void setStreaming(boolean streaming) {
+    public Boolean getStreaming() {
+        return streaming;
+    }
+
+    public void setStreaming(Boolean streaming) {
         this.streaming = streaming;
     }
 
     public boolean isStreaming() {
-        return streaming != null ? streaming : false;
+        return streaming != null && streaming;
     }
 
     public Long getTimeout() {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/RollbackDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RollbackDefinition.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/RollbackDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/RollbackDefinition.java Tue
Feb 22 08:00:32 2011
@@ -69,14 +69,13 @@ public class RollbackDefinition extends 
     @Override
     public Processor createProcessor(RouteContext routeContext) {
         // validate that only either mark rollbacks is chosen and not both
-        if (markRollbackOnly != null && markRollbackOnly.booleanValue()
-            && markRollbackOnlyLast != null && markRollbackOnlyLast.booleanValue())
{
+        if (isMarkRollbackOnly() && isMarkRollbackOnlyLast()) {
             throw new IllegalArgumentException("Only either one of markRollbackOnly and markRollbackOnlyLast
is possible to select as true");
         }
 
         RollbackProcessor answer = new RollbackProcessor(message);
-        answer.setMarkRollbackOnly(markRollbackOnly != null ? markRollbackOnly : false);
-        answer.setMarkRollbackOnlyLast(markRollbackOnlyLast != null ? markRollbackOnlyLast
: false);
+        answer.setMarkRollbackOnly(isMarkRollbackOnly());
+        answer.setMarkRollbackOnlyLast(isMarkRollbackOnlyLast());
         return answer;
     }
 
@@ -86,7 +85,7 @@ public class RollbackDefinition extends 
         return Collections.EMPTY_LIST;
     }
 
-    public Boolean isMarkRollbackOnly() {
+    public Boolean getMarkRollbackOnly() {
         return markRollbackOnly;
     }
 
@@ -94,11 +93,19 @@ public class RollbackDefinition extends 
         this.markRollbackOnly = markRollbackOnly;
     }
 
-    public Boolean isMarkRollbackOnlyLast() {
+    public boolean isMarkRollbackOnly() {
+        return markRollbackOnly != null && markRollbackOnly;
+    }
+
+    public Boolean getMarkRollbackOnlyLast() {
         return markRollbackOnlyLast;
     }
 
     public void setMarkRollbackOnlyLast(Boolean markRollbackOnlyLast) {
         this.markRollbackOnlyLast = markRollbackOnlyLast;
     }
+
+    public boolean isMarkRollbackOnlyLast() {
+        return markRollbackOnlyLast != null && markRollbackOnlyLast;
+    }
 }
\ No newline at end of file

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java Tue Feb
22 08:00:32 2011
@@ -157,7 +157,7 @@ public class SplitDefinition extends Exp
     
     /**
      * Enables streaming. 
-     * See {@link SplitDefinition#setStreaming(boolean)} for more information
+     * See {@link org.apache.camel.model.SplitDefinition#isStreaming()} for more information
      *
      * @return the builder
      */
@@ -215,24 +215,17 @@ public class SplitDefinition extends Exp
     public void setAggregationStrategy(AggregationStrategy aggregationStrategy) {
         this.aggregationStrategy = aggregationStrategy;
     }
-    
-    public boolean isParallelProcessing() {
-        return parallelProcessing != null ? parallelProcessing : false;
+
+    public Boolean getParallelProcessing() {
+        return parallelProcessing;
     }
 
-    public void setParallelProcessing(boolean parallelProcessing) {
+    public void setParallelProcessing(Boolean parallelProcessing) {
         this.parallelProcessing = parallelProcessing;
     }
-    
-    /**
-     * The splitter should use streaming -- exchanges are being sent as the data for them
becomes available.
-     * This improves throughput and memory usage, but it has a drawback: 
-     * - the sent exchanges will no longer contain the {@link org.apache.camel.Exchange#SPLIT_SIZE}
header property
-     * 
-     * @return whether or not streaming should be used
-     */
-    public boolean isStreaming() {
-        return streaming != null ? streaming : false;
+
+    public boolean isParallelProcessing() {
+        return parallelProcessing != null && parallelProcessing;
     }
 
     public Boolean getStreaming() {
@@ -243,14 +236,29 @@ public class SplitDefinition extends Exp
         this.streaming = streaming;
     }
 
-    public Boolean isStopOnException() {
-        return stopOnException != null ? stopOnException : false;
+    /**
+     * The splitter should use streaming -- exchanges are being sent as the data for them
becomes available.
+     * This improves throughput and memory usage, but it has a drawback:
+     * - the sent exchanges will no longer contain the {@link org.apache.camel.Exchange#SPLIT_SIZE}
header property
+     *
+     * @return whether or not streaming should be used
+     */
+    public boolean isStreaming() {
+        return streaming != null && streaming;
+    }
+
+    public Boolean getStopOnException() {
+        return stopOnException;
     }
 
     public void setStopOnException(Boolean stopOnException) {
         this.stopOnException = stopOnException;
     }
 
+    public Boolean isStopOnException() {
+        return stopOnException != null && stopOnException;
+    }
+
     public ExecutorService getExecutorService() {
         return executorService;
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadPoolProfileDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadPoolProfileDefinition.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadPoolProfileDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadPoolProfileDefinition.java
Tue Feb 22 08:00:32 2011
@@ -95,14 +95,18 @@ public class ThreadPoolProfileDefinition
         return this;
     }
 
-    public Boolean isDefaultProfile() {
-        return defaultProfile != null && defaultProfile;
+    public Boolean getDefaultProfile() {
+        return defaultProfile;
     }
 
     public void setDefaultProfile(Boolean defaultProfile) {
         this.defaultProfile = defaultProfile;
     }
 
+    public Boolean isDefaultProfile() {
+        return defaultProfile != null && defaultProfile;
+    }
+
     public Integer getPoolSize() {
         return poolSize;
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/WireTapDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/WireTapDefinition.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/WireTapDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/WireTapDefinition.java Tue
Feb 22 08:00:32 2011
@@ -74,13 +74,8 @@ public class WireTapDefinition extends S
             executorService = routeContext.getCamelContext().getExecutorServiceStrategy().newDefaultThreadPool(this,
"WireTap");
         }
         WireTapProcessor answer = new WireTapProcessor(endpoint, getPattern(), executorService);
-        if (isCopy() == null) {
-            // should default be true
-            answer.setCopy(true);
-        } else {
-            answer.setCopy(isCopy());
-        }
 
+        answer.setCopy(isCopy());
         if (newExchangeProcessorRef != null) {
             newExchangeProcessor = routeContext.lookup(newExchangeProcessorRef, Processor.class);
         }
@@ -162,11 +157,16 @@ public class WireTapDefinition extends S
         this.executorServiceRef = executorServiceRef;
     }
 
-    public Boolean isCopy() {
+    public Boolean getCopy() {
         return copy;
     }
 
     public void setCopy(Boolean copy) {
         this.copy = copy;
     }
+
+    public boolean isCopy() {
+        // should default to true if not configured
+        return copy != null ? copy : true;
+    }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/config/BatchResequencerConfig.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/config/BatchResequencerConfig.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/config/BatchResequencerConfig.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/config/BatchResequencerConfig.java
Tue Feb 22 08:00:32 2011
@@ -19,7 +19,6 @@ package org.apache.camel.model.config;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlEnum;
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
@@ -119,7 +118,7 @@ public class BatchResequencerConfig {
     }
 
     public boolean isAllowDuplicates() {
-        return allowDuplicates != null && allowDuplicates.booleanValue();
+        return allowDuplicates != null && allowDuplicates;
     }
 
     public Boolean getAllowDuplicates() {
@@ -131,7 +130,7 @@ public class BatchResequencerConfig {
     }
 
     public boolean isReverse() {
-        return reverse != null && reverse.booleanValue();
+        return reverse != null && reverse;
     }
 
     public Boolean getReverse() {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CastorDataFormat.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CastorDataFormat.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CastorDataFormat.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CastorDataFormat.java
Tue Feb 22 08:00:32 2011
@@ -50,7 +50,7 @@ public class CastorDataFormat extends Da
 
     public boolean isValidation() {
         // defaults to true if not configured
-        return validation == null || validation.booleanValue();
+        return validation != null ? validation : true;
     }
 
     public Boolean getValidation() {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java
Tue Feb 22 08:00:32 2011
@@ -42,7 +42,7 @@ public class HL7DataFormat extends DataF
 
     public boolean isValidate() {
         // defaults to true if not configured
-        return validate == null || validate.booleanValue();
+        return validate != null ? validate : true;
     }
 
     public Boolean getValidate() {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XMLSecurityDataFormat.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XMLSecurityDataFormat.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XMLSecurityDataFormat.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XMLSecurityDataFormat.java
Tue Feb 22 08:00:32 2011
@@ -40,7 +40,7 @@ public class XMLSecurityDataFormat exten
     @XmlAttribute(required = false)
     private String secureTag;
     @XmlAttribute(required = false)
-    private boolean secureTagContents;
+    private Boolean secureTagContents;
 
     public XMLSecurityDataFormat() {
         super("secureXML");
@@ -115,11 +115,15 @@ public class XMLSecurityDataFormat exten
         this.secureTag = secureTag;
     }
 
-    public boolean isSecureTagContents() {
+    public Boolean getSecureTagContents() {
         return secureTagContents;
     }
 
-    public void setSecureTagContents(boolean secureTagContents) {
+    public void setSecureTagContents(Boolean secureTagContents) {
         this.secureTagContents = secureTagContents;
     }
+
+    public boolean isSecureTagContents() {
+        return secureTagContents != null && secureTagContents;
+    }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/FailoverLoadBalancerDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/FailoverLoadBalancerDefinition.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/FailoverLoadBalancerDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/FailoverLoadBalancerDefinition.java
Tue Feb 22 08:00:32 2011
@@ -80,7 +80,7 @@ public class FailoverLoadBalancerDefinit
     }
 
     public boolean isRoundRobin() {
-        return roundRobin != null && roundRobin.booleanValue();
+        return roundRobin != null && roundRobin;
     }
 
     public Boolean getRoundRobin() {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/WeightedLoadBalancerDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/WeightedLoadBalancerDefinition.java?rev=1073239&r1=1073238&r2=1073239&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/WeightedLoadBalancerDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/loadbalancer/WeightedLoadBalancerDefinition.java
Tue Feb 22 08:00:32 2011
@@ -22,8 +22,6 @@ import java.util.List;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.camel.model.LoadBalancerDefinition;
@@ -32,6 +30,7 @@ import org.apache.camel.processor.loadba
 import org.apache.camel.processor.loadbalancer.WeightedRandomLoadBalancer;
 import org.apache.camel.processor.loadbalancer.WeightedRoundRobinLoadBalancer;
 import org.apache.camel.spi.RouteContext;
+import org.apache.camel.util.ObjectHelper;
 
 /**
  * Represents an XML &lt;weighted/&gt; element
@@ -40,18 +39,16 @@ import org.apache.camel.spi.RouteContext
 @XmlAccessorType(XmlAccessType.FIELD)
 public class WeightedLoadBalancerDefinition extends LoadBalancerDefinition {
     
-    @XmlAttribute(name = "roundRobin", required = false)
+    @XmlAttribute
     private Boolean roundRobin;
-    
-    @XmlAttribute(name = "distributionRatio", required = true)
+    @XmlAttribute(required = true)
     private String distributionRatio;
-    
-    @XmlAttribute(name = "distributionRatioDelimiter", required = false)
+    @XmlAttribute
     private String distributionRatioDelimiter;
     
     @Override
     protected LoadBalancer createLoadBalancer(RouteContext routeContext) {
-        WeightedLoadBalancer loadBalancer = null;
+        WeightedLoadBalancer loadBalancer;
         List<Integer> distributionRatioList = new ArrayList<Integer>();
         
         try {
@@ -70,13 +67,10 @@ public class WeightedLoadBalancerDefinit
                 loadBalancer = new WeightedRoundRobinLoadBalancer(distributionRatioList);
             }
         } catch (Exception e) {
-            
+            throw ObjectHelper.wrapRuntimeCamelException(e);
         }
-        return loadBalancer;
-    }
 
-    public boolean isRoundRobin() {
-        return roundRobin != null && roundRobin.booleanValue();
+        return loadBalancer;
     }
 
     public Boolean getRoundRobin() {
@@ -87,6 +81,10 @@ public class WeightedLoadBalancerDefinit
         this.roundRobin = roundRobin;
     }
 
+    public boolean isRoundRobin() {
+        return roundRobin != null && roundRobin;
+    }
+
     public String getDistributionRatio() {
         return distributionRatio;
     }



Mime
View raw message