You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ch...@apache.org on 2007/08/07 20:36:08 UTC
svn commit: r563607 [7/12] - in /activemq/camel/trunk/camel-core/src:
main/java/org/apache/camel/ main/java/org/apache/camel/builder/
main/java/org/apache/camel/builder/xml/
main/java/org/apache/camel/component/bean/
main/java/org/apache/camel/componen...
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,6 +16,14 @@
*/
package org.apache.camel.model;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlTransient;
+
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Expression;
@@ -34,30 +41,24 @@
import org.apache.camel.model.language.ExpressionType;
import org.apache.camel.model.language.LanguageExpression;
import org.apache.camel.processor.DelegateProcessor;
-import org.apache.camel.processor.MulticastProcessor;
import org.apache.camel.processor.Pipeline;
-import org.apache.camel.processor.RecipientList;
import org.apache.camel.processor.aggregate.AggregationStrategy;
-import org.apache.camel.processor.idempotent.IdempotentConsumer;
import org.apache.camel.processor.idempotent.MessageIdRepository;
import org.apache.camel.spi.Policy;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlTransient;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
/**
* @version $Revision: 1.1 $
*/
public abstract class ProcessorType {
public static final String DEFAULT_TRACE_CATEGORY = "org.apache.camel.TRACE";
private ErrorHandlerBuilder errorHandlerBuilder;
- private Boolean inheritErrorHandlerFlag = Boolean.TRUE; // TODO not sure how else to use an optional attribute in JAXB2
+ private Boolean inheritErrorHandlerFlag = Boolean.TRUE; // TODO not sure how
+ // else to use an
+ // optional
+ // attribute in
+ // JAXB2
public abstract List<ProcessorType> getOutputs();
@@ -78,7 +79,8 @@
}
/**
- * Wraps the child processor in whatever necessary interceptors and error handlers
+ * Wraps the child processor in whatever necessary interceptors and error
+ * handlers
*/
public Processor wrapProcessor(RouteContext routeContext, Processor processor) throws Exception {
processor = wrapProcessorInInterceptors(routeContext, processor);
@@ -86,7 +88,7 @@
}
// Fluent API
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
/**
* Sends the exchange to the given endpoint URI
@@ -105,7 +107,8 @@
}
/**
- * Sends the exchange to a list of endpoints using the {@link MulticastProcessor} pattern
+ * Sends the exchange to a list of endpoints using the
+ * {@link MulticastProcessor} pattern
*/
public ProcessorType to(String... uris) {
for (String uri : uris) {
@@ -115,7 +118,8 @@
}
/**
- * Sends the exchange to a list of endpoints using the {@link MulticastProcessor} pattern
+ * Sends the exchange to a list of endpoints using the
+ * {@link MulticastProcessor} pattern
*/
public ProcessorType to(Endpoint... endpoints) {
for (Endpoint endpoint : endpoints) {
@@ -125,7 +129,8 @@
}
/**
- * Sends the exchange to a list of endpoint using the {@link MulticastProcessor} pattern
+ * Sends the exchange to a list of endpoint using the
+ * {@link MulticastProcessor} pattern
*/
public ProcessorType to(Collection<Endpoint> endpoints) {
for (Endpoint endpoint : endpoints) {
@@ -135,8 +140,9 @@
}
/**
- * Multicasts messages to all its child outputs; so that each processor and destination gets a copy of the original message
- * to avoid the processors interfering with each other.
+ * Multicasts messages to all its child outputs; so that each processor and
+ * destination gets a copy of the original message to avoid the processors
+ * interfering with each other.
*/
public MulticastType multicast() {
MulticastType answer = new MulticastType();
@@ -145,8 +151,9 @@
}
/**
- * Creates a {@link Pipeline} of the list of endpoints so that the message will get processed by each endpoint in turn
- * and for request/response the output of one endpoint will be the input of the next endpoint
+ * Creates a {@link Pipeline} of the list of endpoints so that the message
+ * will get processed by each endpoint in turn and for request/response the
+ * output of one endpoint will be the input of the next endpoint
*/
public ProcessorType pipeline(String... uris) {
// TODO pipeline v mulicast
@@ -154,8 +161,9 @@
}
/**
- * Creates a {@link Pipeline} of the list of endpoints so that the message will get processed by each endpoint in turn
- * and for request/response the output of one endpoint will be the input of the next endpoint
+ * Creates a {@link Pipeline} of the list of endpoints so that the message
+ * will get processed by each endpoint in turn and for request/response the
+ * output of one endpoint will be the input of the next endpoint
*/
public ProcessorType pipeline(Endpoint... endpoints) {
// TODO pipeline v mulicast
@@ -163,8 +171,9 @@
}
/**
- * Creates a {@link Pipeline} of the list of endpoints so that the message will get processed by each endpoint in turn
- * and for request/response the output of one endpoint will be the input of the next endpoint
+ * Creates a {@link Pipeline} of the list of endpoints so that the message
+ * will get processed by each endpoint in turn and for request/response the
+ * output of one endpoint will be the input of the next endpoint
*/
public ProcessorType pipeline(Collection<Endpoint> endpoints) {
// TODO pipeline v mulicast
@@ -174,16 +183,17 @@
/**
* Creates an {@link IdempotentConsumer} to avoid duplicate messages
*/
- public IdempotentConsumerType idempotentConsumer(Expression messageIdExpression, MessageIdRepository messageIdRepository) {
+ public IdempotentConsumerType idempotentConsumer(Expression messageIdExpression,
+ MessageIdRepository messageIdRepository) {
IdempotentConsumerType answer = new IdempotentConsumerType(messageIdExpression, messageIdRepository);
addOutput(answer);
return answer;
}
/**
- * Creates a predicate which is applied and only if it is true then
- * the exchange is forwarded to the destination
- *
+ * Creates a predicate which is applied and only if it is true then the
+ * exchange is forwarded to the destination
+ *
* @return the builder for a predicate
*/
public FilterType filter(Predicate predicate) {
@@ -194,7 +204,7 @@
/**
* Creates a choice of one or more predicates with an otherwise clause
- *
+ *
* @return the builder for a choice expression
*/
public ChoiceType choice() {
@@ -205,7 +215,7 @@
/**
* Creates a try/catch block
- *
+ *
* @return the builder for a tryBlock expression
*/
public TryType tryBlock() {
@@ -215,9 +225,12 @@
}
/**
- * Creates a dynamic <a href="http://activemq.apache.org/camel/recipient-list.html">Recipient List</a> pattern.
- *
- * @param receipients is the builder of the expression used in the {@link RecipientList} to decide the destinations
+ * Creates a dynamic <a
+ * href="http://activemq.apache.org/camel/recipient-list.html">Recipient
+ * List</a> pattern.
+ *
+ * @param receipients is the builder of the expression used in the
+ * {@link RecipientList} to decide the destinations
*/
public ProcessorType recipientList(Expression receipients) {
RecipientListType answer = new RecipientListType(receipients);
@@ -226,9 +239,11 @@
}
/**
- * A builder for the <a href="http://activemq.apache.org/camel/splitter.html">Splitter</a> pattern
- * where an expression is evaluated to iterate through each of the parts of a message and then each part is then send to some endpoint.
- *
+ * A builder for the <a
+ * href="http://activemq.apache.org/camel/splitter.html">Splitter</a>
+ * pattern where an expression is evaluated to iterate through each of the
+ * parts of a message and then each part is then send to some endpoint.
+ *
* @param receipients the expression on which to split
* @return the builder
*/
@@ -239,22 +254,26 @@
}
/**
- * A builder for the <a href="http://activemq.apache.org/camel/resequencer.html">Resequencer</a> pattern
- * where an expression is evaluated to be able to compare the message exchanges to reorder them. e.g. you
- * may wish to sort by some header
- *
+ * A builder for the <a
+ * href="http://activemq.apache.org/camel/resequencer.html">Resequencer</a>
+ * pattern where an expression is evaluated to be able to compare the
+ * message exchanges to reorder them. e.g. you may wish to sort by some
+ * header
+ *
* @param expression the expression on which to compare messages in order
* @return the builder
*/
public ResequencerType resequencer(Expression<Exchange> expression) {
- return resequencer(Collections.<Expression>singletonList(expression));
+ return resequencer(Collections.<Expression> singletonList(expression));
}
/**
- * A builder for the <a href="http://activemq.apache.org/camel/resequencer.html">Resequencer</a> pattern
- * where a list of expressions are evaluated to be able to compare the message exchanges to reorder them. e.g. you
- * may wish to sort by some headers
- *
+ * A builder for the <a
+ * href="http://activemq.apache.org/camel/resequencer.html">Resequencer</a>
+ * pattern where a list of expressions are evaluated to be able to compare
+ * the message exchanges to reorder them. e.g. you may wish to sort by some
+ * headers
+ *
* @param expressions the expressions on which to compare messages in order
* @return the builder
*/
@@ -265,10 +284,12 @@
}
/**
- * A builder for the <a href="http://activemq.apache.org/camel/resequencer.html">Resequencer</a> pattern
- * where a list of expressions are evaluated to be able to compare the message exchanges to reorder them. e.g. you
- * may wish to sort by some headers
- *
+ * A builder for the <a
+ * href="http://activemq.apache.org/camel/resequencer.html">Resequencer</a>
+ * pattern where a list of expressions are evaluated to be able to compare
+ * the message exchanges to reorder them. e.g. you may wish to sort by some
+ * headers
+ *
* @param expressions the expressions on which to compare messages in order
* @return the builder
*/
@@ -281,19 +302,23 @@
}
/**
- * A builder for the <a href="http://activemq.apache.org/camel/aggregator.html">Aggregator</a> pattern
- * where a batch of messages are processed (up to a maximum amount or until some timeout is reached)
- * and messages for the same correlation key are combined together using some kind of
+ * A builder for the <a
+ * href="http://activemq.apache.org/camel/aggregator.html">Aggregator</a>
+ * pattern where a batch of messages are processed (up to a maximum amount
+ * or until some timeout is reached) and messages for the same correlation
+ * key are combined together using some kind of
* {@link AggregationStrategy ) (by default the latest message is used) to compress many message exchanges
- * into a smaller number of exchanges.
- * <p/>
- * A good example of this is stock market data; you may be receiving 30,000 messages/second and you may want to
- * throttle it right down so that multiple messages for the same stock are combined (or just the latest
- * message is used and older prices are discarded). Another idea is to combine line item messages together
- * into a single invoice message.
- *
- * @param correlationExpression the expression used to calculate the correlation key. For a JMS message this could
- * be the expression <code>header("JMSDestination")</code> or <code>header("JMSCorrelationID")</code>
+ * into a smaller number of exchanges. <p/> A good example of this is stock
+ * market data; you may be receiving 30,000 messages/second and you may want
+ * to throttle it right down so that multiple messages for the same stock
+ * are combined (or just the latest message is used and older prices are
+ * discarded). Another idea is to combine line item messages together into a
+ * single invoice message.
+ *
+ * @param correlationExpression the expression used to calculate the
+ * correlation key. For a JMS message this could be the
+ * expression <code>header("JMSDestination")</code> or
+ * <code>header("JMSCorrelationID")</code>
*/
public AggregatorType aggregator(Expression correlationExpression) {
AggregatorType answer = new AggregatorType(correlationExpression);
@@ -302,19 +327,23 @@
}
/**
- * A builder for the <a href="http://activemq.apache.org/camel/aggregator.html">Aggregator</a> pattern
- * where a batch of messages are processed (up to a maximum amount or until some timeout is reached)
- * and messages for the same correlation key are combined together using some kind of
+ * A builder for the <a
+ * href="http://activemq.apache.org/camel/aggregator.html">Aggregator</a>
+ * pattern where a batch of messages are processed (up to a maximum amount
+ * or until some timeout is reached) and messages for the same correlation
+ * key are combined together using some kind of
* {@link AggregationStrategy ) (by default the latest message is used) to compress many message exchanges
- * into a smaller number of exchanges.
- * <p/>
- * A good example of this is stock market data; you may be receiving 30,000 messages/second and you may want to
- * throttle it right down so that multiple messages for the same stock are combined (or just the latest
- * message is used and older prices are discarded). Another idea is to combine line item messages together
- * into a single invoice message.
- *
- * @param correlationExpression the expression used to calculate the correlation key. For a JMS message this could
- * be the expression <code>header("JMSDestination")</code> or <code>header("JMSCorrelationID")</code>
+ * into a smaller number of exchanges. <p/> A good example of this is stock
+ * market data; you may be receiving 30,000 messages/second and you may want
+ * to throttle it right down so that multiple messages for the same stock
+ * are combined (or just the latest message is used and older prices are
+ * discarded). Another idea is to combine line item messages together into a
+ * single invoice message.
+ *
+ * @param correlationExpression the expression used to calculate the
+ * correlation key. For a JMS message this could be the
+ * expression <code>header("JMSDestination")</code> or
+ * <code>header("JMSCorrelationID")</code>
*/
public AggregatorType aggregator(Expression correlationExpression, AggregationStrategy aggregationStrategy) {
AggregatorType answer = new AggregatorType(correlationExpression, aggregationStrategy);
@@ -323,10 +352,13 @@
}
/**
- * A builder for the <a href="http://activemq.apache.org/camel/delayer.html">Delayer</a> pattern
- * where an expression is used to calculate the time which the message will be dispatched on
- *
- * @param processAtExpression an expression to calculate the time at which the messages should be processed
+ * A builder for the <a
+ * href="http://activemq.apache.org/camel/delayer.html">Delayer</a> pattern
+ * where an expression is used to calculate the time which the message will
+ * be dispatched on
+ *
+ * @param processAtExpression an expression to calculate the time at which
+ * the messages should be processed
* @return the builder
*/
public DelayerType delayer(Expression<Exchange> processAtExpression) {
@@ -334,12 +366,16 @@
}
/**
- * A builder for the <a href="http://activemq.apache.org/camel/delayer.html">Delayer</a> pattern
- * where an expression is used to calculate the time which the message will be dispatched on
- *
- * @param processAtExpression an expression to calculate the time at which the messages should be processed
- * @param delay the delay in milliseconds which is added to the processAtExpression to determine the time the
- * message should be processed
+ * A builder for the <a
+ * href="http://activemq.apache.org/camel/delayer.html">Delayer</a> pattern
+ * where an expression is used to calculate the time which the message will
+ * be dispatched on
+ *
+ * @param processAtExpression an expression to calculate the time at which
+ * the messages should be processed
+ * @param delay the delay in milliseconds which is added to the
+ * processAtExpression to determine the time the message
+ * should be processed
* @return the builder
*/
public DelayerType delayer(Expression<Exchange> processAtExpression, long delay) {
@@ -349,9 +385,11 @@
}
/**
- * A builder for the <a href="http://activemq.apache.org/camel/delayer.html">Delayer</a> pattern
- * where a fixed amount of milliseconds are used to delay processing of a message exchange
- *
+ * A builder for the <a
+ * href="http://activemq.apache.org/camel/delayer.html">Delayer</a> pattern
+ * where a fixed amount of milliseconds are used to delay processing of a
+ * message exchange
+ *
* @param delay the default delay in milliseconds
* @return the builder
*/
@@ -360,9 +398,11 @@
}
/**
- * A builder for the <a href="http://activemq.apache.org/camel/delayer.html">Delayer</a> pattern
- * where an expression is used to calculate the time which the message will be dispatched on
- *
+ * A builder for the <a
+ * href="http://activemq.apache.org/camel/delayer.html">Delayer</a> pattern
+ * where an expression is used to calculate the time which the message will
+ * be dispatched on
+ *
* @return the builder
*/
public ThrottlerType throttler(long maximumRequestCount) {
@@ -395,9 +435,9 @@
}
/**
- * Trace logs the exchange before it goes to the next processing step using the {@link #DEFAULT_TRACE_CATEGORY} logging
- * category.
- *
+ * Trace logs the exchange before it goes to the next processing step using
+ * the {@link #DEFAULT_TRACE_CATEGORY} logging category.
+ *
* @return
*/
public ProcessorType trace() {
@@ -405,9 +445,9 @@
}
/**
- * Trace logs the exchange before it goes to the next processing step using the specified logging
- * category.
- *
+ * Trace logs the exchange before it goes to the next processing step using
+ * the specified logging category.
+ *
* @param category the logging category trace messages will sent to.
* @return
*/
@@ -441,8 +481,9 @@
/**
* Installs the given error handler builder
- *
- * @param errorHandlerBuilder the error handler to be used by default for all child routes
+ *
+ * @param errorHandlerBuilder the error handler to be used by default for
+ * all child routes
* @return the current builder with the error handler configured
*/
public ProcessorType errorHandler(ErrorHandlerBuilder errorHandlerBuilder) {
@@ -451,9 +492,11 @@
}
/**
- * Configures whether or not the error handler is inherited by every processing node (or just the top most one)
- *
- * @param condition the falg as to whether error handlers should be inherited or not
+ * Configures whether or not the error handler is inherited by every
+ * processing node (or just the top most one)
+ *
+ * @param condition the falg as to whether error handlers should be
+ * inherited or not
* @return the current builder
*/
public ProcessorType inheritErrorHandler(boolean condition) {
@@ -462,10 +505,11 @@
}
// Transformers
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
/**
- * Adds the custom processor to this destination which could be a final destination, or could be a transformation in a pipeline
+ * Adds the custom processor to this destination which could be a final
+ * destination, or could be a transformation in a pipeline
*/
public ProcessorType process(Processor processor) {
ProcessorRef answer = new ProcessorRef(processor);
@@ -474,7 +518,8 @@
}
/**
- * Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
+ * Adds a bean which is invoked which could be a final destination, or could
+ * be a transformation in a pipeline
*/
public ProcessorType beanRef(String ref) {
BeanRef answer = new BeanRef(ref);
@@ -483,7 +528,8 @@
}
/**
- * Adds a bean and method which is invoked which could be a final destination, or could be a transformation in a pipeline
+ * Adds a bean and method which is invoked which could be a final
+ * destination, or could be a transformation in a pipeline
*/
public ProcessorType beanRef(String ref, String method) {
BeanRef answer = new BeanRef(ref, method);
@@ -541,7 +587,7 @@
}
// Properties
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
@XmlTransient
public ErrorHandlerBuilder getErrorHandlerBuilder() {
@@ -573,10 +619,11 @@
}
// Implementation methods
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
/**
- * Creates the processor and wraps it in any necessary interceptors and error handlers
+ * Creates the processor and wraps it in any necessary interceptors and
+ * error handlers
*/
protected Processor makeProcessor(RouteContext routeContext) throws Exception {
Processor processor = createProcessor(routeContext);
@@ -584,10 +631,12 @@
}
/**
- * A strategy method which allows derived classes to wrap the child processor in some kind of interceptor
- *
+ * A strategy method which allows derived classes to wrap the child
+ * processor in some kind of interceptor
+ *
* @param routeContext
- * @param target the processor which can be wrapped @return the original processor or a new wrapped interceptor
+ * @param target the processor which can be wrapped
+ * @return the original processor or a new wrapped interceptor
*/
protected Processor wrapProcessorInInterceptors(RouteContext routeContext, Processor target) {
// The target is required.
@@ -598,7 +647,8 @@
// Interceptors are optional
DelegateProcessor first = null;
DelegateProcessor last = null;
- List<InterceptorRef> interceptors = new ArrayList<InterceptorRef>(routeContext.getRoute().getInterceptors());
+ List<InterceptorRef> interceptors = new ArrayList<InterceptorRef>(routeContext.getRoute()
+ .getInterceptors());
interceptors.addAll(getInterceptors());
if (interceptors != null) {
for (InterceptorRef interceptorRef : interceptors) {
@@ -620,7 +670,8 @@
}
/**
- * A strategy method to allow newly created processors to be wrapped in an error handler.
+ * A strategy method to allow newly created processors to be wrapped in an
+ * error handler.
*/
protected Processor wrapInErrorHandler(Processor processor) throws Exception {
return getErrorHandlerBuilder().createErrorHandler(processor);
@@ -629,8 +680,7 @@
protected ErrorHandlerBuilder createErrorHandlerBuilder() {
if (isInheritErrorHandler()) {
return new DeadLetterChannelBuilder();
- }
- else {
+ } else {
return new NoErrorHandlerBuilder();
}
}
@@ -645,14 +695,16 @@
/**
* Creates a new instance of some kind of composite processor which defaults
- * to using a {@link Pipeline} but derived classes could change the behaviour
+ * to using a {@link Pipeline} but derived classes could change the
+ * behaviour
*/
protected Processor createCompositeProcessor(List<Processor> list) {
- //return new MulticastProcessor(list);
+ // return new MulticastProcessor(list);
return new Pipeline(list);
}
- protected Processor createOutputsProcessor(RouteContext routeContext, Collection<ProcessorType> outputs) throws Exception {
+ protected Processor createOutputsProcessor(RouteContext routeContext, Collection<ProcessorType> outputs)
+ throws Exception {
List<Processor> list = new ArrayList<Processor>();
for (ProcessorType output : outputs) {
Processor processor = output.createProcessor(routeContext);
@@ -662,8 +714,7 @@
if (!list.isEmpty()) {
if (list.size() == 1) {
processor = list.get(0);
- }
- else {
+ } else {
processor = createCompositeProcessor(list);
}
}
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListType.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListType.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,15 +16,15 @@
*/
package org.apache.camel.model;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
import org.apache.camel.Expression;
import org.apache.camel.Processor;
import org.apache.camel.impl.RouteContext;
import org.apache.camel.model.language.ExpressionType;
import org.apache.camel.processor.RecipientList;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
/**
* @version $Revision: 1.1 $
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?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- 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 Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,6 +16,15 @@
*/
package org.apache.camel.model;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Expression;
@@ -25,14 +33,6 @@
import org.apache.camel.impl.RouteContext;
import org.apache.camel.model.language.ExpressionType;
import org.apache.camel.processor.Resequencer;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
/**
* @version $Revision: 1.1 $
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RouteContainer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RouteContainer.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RouteContainer.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RouteContainer.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,8 +16,9 @@
*/
package org.apache.camel.model;
-import javax.xml.bind.annotation.XmlElementRef;
import java.util.List;
+
+import javax.xml.bind.annotation.XmlElementRef;
/**
* @version $Revision: 1.1 $
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RouteType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RouteType.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RouteType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RouteType.java Tue Aug 7 11:35:48 2007
@@ -1,4 +1,4 @@
-/*
+/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -16,15 +16,9 @@
*/
package org.apache.camel.model;
-import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Route;
-import org.apache.camel.NoSuchEndpointException;
-import org.apache.camel.util.CamelContextHelper;
-import org.apache.camel.impl.RouteContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@@ -33,20 +27,27 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.Endpoint;
+import org.apache.camel.NoSuchEndpointException;
+import org.apache.camel.Route;
+import org.apache.camel.impl.RouteContext;
+import org.apache.camel.util.CamelContextHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* Represents an XML <route/> element
- *
+ *
* @version $Revision: $
*/
@XmlRootElement(name = "route")
-@XmlType(propOrder = {"interceptors", "inputs", "outputs"})
+@XmlType(propOrder = {"interceptors", "inputs", "outputs" })
@XmlAccessorType(XmlAccessType.FIELD)
public class RouteType extends ProcessorType implements CamelContextAware {
- private static final transient Log log = LogFactory.getLog(RouteType.class);
+ private static final transient Log LOG = LogFactory.getLog(RouteType.class);
@XmlElement(required = false, name = "interceptor")
private List<InterceptorRef> interceptors = new ArrayList<InterceptorRef>();
@XmlElementRef
@@ -98,14 +99,14 @@
}
// Fluent API
- //-----------------------------------------------------------------------
+ // -----------------------------------------------------------------------
public RouteType from(String uri) {
getInputs().add(new FromType(uri));
return this;
}
// Properties
- //-----------------------------------------------------------------------
+ // -----------------------------------------------------------------------
public List<InterceptorRef> getInterceptors() {
return interceptors;
@@ -146,7 +147,7 @@
}
// Implementation methods
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
protected void addRoutes(Collection<Route> routes, FromType fromType) throws Exception {
RouteContext routeContext = new RouteContext(this, fromType, routes);
@@ -166,9 +167,8 @@
}
List<InterceptorRef> list = output.getInterceptors();
if (list == null) {
- log.warn("No interceptor collection: " + output);
- }
- else {
+ LOG.warn("No interceptor collection: " + output);
+ } else {
list.addAll(getInterceptors());
}
}
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutesType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutesType.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutesType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutesType.java Tue Aug 7 11:35:48 2007
@@ -1,4 +1,4 @@
-/*
+/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -16,10 +16,8 @@
*/
package org.apache.camel.model;
-import org.apache.camel.CamelContext;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Route;
-import org.apache.camel.processor.DelegateProcessor;
+import java.util.ArrayList;
+import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@@ -27,8 +25,11 @@
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
-import java.util.ArrayList;
-import java.util.List;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Route;
+import org.apache.camel.processor.DelegateProcessor;
/**
* Represents a collection of routes
@@ -38,8 +39,10 @@
@XmlRootElement(name = "routes")
@XmlAccessorType(XmlAccessType.FIELD)
public class RoutesType implements RouteContainer {
+
+ // TODO: not sure how else to use an optional attribute in JAXB2
@XmlAttribute
- private Boolean inheritErrorHandlerFlag = Boolean.TRUE; // TODO not sure how else to use an optional attribute in JAXB2
+ private Boolean inheritErrorHandlerFlag = Boolean.TRUE;
@XmlElementRef
private List<RouteType> routes = new ArrayList<RouteType>();
@XmlTransient
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitterType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitterType.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitterType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitterType.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,15 +16,15 @@
*/
package org.apache.camel.model;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
import org.apache.camel.Expression;
import org.apache.camel.Processor;
import org.apache.camel.impl.RouteContext;
import org.apache.camel.model.language.ExpressionType;
import org.apache.camel.processor.Splitter;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
/**
* @version $Revision: 1.1 $
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThrottlerType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThrottlerType.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThrottlerType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThrottlerType.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,9 +16,8 @@
*/
package org.apache.camel.model;
-import org.apache.camel.Processor;
-import org.apache.camel.impl.RouteContext;
-import org.apache.camel.processor.Throttler;
+import java.util.ArrayList;
+import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@@ -27,8 +25,10 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
+
+import org.apache.camel.Processor;
+import org.apache.camel.impl.RouteContext;
+import org.apache.camel.processor.Throttler;
/**
* @version $Revision: 1.1 $
@@ -54,7 +54,8 @@
@Override
public String toString() {
- return "Throttler[" + getMaximumRequestsPerPeriod() + " request per " + getTimePeriodMillis() + " millis -> " + getOutputs() + "]";
+ return "Throttler[" + getMaximumRequestsPerPeriod() + " request per " + getTimePeriodMillis()
+ + " millis -> " + getOutputs() + "]";
}
@Override
@@ -64,7 +65,7 @@
}
// Fluent API
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
/**
* Sets the time period during which the maximum request count is valid for
@@ -75,7 +76,7 @@
}
// Properties
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
public Long getMaximumRequestsPerPeriod() {
return maximumRequestsPerPeriod;
@@ -108,4 +109,4 @@
public void setOutputs(List<ProcessorType> outputs) {
this.outputs = outputs;
}
-}
\ No newline at end of file
+}
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ToType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ToType.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ToType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ToType.java Tue Aug 7 11:35:48 2007
@@ -1,4 +1,4 @@
-/*
+/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -16,10 +16,9 @@
*/
package org.apache.camel.model;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Processor;
-import org.apache.camel.impl.RouteContext;
-import org.apache.camel.processor.SendProcessor;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@@ -27,13 +26,15 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Processor;
+import org.apache.camel.impl.RouteContext;
+import org.apache.camel.processor.SendProcessor;
/**
* Represents an XML <to/> element
- *
+ *
* @version $Revision: $
*/
@XmlRootElement(name = "to")
@@ -78,14 +79,14 @@
}
// Properties
- //-----------------------------------------------------------------------
+ // -----------------------------------------------------------------------
public String getUri() {
return uri;
}
/**
* Sets the URI of the endpoint to use
- *
+ *
* @param uri the endpoint URI to use
*/
public void setUri(String uri) {
@@ -97,8 +98,9 @@
}
/**
- * Sets the name of the endpoint within the registry (such as the Spring ApplicationContext or JNDI) to use
- *
+ * Sets the name of the endpoint within the registry (such as the Spring
+ * ApplicationContext or JNDI) to use
+ *
* @param ref the reference name to use
*/
public void setRef(String ref) {
@@ -124,4 +126,4 @@
public void setInterceptors(List<InterceptorRef> interceptors) {
this.interceptors = interceptors;
}
-}
\ No newline at end of file
+}
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/TryType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/TryType.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/TryType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/TryType.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,22 +16,20 @@
*/
package org.apache.camel.model;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Processor;
-import org.apache.camel.ValidationException;
-import org.apache.camel.impl.RouteContext;
-import org.apache.camel.processor.CatchProcessor;
-import org.apache.camel.processor.TryProcessor;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Processor;
+import org.apache.camel.impl.RouteContext;
+import org.apache.camel.processor.CatchProcessor;
+import org.apache.camel.processor.TryProcessor;
/**
* @version $Revision: 1.1 $
@@ -40,12 +37,11 @@
@XmlRootElement(name = "try")
@XmlAccessorType(XmlAccessType.FIELD)
public class TryType extends OutputType {
-/*
- @XmlElement(required = false)
- private List<InterceptorRef> interceptors = new ArrayList<InterceptorRef>();
- @XmlElementRef
- private List<ProcessorType> outputs = new ArrayList<ProcessorType>();
-*/
+ /*
+ * @XmlElement(required = false) private List<InterceptorRef> interceptors =
+ * new ArrayList<InterceptorRef>(); @XmlElementRef private List<ProcessorType>
+ * outputs = new ArrayList<ProcessorType>();
+ */
@XmlTransient
private List<CatchType> catchClauses;
@XmlTransient
@@ -78,7 +74,7 @@
}
// Fluent API
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
public CatchType handle(Class<?> exceptionType) {
CatchType answer = new CatchType(exceptionType);
getOutputs().add(answer);
@@ -122,7 +118,7 @@
}
// Properties
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
public List<CatchType> getCatchClauses() {
if (catchClauses == null) {
@@ -150,7 +146,6 @@
super.setOutputs(outputs);
}
-
public void addOutput(ProcessorType output) {
initialized = false;
getOutputs().add(output);
@@ -168,20 +163,18 @@
for (ProcessorType output : outputs) {
if (output instanceof CatchType) {
- catchClauses.add((CatchType) output);
- }
- else if (output instanceof FinallyType) {
+ catchClauses.add((CatchType)output);
+ } else if (output instanceof FinallyType) {
if (finallyClause != null) {
- throw new IllegalArgumentException("Multiple finally clauses added: " + finallyClause + " and " + output);
+ throw new IllegalArgumentException("Multiple finally clauses added: " + finallyClause
+ + " and " + output);
+ } else {
+ finallyClause = (FinallyType)output;
}
- else {
- finallyClause = (FinallyType) output;
- }
- }
- else {
+ } else {
outputsWithoutCatches.add(output);
}
}
}
}
-}
\ No newline at end of file
+}
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/WhenType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/WhenType.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/WhenType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/WhenType.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,12 +16,12 @@
*/
package org.apache.camel.model;
+import javax.xml.bind.annotation.XmlRootElement;
+
import org.apache.camel.Predicate;
import org.apache.camel.impl.RouteContext;
import org.apache.camel.model.language.ExpressionType;
import org.apache.camel.processor.FilterProcessor;
-
-import javax.xml.bind.annotation.XmlRootElement;
/**
* @version $Revision: 1.1 $
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ELExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ELExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ELExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ELExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ExpressionType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ExpressionType.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ExpressionType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ExpressionType.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,13 +16,6 @@
*/
package org.apache.camel.model.language;
-import org.apache.camel.CamelContext;
-import org.apache.camel.Exchange;
-import org.apache.camel.Expression;
-import org.apache.camel.Predicate;
-import org.apache.camel.impl.RouteContext;
-import org.apache.camel.spi.Language;
-
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
@@ -33,6 +25,13 @@
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.Expression;
+import org.apache.camel.Predicate;
+import org.apache.camel.impl.RouteContext;
+import org.apache.camel.spi.Language;
/**
* A useful base class for an expression
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/GroovyExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/GroovyExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/GroovyExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/GroovyExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/HeaderExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/HeaderExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/HeaderExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/HeaderExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/LanguageExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/LanguageExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/LanguageExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/LanguageExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/OgnlExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/OgnlExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/OgnlExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/OgnlExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PhpExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PhpExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PhpExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PhpExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PythonExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PythonExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PythonExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PythonExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/RubyExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/RubyExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/RubyExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/RubyExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SimpleExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SimpleExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SimpleExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SimpleExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SqlExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SqlExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SqlExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SqlExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/package-info.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/package-info.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/package-info.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/package-info.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,4 +14,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://activemq.apache.org/camel/schema/spring", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.camel.model.language;
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://activemq.apache.org/camel/schema/spring", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.apache.camel.model.language;
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/package-info.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/package-info.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/package-info.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/package-info.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,4 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://activemq.apache.org/camel/schema/spring", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.camel.model;
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://activemq.apache.org/camel/schema/spring", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.apache.camel.model;
+
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Aggregator.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Aggregator.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Aggregator.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Aggregator.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,23 +23,28 @@
import org.apache.camel.processor.aggregate.AggregationStrategy;
/**
- * An implementation of the <a href="http://activemq.apache.org/camel/aggregator.html">Aggregator</a> pattern
- * where a batch of messages are processed (up to a maximum amount or until some timeout is reached)
- * and messages for the same correlation key are combined together using some kind of
- * {@link AggregationStrategy ) (by default the latest message is used) to compress many message exchanges
- * into a smaller number of exchanges.
- * <p/>
- * A good example of this is stock market data; you may be receiving 30,000 messages/second and you may want to
- * throttle it right down so that multiple messages for the same stock are combined (or just the latest
- * message is used and older prices are discarded). Another idea is to combine line item messages together
- * into a single invoice message.
- *
+ * An implementation of the <a
+ * href="http://activemq.apache.org/camel/aggregator.html">Aggregator</a>
+ * pattern where a batch of messages are processed (up to a maximum amount or
+ * until some timeout is reached) and messages for the same correlation key are
+ * combined together using some kind of
+ * {@link AggregationStrategy ) (by default the latest message is used) to compress
+ * many message exchanges * into a smaller number of exchanges. <p/> A good
+ * example of this is stock market data; you may be receiving 30,000
+ * messages/second and you may want to throttle it right down so that multiple
+ * messages for the same stock are combined (or just the latest message is used
+ * and older prices are discarded). Another idea is to combine line item
+ * messages together into a single invoice message.
+ *
* @version $Revision: 1.1 $
- * @param correlationExpression the expression used to calculate the correlation key. For a JMS message this could
- * be the expression <code>header("JMSDestination")</code> or <code>header("JMSCorrelationID")</code>
+ * @param correlationExpression the expression used to calculate the correlation
+ * key. For a JMS message this could be the expression
+ * <code>header("JMSDestination")</code> or
+ * <code>header("JMSCorrelationID")</code>
*/
public class Aggregator extends BatchProcessor {
- public Aggregator(Endpoint endpoint, Processor processor, Expression correlationExpression, AggregationStrategy aggregationStrategy) {
+ public Aggregator(Endpoint endpoint, Processor processor, Expression correlationExpression,
+ AggregationStrategy aggregationStrategy) {
this(endpoint, processor, new AggregationCollection(correlationExpression, aggregationStrategy));
}
@@ -52,4 +56,4 @@
public String toString() {
return "Aggregator[to: " + getProcessor() + "]";
}
-}
\ No newline at end of file
+}
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/BatchProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/BatchProcessor.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/BatchProcessor.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/BatchProcessor.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,6 +16,9 @@
*/
package org.apache.camel.processor;
+import java.util.Collection;
+import java.util.Iterator;
+
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.PollingConsumer;
@@ -28,16 +30,14 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.Collection;
-import java.util.Iterator;
-
/**
- * A base class for any kind of {@link Processor} which implements some kind of batch processing.
- *
+ * A base class for any kind of {@link Processor} which implements some kind of
+ * batch processing.
+ *
* @version $Revision: 1.1 $
*/
public class BatchProcessor extends ServiceSupport implements Runnable {
- private static final transient Log log = LogFactory.getLog(Resequencer.class);
+ private static final transient Log LOG = LogFactory.getLog(Resequencer.class);
private Endpoint endpoint;
private Processor processor;
private Collection<Exchange> collection;
@@ -58,12 +58,11 @@
}
public void run() {
- log.debug("Starting thread for " + this);
+ LOG.debug("Starting thread for " + this);
while (!isStopped() && !isStopping()) {
try {
processBatch();
- }
- catch (Exception e) {
+ } catch (Exception e) {
getExceptionHandler().handleException(e);
}
}
@@ -71,7 +70,7 @@
}
// Properties
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
public ExceptionHandler getExceptionHandler() {
if (exceptionHandler == null) {
exceptionHandler = new LoggingExceptionHandler(getClass());
@@ -108,8 +107,8 @@
}
/**
- * A transactional method to process a batch of messages up to a timeout period
- * or number of messages reached.
+ * A transactional method to process a batch of messages up to a timeout
+ * period or number of messages reached.
*/
protected synchronized void processBatch() throws Exception {
long start = System.currentTimeMillis();
@@ -124,8 +123,9 @@
collection.add(exchange);
}
- if (log.isDebugEnabled()) {
- log.debug("Finsihed batch size: " + batchSize + " timeout: " + batchTimeout + " so sending set: " + collection);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Finsihed batch size: " + batchSize + " timeout: " + batchTimeout + " so sending set: "
+ + collection);
}
// lets send the batch
@@ -138,8 +138,9 @@
}
/**
- * Strategy Method to process an exchange in the batch. This method allows derived classes
- * to perform custom processing before or after an individual exchange is processed
+ * Strategy Method to process an exchange in the batch. This method allows
+ * derived classes to perform custom processing before or after an
+ * individual exchange is processed
*/
protected void processExchange(Exchange exchange) throws Exception {
processor.process(exchange);
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CatchProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CatchProcessor.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CatchProcessor.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CatchProcessor.java Tue Aug 7 11:35:48 2007
@@ -1,4 +1,4 @@
-/*
+/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -16,11 +16,9 @@
*/
package org.apache.camel.processor;
-import org.apache.camel.Processor;
-import org.apache.camel.Exchange;
-import org.apache.camel.impl.ServiceSupport;
-
import java.util.List;
+
+import org.apache.camel.Processor;
/**
* @version $Revision: $
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ChoiceProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ChoiceProcessor.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ChoiceProcessor.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ChoiceProcessor.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,19 +16,20 @@
*/
package org.apache.camel.processor;
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.camel.Exchange;
import org.apache.camel.Predicate;
import org.apache.camel.Processor;
import org.apache.camel.impl.ServiceSupport;
import org.apache.camel.util.ServiceHelper;
-import java.util.ArrayList;
-import java.util.List;
-
/**
- * Implements a Choice structure where one or more predicates are used which if they are true their processors
- * are used, with a default otherwise clause used if none match.
- *
+ * Implements a Choice structure where one or more predicates are used which if
+ * they are true their processors are used, with a default otherwise clause used
+ * if none match.
+ *
* @version $Revision$
*/
public class ChoiceProcessor extends ServiceSupport implements Processor {
@@ -61,8 +61,7 @@
for (FilterProcessor processor : filters) {
if (first) {
first = false;
- }
- else {
+ } else {
builder.append(", ");
}
builder.append("when ");
@@ -85,7 +84,6 @@
public Processor getOtherwise() {
return otherwise;
}
-
protected void doStart() throws Exception {
ServiceHelper.startServices(filters);
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CompositeProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CompositeProcessor.java?view=diff&rev=563607&r1=563606&r2=563607
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CompositeProcessor.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CompositeProcessor.java Tue Aug 7 11:35:48 2007
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,16 +16,17 @@
*/
package org.apache.camel.processor;
+import java.util.Collection;
+
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.impl.ServiceSupport;
import org.apache.camel.util.ServiceHelper;
-import java.util.Collection;
-
/**
- * Represents a composite pattern, aggregating a collection of processors together as a single processor
- *
+ * Represents a composite pattern, aggregating a collection of processors
+ * together as a single processor
+ *
* @version $Revision$
*/
public class CompositeProcessor extends ServiceSupport implements Processor {
@@ -49,8 +49,7 @@
for (Processor processor : processors) {
if (first) {
first = false;
- }
- else {
+ } else {
builder.append(", ");
}
builder.append(processor.toString());