Author: davsclaus
Date: Mon Apr 23 07:58:48 2012
New Revision: 1329109
URL: http://svn.apache.org/viewvc?rev=1329109&view=rev
Log:
CAMEL-5205: Removed legacy code in createExchange method that was only
applicable in Camel 1.x
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java?rev=1329109&r1=1329108&r2=1329109&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java Mon Apr
23 07:58:48 2012
@@ -76,7 +76,7 @@ public interface Endpoint extends IsSing
Exchange createExchange(ExchangePattern pattern);
/**
- * Creates a new exchange for communicating with this exchange using the
+ * Creates a new exchange for communicating with this endpoint using the
* given exchange to pre-populate the values of the headers and messages
*
* @param exchange given exchange to use for pre-populate
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java?rev=1329109&r1=1329108&r2=1329109&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
Mon Apr 23 07:58:48 2012
@@ -16,8 +16,6 @@
*/
package org.apache.camel.impl;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
@@ -212,34 +210,9 @@ public abstract class DefaultEndpoint ex
}
public Exchange createExchange(Exchange exchange) {
- Class<Exchange> exchangeType = getExchangeType();
- if (exchangeType != null) {
- if (exchangeType.isInstance(exchange)) {
- return exchangeType.cast(exchange);
- }
- }
return exchange.copy();
}
- /**
- * Returns the type of the exchange which is generated by this component
- */
- @SuppressWarnings("unchecked")
- public Class<Exchange> getExchangeType() {
- Type type = getClass().getGenericSuperclass();
- if (type instanceof ParameterizedType) {
- ParameterizedType parameterizedType = (ParameterizedType)type;
- Type[] arguments = parameterizedType.getActualTypeArguments();
- if (arguments.length > 0) {
- Type argumentType = arguments[0];
- if (argumentType instanceof Class) {
- return (Class<Exchange>)argumentType;
- }
- }
- }
- return null;
- }
-
public Exchange createExchange() {
return createExchange(getExchangePattern());
}