Author: ningjiang
Date: Thu Dec 18 19:11:09 2008
New Revision: 727903

URL: http://svn.apache.org/viewvc?rev=727903&view=rev
Log:
CAMEL-1117 added more fluent APIs on the subclass of ProcessorType

Modified:
    
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregatorType.java
    
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanRef.java
    
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/CatchType.java
    
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyType.java
    
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ExceptionType.java
    
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerType.java
    
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ResequencerType.java

Modified: 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregatorType.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregatorType.java?rev=727903&r1=727902&r2=727903&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregatorType.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AggregatorType.java
 Thu Dec 18 19:11:09 2008
@@ -304,9 +304,9 @@
     }
 
     /**
-     * Sets the aggegate strategy to use
+     * Sets the aggregate strategy to use
      *
-     * @param aggregationStrategy  the aggreage startegy to use
+     * @param aggregationStrategy  the aggregate strategy to use
      * @return the builder
      */
     public AggregatorType aggregationStrategy(AggregationStrategy 
aggregationStrategy) {
@@ -315,7 +315,7 @@
     }
 
     /**
-     * Sets the aggegate collection to use
+     * Sets the aggregate collection to use
      *
      * @param collectionRef  reference to the aggregate collection to lookup 
in the registry
      * @return the builder
@@ -326,7 +326,7 @@
     }
 
     /**
-     * Sets the aggegate strategy to use
+     * Sets the aggregate strategy to use
      *
      * @param strategyRef  reference to the strategy to lookup in the registry
      * @return the builder

Modified: 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanRef.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanRef.java?rev=727903&r1=727902&r2=727903&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanRef.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanRef.java
 Thu Dec 18 19:11:09 2008
@@ -95,6 +95,52 @@
     public void setBeanType(Class beanType) {
         this.beanType = beanType;
     }
+    
+    // Fluent API
+    //-------------------------------------------------------------------------
+    /**
+     * Sets the ref String on camel bean
+     *
+     * @param ref  the bean's id in the registry
+     * @return the builder
+     */
+    public BeanRef ref(String ref) {
+        setRef(ref);
+        return this;
+    }
+    
+    /**
+     * Sets the calling method name of camel bean
+     *
+     * @param method  the bean's method name which wants camel to call
+     * @return the builder
+     */
+    public BeanRef method(String method) {
+        setMethod(method);
+        return this;
+    }
+    
+    /**
+     * Sets the bean's instance that camel to call
+     *
+     * @param bean the instance of the bean
+     * @return the builder
+     */
+    public BeanRef bean(Object bean) {
+        setBean(bean);
+        return this;
+    }
+    
+    /**
+     * Sets the Class of the bean that camel will instantiation it for calling
+     *
+     * @param beanType the Class of the bean
+     * @return the builder
+     */
+    public BeanRef beanType(Class beanType) {
+        setBean(beanType);
+        return this;
+    }
 
     @Override
     public Processor createProcessor(RouteContext routeContext) {

Modified: 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/CatchType.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/CatchType.java?rev=727903&r1=727902&r2=727903&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/CatchType.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/CatchType.java
 Thu Dec 18 19:11:09 2008
@@ -97,6 +97,31 @@
     public void setExceptionClasses(List<Class> exceptionClasses) {
         this.exceptionClasses = exceptionClasses;
     }
+    
+    // Fluent API
+    //-------------------------------------------------------------------------
+    /**
+     * Sets the exceptionClasses of the CatchType
+     *
+     * @param exceptionClasses  a list of the exception classes
+     * @return the builder
+     */
+    public CatchType exceptionClasses(List<Class> exceptionClasses) {
+        setExceptionClasses(exceptionClasses);
+        return this;
+    }
+    
+    /**
+     * Sets the exception class that the CatchType want to catch
+     *
+     * @param exception  the exception of class
+     * @return the builder
+     */
+    public CatchType exceptionClasses(Class exception) {
+        List<Class> list = getExceptionClasses();
+        list.add(exception);
+        return this;
+    }
 
     public List<String> getExceptions() {
         return exceptions;

Modified: 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyType.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyType.java?rev=727903&r1=727902&r2=727903&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyType.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyType.java
 Thu Dec 18 19:11:09 2008
@@ -100,4 +100,28 @@
         }
         return typeClass;
     }
+    
+    // Fluent API
+    //-------------------------------------------------------------------------
+    /**
+     * Sets the type class that you want ConvertBodyType to covert
+     *
+     * @param typeClass  the type class that you want to covert body instance 
to
+     * @return the builder
+     */
+    public ConvertBodyType typeClass(Class typeClass) {
+        setTypeClass(typeClass);
+        return this;
+    }
+    
+    /**
+     * Sets the type class name that you want to covert body instance to
+     *
+     * @param type  the type class name
+     * @return the builder
+     */
+    public ConvertBodyType type(String type) {
+        setType(type);
+        return this;
+    }
 }

Modified: 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ExceptionType.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ExceptionType.java?rev=727903&r1=727902&r2=727903&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ExceptionType.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ExceptionType.java
 Thu Dec 18 19:11:09 2008
@@ -134,7 +134,7 @@
     }
 
     /**
-     * Sets wether the exchange should be marked as handled or not.
+     * Sets whether the exchange should be marked as handled or not.
      *
      * @param handled  handled or not
      * @return the builder
@@ -145,7 +145,7 @@
     }
     
     /**
-     * Sets wether the exchange should be marked as handled or not.
+     * Sets whether the exchange should be marked as handled or not.
      *
      * @param handled  predicate that determines true or false
      * @return the builder
@@ -156,7 +156,7 @@
     }
     
     /**
-     * Sets wether the exchange should be marked as handled or not.
+     * Sets whether the exchange should be marked as handled or not.
      *
      * @param handled  expression that determines true or false
      * @return the builder
@@ -169,7 +169,7 @@
     /**
      * Sets an additional predicate that should be true before the onException 
is triggered.
      * <p/>
-     * To be used for fine grained controlling wether a thrown exception 
should be intercepted
+     * To be used for fine grained controlling whether a thrown exception 
should be intercepted
      * by this exception type or not.
      *
      * @param predicate  predicate that determines true or false
@@ -184,7 +184,7 @@
      * Creates an expression to configure an additional predicate that should 
be true before the
      * onException is triggered.
      * <p/>
-     * To be used for fine grained controlling wether a thrown exception 
should be intercepted
+     * To be used for fine grained controlling whether a thrown exception 
should be intercepted
      * by this exception type or not.
      *
      * @return the expression clause to configure

Modified: 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerType.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerType.java?rev=727903&r1=727902&r2=727903&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerType.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/IdempotentConsumerType.java
 Thu Dec 18 19:11:09 2008
@@ -58,6 +58,30 @@
     public String getShortName() {
         return "idempotentConsumer";
     }
+    
+    // Fluent API
+    //-------------------------------------------------------------------------
+    /**
+     * Sets the reference name of the message id repository
+     *
+     * @param messageIdRepositoryRef  the reference name of message id 
repository
+     * @return builder
+     */
+    public IdempotentConsumerType messageIdRepositoryRef(String 
messageIdRepositoryRef) {
+        setMessageIdRepositoryRef(messageIdRepositoryRef);
+        return this;
+    }
+    
+    /**
+     * Sets the the message id repository for the IdempotentConsumerType
+     *
+     * @param idempotentRepository  the repository instance of idempotent
+     * @return builder
+     */
+    public IdempotentConsumerType messageIdRepository(IdempotentRepository 
idempotentRepository) {
+        setMessageIdRepository(idempotentRepository);
+        return this;
+    }
 
     public String getMessageIdRepositoryRef() {
         return messageIdRepositoryRef;

Modified: 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ResequencerType.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ResequencerType.java?rev=727903&r1=727902&r2=727903&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ResequencerType.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ResequencerType.java
 Thu Dec 18 19:11:09 2008
@@ -65,7 +65,9 @@
     public String getShortName() {
         return "resequencer";
     }
-
+    
+    // Fluent API
+    // 
-------------------------------------------------------------------------
     /**
      * Configures the stream-based resequencing algorithm using the default
      * configuration.


Reply via email to