Author: ningjiang
Date: Sun Jun 28 16:04:20 2009
New Revision: 789117
URL: http://svn.apache.org/viewvc?rev=789117&view=rev
Log:
Fixed the cs errors in camel-core
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/PollingConsumerPollStrategy.java
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptor.java
camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/PollingConsumerPollStrategy.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/PollingConsumerPollStrategy.java?rev=789117&r1=789116&r2=789117&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/PollingConsumerPollStrategy.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/PollingConsumerPollStrategy.java
Sun Jun 28 16:04:20 2009
@@ -33,7 +33,7 @@
* @param consumer the consumer
* @param endpoint the endpoint being consumed
*/
- public void begin(Consumer consumer, Endpoint endpoint);
+ void begin(Consumer consumer, Endpoint endpoint);
/**
* Called when poll is completed sucesfully
@@ -41,7 +41,7 @@
* @param consumer the consumer
* @param endpoint the endpoint being consumed
*/
- public void commit(Consumer consumer, Endpoint endpoint);
+ void commit(Consumer consumer, Endpoint endpoint);
/**
* Called when poll failed
@@ -51,6 +51,6 @@
* @param cause the caused exception
* @throws Exception can be used to rethrow the caused exception
*/
- public void rollback(Consumer consumer, Endpoint endpoint, Exception
cause) throws Exception;
+ void rollback(Consumer consumer, Endpoint endpoint, Exception cause)
throws Exception;
}
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java?rev=789117&r1=789116&r2=789117&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponent.java
Sun Jun 28 16:04:20 2009
@@ -17,7 +17,6 @@
package org.apache.camel.impl;
import java.net.URI;
-import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledExecutorService;
@@ -27,11 +26,11 @@
import org.apache.camel.Endpoint;
import org.apache.camel.ResolveEndpointFailedException;
import org.apache.camel.util.CamelContextHelper;
+import org.apache.camel.util.EndpointHelper;
import org.apache.camel.util.IntrospectionSupport;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.URISupport;
import org.apache.camel.util.UnsafeUriCharactersEncoder;
-import org.apache.camel.util.EndpointHelper;
import org.apache.camel.util.concurrent.ExecutorServiceHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptor.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptor.java?rev=789117&r1=789116&r2=789117&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptor.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptor.java
Sun Jun 28 16:04:20 2009
@@ -16,6 +16,7 @@
*/
package org.apache.camel.processor.interceptor;
+import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@@ -178,15 +179,14 @@
return formatter;
}
+
// Implementation methods
//-------------------------------------------------------------------------
-
protected boolean beforeOnException(OnExceptionDefinition onException,
TraceableUnitOfWork tuow, Exchange exchange) throws Exception {
// lets see if this is the first time for this exception
int index = tuow.getAndIncrement(node);
if (index == 0) {
- // yes its first time then do some special to log and trace the
start of onException
- Expression exp = new Expression() {
+ class OnExceptionExpression implements Expression {
@SuppressWarnings("unchecked")
public Object evaluate(Exchange exchange, Class type) {
String label = "OnException";
@@ -195,11 +195,16 @@
}
return
exchange.getContext().getTypeConverter().convertTo(type, label);
}
- };
+
+ }
+ // yes its first time then do some special to log and trace the
+ // start of onException
+ Expression exp = new OnExceptionExpression();
+
// add our pesudo node
tuow.addTraced(new DefaultRouteNode(node, exp));
- // log and trace the processor that was onException so we can see
it imeddiately
+ // log and trace the processor that was onException so we can see
immediately
logExchange(exchange);
traceExchange(exchange);
}
@@ -208,6 +213,7 @@
tuow.addTraced(new DefaultRouteNode(node, super.getProcessor()));
return true;
}
+
protected boolean beforeOnCompletion(OnCompletionDefinition onCompletion,
TraceableUnitOfWork tuow, Exchange exchange) throws Exception {
// we should only trace when we do the actual onCompletion
@@ -220,19 +226,20 @@
if (exchange.getProperty(Exchange.ON_COMPLETION) != null) {
// if ON_COMPLETION is not null then we are actually doing the
onCompletion routing
-
+
// we should trace the onCompletion route and we want a start log
of the onCompletion
// step so get the index and see if its 0 then we can add our
speical log
int index = tuow.getAndIncrement(node);
if (index == 0) {
- // yes its first time then do some special to log and trace
the start of onCompletion
- Expression exp = new Expression() {
+ class OnCompletionExpression implements Expression {
@SuppressWarnings("unchecked")
public Object evaluate(Exchange exchange, Class type) {
String label = "OnCompletion[" +
exchange.getProperty(Exchange.CORRELATION_ID) + "]";
return
exchange.getContext().getTypeConverter().convertTo(type, label);
}
- };
+ }
+ // yes its first time then do some special to log and trace
the start of onCompletion
+ Expression exp = new OnCompletionExpression();
// add the onCompletion and then the processor that is invoked
nest
tuow.addTraced(new DefaultRouteNode(node, exp));
tuow.addTraced(new DefaultRouteNode(node,
super.getProcessor()));
Modified:
camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java?rev=789117&r1=789116&r2=789117&view=diff
==============================================================================
---
camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java
(original)
+++
camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateTest.java
Sun Jun 28 16:04:20 2009
@@ -88,7 +88,7 @@
out = template.requestBodyAndHeader("direct:inout", "Hello", "foo",
"bar", Integer.class);
assertEquals(new Integer(123), out);
- Map headers = new HashMap();
+ Map<String, Object> headers = new HashMap<String, Object>();
out = template.requestBodyAndHeaders("direct:inout", "Hello", headers,
Integer.class);
assertEquals(new Integer(123), out);
@@ -100,7 +100,7 @@
out = template.requestBodyAndHeader(endpoint, "Hello", "foo", "bar",
Integer.class);
assertEquals(new Integer(123), out);
- headers = new HashMap();
+ headers = new HashMap<String, Object>();
out = template.requestBodyAndHeaders(endpoint, "Hello", headers,
Integer.class);
assertEquals(new Integer(123), out);
}