You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2009/03/01 11:34:44 UTC
svn commit: r748992 - in
/camel/trunk/camel-core/src/main/java/org/apache/camel:
management/InstrumentationErrorHandlerWrappingStrategy.java
management/InstrumentationLifecycleStrategy.java model/ProcessorType.java
spi/ErrorHandlerWrappingStrategy.java
Author: davsclaus
Date: Sun Mar 1 10:34:44 2009
New Revision: 748992
URL: http://svn.apache.org/viewvc?rev=748992&view=rev
Log:
CAMEL-541: Removed a bad tangle in camel spi. Not this package has no tangles.
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationErrorHandlerWrappingStrategy.java
camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java
camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ErrorHandlerWrappingStrategy.java
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationErrorHandlerWrappingStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationErrorHandlerWrappingStrategy.java?rev=748992&r1=748991&r2=748992&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationErrorHandlerWrappingStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationErrorHandlerWrappingStrategy.java Sun Mar 1 10:34:44 2009
@@ -29,13 +29,14 @@
public class InstrumentationErrorHandlerWrappingStrategy implements ErrorHandlerWrappingStrategy {
private Map<ProcessorType, PerformanceCounter> counterMap;
+ private RouteContext routeContext;
- public InstrumentationErrorHandlerWrappingStrategy(Map<ProcessorType, PerformanceCounter> counterMap) {
+ public InstrumentationErrorHandlerWrappingStrategy(RouteContext routeContext, Map<ProcessorType, PerformanceCounter> counterMap) {
this.counterMap = counterMap;
+ this.routeContext = routeContext;
}
- public Processor wrapProcessorInErrorHandler(RouteContext routeContext, ProcessorType processorType,
- Processor target) throws Exception {
+ public Processor wrapProcessorInErrorHandler(ProcessorType processorType, Processor target) throws Exception {
// don't wrap our instrumentation interceptors
if (counterMap.containsKey(processorType)) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java?rev=748992&r1=748991&r2=748992&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java Sun Mar 1 10:34:44 2009
@@ -29,7 +29,6 @@
import org.apache.camel.CamelContext;
import org.apache.camel.Consumer;
import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
import org.apache.camel.Route;
import org.apache.camel.Service;
import org.apache.camel.impl.DefaultCamelContext;
@@ -121,8 +120,7 @@
// retrieve the per-route intercept for this route
InstrumentationProcessor interceptor = interceptorMap.get(route.getEndpoint());
if (interceptor == null) {
- LOG.warn("Instrumentation processor not found for route endpoint "
- + route.getEndpoint());
+ LOG.warn("Instrumentation processor not found for route endpoint: " + route.getEndpoint());
} else {
interceptor.setCounter(mr);
}
@@ -187,9 +185,7 @@
}
routeContext.addInterceptStrategy(new InstrumentationInterceptStrategy(counterMap));
-
- routeContext.setErrorHandlerWrappingStrategy(
- new InstrumentationErrorHandlerWrappingStrategy(counterMap));
+ routeContext.setErrorHandlerWrappingStrategy(new InstrumentationErrorHandlerWrappingStrategy(routeContext, counterMap));
// Add an InstrumentationProcessor at the beginning of each route and
// set up the interceptorMap for onRoutesAdd() method to register the
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java?rev=748992&r1=748991&r2=748992&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java Sun Mar 1 10:34:44 2009
@@ -1985,7 +1985,7 @@
ObjectHelper.notNull(target, "target", this);
ErrorHandlerWrappingStrategy strategy = routeContext.getErrorHandlerWrappingStrategy();
if (strategy != null) {
- return strategy.wrapProcessorInErrorHandler(routeContext, this, target);
+ return strategy.wrapProcessorInErrorHandler(this, target);
}
return getErrorHandlerBuilder().createErrorHandler(routeContext, target);
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ErrorHandlerWrappingStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ErrorHandlerWrappingStrategy.java?rev=748992&r1=748991&r2=748992&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ErrorHandlerWrappingStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ErrorHandlerWrappingStrategy.java Sun Mar 1 10:34:44 2009
@@ -33,13 +33,11 @@
* to give the implementor an opportunity to wrap the target processor
* in a route.
*
- * @param routeContext the route context
* @param processorType the object that invokes this method
* @param target the processor to be wrapped
* @return processor wrapped with an interceptor or not wrapped
* @throws Exception can be thrown
*/
- Processor wrapProcessorInErrorHandler(RouteContext routeContext, ProcessorType processorType,
- Processor target) throws Exception;
+ Processor wrapProcessorInErrorHandler(ProcessorType processorType, Processor target) throws Exception;
}