Author: ningjiang
Date: Fri May 23 03:26:49 2008
New Revision: 659491
URL: http://svn.apache.org/viewvc?rev=659491&view=rev
Log:
Fixed some CS errors
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileProcessStrategyFactory.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultRouteContext.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/HandleFaultType.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OptionalIdentifiedType.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RouteType.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/HandleFaultProcessor.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThreadProcessor.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Breakpoint.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/DebugInterceptor.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Debugger.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/debug/DebugTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringFaultRouteTest.java
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
Fri May 23 03:26:49 2008
@@ -273,58 +273,63 @@
* A strategy method to lazily create the file strategy
*/
protected FileProcessStrategy createFileStrategy() {
- Class factory = null;
- try {
- FactoryFinder finder = new
FactoryFinder("META-INF/services/org/apache/camel/component/");
- factory = finder.findClass("file", "strategy.factory.");
- } catch (ClassNotFoundException e) {
- LOG.debug("'strategy.factory.class' not found", e);
- } catch (IOException e) {
- LOG.debug("No strategy factory defined in
'META-INF/services/org/apache/camel/component/file'", e);
- }
-
- if (factory == null) {
- // use default
- ClassLoader cl =
Thread.currentThread().getContextClassLoader();
- try {
- factory =
cl.loadClass("org.apache.camel.component.file.strategy.FileProcessStrategyFactory");
- } catch (ClassNotFoundException e) {
- throw new
TypeNotPresentException("FileProcessStrategyFactory class not found", e);
- }
- }
-
- try {
- Method factoryMethod =
factory.getMethod("createFileProcessStrategy", Properties.class);
- return (FileProcessStrategy)
ObjectHelper.invokeMethod(factoryMethod, null, getParamsAsProperties());
- } catch (NoSuchMethodException e) {
- throw new
TypeNotPresentException(factory.getSimpleName()
- + ".createFileProcessStrategy(Properties params) moethod not
found", e);
- }
+ Class factory = null;
+ try {
+ FactoryFinder finder = new
FactoryFinder("META-INF/services/org/apache/camel/component/");
+ factory = finder.findClass("file", "strategy.factory.");
+ } catch (ClassNotFoundException e) {
+ LOG.debug("'strategy.factory.class' not found", e);
+ } catch (IOException e) {
+ LOG
+ .debug("No strategy factory defined in
'META-INF/services/org/apache/camel/component/file'",
+ e);
+ }
+
+ if (factory == null) {
+ // use default
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ try {
+ factory =
cl.loadClass("org.apache.camel.component.file.strategy.FileProcessStrategyFactory");
+ } catch (ClassNotFoundException e) {
+ throw new TypeNotPresentException("FileProcessStrategyFactory
class not found", e);
+ }
+ }
+
+ try {
+ Method factoryMethod =
factory.getMethod("createFileProcessStrategy", Properties.class);
+ return
(FileProcessStrategy)ObjectHelper.invokeMethod(factoryMethod, null,
+
getParamsAsProperties());
+ } catch (NoSuchMethodException e) {
+ throw new TypeNotPresentException(
+ factory.getSimpleName()
+ +
".createFileProcessStrategy(Properties params) moethod not found",
+ e);
+ }
}
protected Properties getParamsAsProperties() {
- Properties params = new Properties();
- if (isNoop()) {
- params.setProperty("noop",
Boolean.toString(Boolean.TRUE));
- }
- if (isDelete()) {
- params.setProperty("delete",
Boolean.toString(Boolean.TRUE));
- }
- if (isAppend()) {
- params.setProperty("append",
Boolean.toString(Boolean.TRUE));
- }
- if (isLock()) {
- params.setProperty("lock",
Boolean.toString(Boolean.TRUE));
- }
- if (moveNamePrefix != null) {
- params.setProperty("moveNamePrefix", moveNamePrefix);
- }
- if (moveNamePostfix != null) {
- params.setProperty("moveNamePostfix", moveNamePostfix);
- }
- return params;
+ Properties params = new Properties();
+ if (isNoop()) {
+ params.setProperty("noop", Boolean.toString(Boolean.TRUE));
+ }
+ if (isDelete()) {
+ params.setProperty("delete", Boolean.toString(Boolean.TRUE));
+ }
+ if (isAppend()) {
+ params.setProperty("append", Boolean.toString(Boolean.TRUE));
+ }
+ if (isLock()) {
+ params.setProperty("lock", Boolean.toString(Boolean.TRUE));
+ }
+ if (moveNamePrefix != null) {
+ params.setProperty("moveNamePrefix", moveNamePrefix);
+ }
+ if (moveNamePostfix != null) {
+ params.setProperty("moveNamePostfix", moveNamePostfix);
+ }
+ return params;
}
-
+
@Override
protected String createEndpointUri() {
return "file://" + getFile().getAbsolutePath();
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileProcessStrategyFactory.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileProcessStrategyFactory.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileProcessStrategyFactory.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileProcessStrategyFactory.java
Fri May 23 03:26:49 2008
@@ -34,17 +34,17 @@
*/
public static FileProcessStrategy createFileProcessStrategy(Properties
params) {
- // We assume a value is present only if its value not null for String
and 'true' for boolean
- boolean isDelete = params.getProperty("delete") != null;
- boolean isLock = params.getProperty("lock") != null;
- String moveNamePrefix = params.getProperty("moveNamePrefix");
- String moveNamePostfix = params.getProperty("moveNamePostfix");
-
+ // We assume a value is present only if its value not null for String
and 'true' for boolean
+ boolean isDelete = params.getProperty("delete") != null;
+ boolean isLock = params.getProperty("lock") != null;
+ String moveNamePrefix = params.getProperty("moveNamePrefix");
+ String moveNamePostfix = params.getProperty("moveNamePostfix");
+
if (params.getProperty("noop") != null) {
return new NoOpFileProcessStrategy();
} else if (moveNamePostfix != null || moveNamePrefix != null) {
if (isDelete) {
- throw new IllegalArgumentException("You cannot set the
deleteFiles property "
+ throw new IllegalArgumentException("You cannot set the
deleteFiles property "
+ "and a moveFilenamePostfix or moveFilenamePrefix");
}
return new RenameFileProcessStrategy(isLock, moveNamePrefix,
moveNamePostfix);
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
Fri May 23 03:26:49 2008
@@ -43,19 +43,21 @@
import org.apache.camel.spi.ComponentResolver;
import org.apache.camel.spi.ExchangeConverter;
import org.apache.camel.spi.Injector;
+import org.apache.camel.spi.InterceptStrategy;
import org.apache.camel.spi.Language;
import org.apache.camel.spi.LanguageResolver;
import org.apache.camel.spi.LifecycleStrategy;
import org.apache.camel.spi.Registry;
-import org.apache.camel.spi.InterceptStrategy;
import org.apache.camel.util.FactoryFinder;
import org.apache.camel.util.NoFactoryAvailableException;
import org.apache.camel.util.ObjectHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import static org.apache.camel.util.ServiceHelper.startServices;
import static org.apache.camel.util.ServiceHelper.stopServices;
+
/**
* Represents the context used to configure routes and the policies to use.
*
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultRouteContext.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultRouteContext.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultRouteContext.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultRouteContext.java
Fri May 23 03:26:49 2008
@@ -35,8 +35,8 @@
import org.apache.camel.processor.Pipeline;
import org.apache.camel.processor.ProceedProcessor;
import org.apache.camel.processor.UnitOfWorkProcessor;
-import org.apache.camel.spi.RouteContext;
import org.apache.camel.spi.InterceptStrategy;
+import org.apache.camel.spi.RouteContext;
/**
* The context used to activate new routing rules
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/HandleFaultType.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/HandleFaultType.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/HandleFaultType.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/HandleFaultType.java
Fri May 23 03:26:49 2008
@@ -28,10 +28,10 @@
@XmlRootElement(name = "handleFault")
@XmlAccessorType(XmlAccessType.FIELD)
public class HandleFaultType extends InterceptorRef {
-
+
public HandleFaultType() {
- super(new HandleFaultProcessor());
- }
+ super(new HandleFaultProcessor());
+ }
@Override
public String toString() {
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OptionalIdentifiedType.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OptionalIdentifiedType.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OptionalIdentifiedType.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OptionalIdentifiedType.java
Fri May 23 03:26:49 2008
@@ -23,8 +23,8 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlID;
-import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@@ -36,14 +36,15 @@
@XmlType(name = "optionalIdentifiedType")
@XmlAccessorType(XmlAccessType.FIELD)
public abstract class OptionalIdentifiedType<T extends OptionalIdentifiedType>
{
+ @XmlTransient
+ protected static AtomicInteger nodeCounter = new AtomicInteger(1);
@XmlAttribute(required = false)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
private String id;
@XmlElement(required = false)
private Description description;
- @XmlTransient
- protected static AtomicInteger nodeCounter = new AtomicInteger(1);
+
/**
* Gets the value of the id property.
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?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
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
Fri May 23 03:26:49 2008
@@ -61,8 +61,8 @@
import org.apache.camel.processor.idempotent.MessageIdRepository;
import org.apache.camel.spi.DataFormat;
import org.apache.camel.spi.InterceptStrategy;
-import org.apache.camel.spi.RouteContext;
import org.apache.camel.spi.Policy;
+import org.apache.camel.spi.RouteContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
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?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
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
Fri May 23 03:26:49 2008
@@ -33,9 +33,8 @@
import org.apache.camel.Endpoint;
import org.apache.camel.NoSuchEndpointException;
import org.apache.camel.Route;
-import org.apache.camel.processor.interceptor.StreamCachingInterceptor;
-import org.apache.camel.processor.DelegateProcessor;
import org.apache.camel.impl.DefaultRouteContext;
+import org.apache.camel.processor.interceptor.StreamCachingInterceptor;
import org.apache.camel.spi.RouteContext;
import org.apache.camel.util.CamelContextHelper;
import org.apache.commons.logging.Log;
@@ -186,7 +185,7 @@
* Enable stream caching on this route
* @param streamCaching <code>true</code> for enabling stream caching
*/
- @XmlAttribute(required=false)
+ @XmlAttribute(required = false)
public void setStreamCaching(Boolean streamCaching) {
this.streamCaching = streamCaching;
if (streamCaching != null && streamCaching) {
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/HandleFaultProcessor.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/HandleFaultProcessor.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/HandleFaultProcessor.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/HandleFaultProcessor.java
Fri May 23 03:26:49 2008
@@ -22,21 +22,21 @@
public class HandleFaultProcessor extends DelegateProcessor {
- @Override
- public void process(Exchange exchange) throws Exception {
- super.process(exchange);
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ super.process(exchange);
final Message faultMessage = exchange.getFault(false);
if (faultMessage != null) {
final Object faultBody = faultMessage.getBody();
if (faultBody != null) {
- if (faultBody instanceof Throwable) {
- exchange.setException((Throwable)faultBody);
- } else {
- exchange.setException(new CamelException(
- "Message contains fault of type " +
- faultBody.getClass().getName() + ":\n" +
faultBody));
- }
+ if (faultBody instanceof Throwable) {
+ exchange.setException((Throwable)faultBody);
+ } else {
+ exchange.setException(new CamelException("Message contains
fault of type "
+ +
faultBody.getClass().getName() + ":\n"
+ + faultBody));
+ }
}
}
- }
+ }
}
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThreadProcessor.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThreadProcessor.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThreadProcessor.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThreadProcessor.java
Fri May 23 03:26:49 2008
@@ -79,8 +79,8 @@
try {
executor.execute(call);
return false;
- } catch ( RejectedExecutionException e ) {
- if( callerRunsWhenRejected ) {
+ } catch (RejectedExecutionException e) {
+ if (callerRunsWhenRejected) {
if (shutdown.get()) {
exchange.setException(new RejectedExecutionException());
} else {
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Breakpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Breakpoint.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Breakpoint.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Breakpoint.java
Fri May 23 03:26:49 2008
@@ -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/processor/interceptor/DebugInterceptor.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/DebugInterceptor.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/DebugInterceptor.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/DebugInterceptor.java
Fri May 23 03:26:49 2008
@@ -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,
@@ -19,16 +18,16 @@
import java.util.List;
-import org.apache.camel.model.ProcessorType;
-import org.apache.camel.Processor;
import org.apache.camel.Exchange;
-import org.apache.camel.Predicate;
import org.apache.camel.Message;
+import org.apache.camel.Predicate;
+import org.apache.camel.Processor;
+import org.apache.camel.model.ProcessorType;
import org.apache.camel.processor.DelegateProcessor;
/**
* An interceptor for debugging and tracing routes
- *
+ *
* @version $Revision: 1.1 $
*/
public class DebugInterceptor extends DelegateProcessor {
@@ -49,7 +48,7 @@
}
public void process(Exchange exchange) throws Exception {
- checkForBreakpoint(exchange);
+ checkForBreakpoint(exchange);
addTraceExchange(exchange);
super.proceed(exchange);
}
@@ -107,6 +106,6 @@
* Returns true if the given exchange should be logged in the trace list
*/
protected boolean shouldTraceExchange(Exchange exchange) {
- return traceFilter == null || traceFilter.matches(exchange) ;
+ return traceFilter == null || traceFilter.matches(exchange);
}
}
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Debugger.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Debugger.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Debugger.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Debugger.java
Fri May 23 03:26:49 2008
@@ -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,14 +16,14 @@
*/
package org.apache.camel.processor.interceptor;
-import java.util.Map;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
-import java.util.ArrayList;
+import java.util.Map;
-import org.apache.camel.Processor;
-import org.apache.camel.Exchange;
import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.model.ProcessorType;
import org.apache.camel.spi.InterceptStrategy;
@@ -53,9 +52,9 @@
DefaultCamelContext defaultCamelContext = (DefaultCamelContext)
context;
List<InterceptStrategy> list =
defaultCamelContext.getInterceptStrategies();
for (InterceptStrategy interceptStrategy : list) {
- if (interceptStrategy instanceof Debugger) {
- return (Debugger) interceptStrategy;
- }
+ if (interceptStrategy instanceof Debugger) {
+ return (Debugger)interceptStrategy;
+ }
}
}
return null;
@@ -72,8 +71,7 @@
DebugInterceptor interceptor = getInterceptor(id);
if (interceptor == null) {
return null;
- }
- else {
+ } else {
return interceptor.getExchanges();
}
}
@@ -85,8 +83,7 @@
DebugInterceptor interceptor = getInterceptor(id);
if (interceptor == null) {
return null;
- }
- else {
+ } else {
return interceptor.getBreakpoint();
}
}
@@ -105,13 +102,11 @@
protected List<Exchange> createExchangeList() {
if (exchangeBufferSize == 0) {
return null;
- }
- else if (exchangeBufferSize > 0) {
+ } else if (exchangeBufferSize > 0) {
// TODO lets create a non blocking fixed size queue
return new ArrayList<Exchange>();
- }
- else {
- return new ArrayList<Exchange>();
+ } else {
+ return new ArrayList<Exchange>();
}
}
}
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java
Fri May 23 03:26:49 2008
@@ -22,13 +22,10 @@
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
-import org.apache.camel.Route;
import org.apache.camel.model.FromType;
import org.apache.camel.model.ProcessorType;
import org.apache.camel.model.RouteType;
import org.apache.camel.processor.Interceptor;
-import org.apache.camel.spi.RouteContext;
-import org.apache.camel.spi.InterceptStrategy;
/**
* The context used to activate new routing rules
@@ -69,7 +66,7 @@
* Lets complete the route creation, creating a single event driven route
* for the current from endpoint with any processors required
*/
- public void commit();
+ void commit();
void addEventDrivenProcessor(Processor processor);
@@ -92,5 +89,5 @@
void setInterceptStrategies(List<InterceptStrategy> interceptStrategies);
void addInterceptStrategy(InterceptStrategy interceptStrategy);
-
+
}
\ No newline at end of file
Modified:
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java
(original)
+++
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java
Fri May 23 03:26:49 2008
@@ -92,10 +92,10 @@
}
private void throwFaultTest(String startPoint) throws InterruptedException
{
- throwFaultTest(startPoint, 0);
+ throwFaultTest(startPoint, 0);
}
-
- private void throwFaultTest(String startPoint, int errors) throws
InterruptedException {
+
+ private void throwFaultTest(String startPoint, int errors) throws
InterruptedException {
a.expectedMessageCount(1);
b.expectedMessageCount(0);
c.expectedMessageCount(0);
@@ -143,16 +143,16 @@
from("direct:exception").to("mock:a")
.throwFault(new IllegalStateException("It makes no sense
of business logic"))
.to("mock:b");
-
+
from("direct:fault").errorHandler(
deadLetterChannel("mock:error")
- .maximumRedeliveries(2)
+ .maximumRedeliveries(2)
.loggingLevel(LoggingLevel.DEBUG))
.to("mock:a").throwFault("ExceptionMessage").to("mock:b");
-
+
from("direct:error").errorHandler(
deadLetterChannel("mock:error")
- .maximumRedeliveries(2)
+ .maximumRedeliveries(2)
.loggingLevel(LoggingLevel.DEBUG))
.to("mock:a").handleFault().throwFault("ExceptionMessage").to("mock:b");
}
Modified:
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
(original)
+++
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
Fri May 23 03:26:49 2008
@@ -16,6 +16,17 @@
*/
package org.apache.camel.spring;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
import org.apache.camel.CamelContext;
import org.apache.camel.CamelTemplate;
import org.apache.camel.builder.RouteBuilder;
@@ -30,12 +41,6 @@
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
-import java.io.IOException;
-import java.util.*;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
/**
* A command line tool for booting up a CamelContext using an optional Spring
* ApplicationContext
Modified:
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/debug/DebugTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/debug/DebugTest.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/debug/DebugTest.java
(original)
+++
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/debug/DebugTest.java
Fri May 23 03:26:49 2008
@@ -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,
@@ -20,12 +19,12 @@
import java.util.List;
import junit.framework.TestCase;
-import org.apache.camel.processor.interceptor.DebugInterceptor;
-import org.apache.camel.processor.interceptor.Debugger;
-import org.apache.camel.spring.Main;
import org.apache.camel.CamelTemplate;
import org.apache.camel.Exchange;
import org.apache.camel.model.RouteType;
+import org.apache.camel.processor.interceptor.DebugInterceptor;
+import org.apache.camel.processor.interceptor.Debugger;
+import org.apache.camel.spring.Main;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified:
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringFaultRouteTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringFaultRouteTest.java?rev=659491&r1=659490&r2=659491&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringFaultRouteTest.java
(original)
+++
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringFaultRouteTest.java
Fri May 23 03:26:49 2008
@@ -33,12 +33,12 @@
@Override
public void testWithThrowFaultMessageUnhandled() throws Exception {
// Route cannot be configured due to lack of support for errorHandler
- // in the xml dsl (CAMEL-122)
+ // in the xml dsl (CAMEL-122)
}
@Override
public void testWithHandleFaultMessage() throws Exception {
// Route cannot be configured due to lack of support for errorHandler
- // in the xml dsl (CAMEL-122)
+ // in the xml dsl (CAMEL-122)
}
}