You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ha...@apache.org on 2009/11/12 06:26:59 UTC
svn commit: r835240 - in /camel/trunk:
camel-core/src/main/java/org/apache/camel/
camel-core/src/main/java/org/apache/camel/component/file/
camel-core/src/main/java/org/apache/camel/impl/
camel-core/src/main/java/org/apache/camel/processor/ camel-core/...
Author: hadrian
Date: Thu Nov 12 05:26:57 2009
New Revision: 835240
URL: http://svn.apache.org/viewvc?rev=835240&view=rev
Log:
Removing more warnings
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/BatchConsumer.java
camel/trunk/camel-core/src/main/java/org/apache/camel/CamelExecutionException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/Channel.java
camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java
camel/trunk/camel-core/src/main/java/org/apache/camel/ExchangeTimedOutException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/ExpressionIllegalSyntaxException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateConsumerException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateProducerException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToStartRouteException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadRuntimeException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/NoFactoryAvailableException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/ProducerTemplate.java
camel/trunk/camel-core/src/main/java/org/apache/camel/ResolveEndpointFailedException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/RollbackExchangeException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/RouteNode.java
camel/trunk/camel-core/src/main/java/org/apache/camel/ValidationException.java
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducerTemplate.java
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollEndpoint.java
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java
camel/trunk/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/CastUtils.java
camel/trunk/camel-core/src/main/java/org/apache/camel/view/GraphGeneratorSupport.java
camel/trunk/camel-core/src/main/java/org/apache/camel/view/NodeData.java
camel/trunk/camel-core/src/main/java/org/apache/camel/view/RouteDotGenerator.java
camel/trunk/camel-core/src/main/java/org/apache/camel/view/XmlGraphGenerator.java
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerMoveExpressionTest.java
camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java
camel/trunk/components/camel-cometd/src/main/java/org/apache/camel/component/cometd/CometdEndpoint.java
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java
camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisPollingConsumer.java
camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsQueueEndpoint.java
camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java
camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationEndpoint.java
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/BatchConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/BatchConsumer.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/BatchConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/BatchConsumer.java Thu Nov 12 05:26:57 2009
@@ -38,14 +38,15 @@
void setMaxMessagesPerPoll(int maxMessagesPerPoll);
/**
- * Processes the list of {@link org.apache.camel.Exchange} in a batch.
+ * Processes the list of {@link org.apache.camel.Exchange} in a batch.
* <p/>
* Each message exchange will be processed individually but the batch
* consumer will add properties with the current index and total in the batch.
+ * The items in the Queue may actually be Holder objects that store other
+ * data alongside the Exchange.
*
- * @param exchanges list of exchanges in this batch
+ * @param exchanges list of items in this batch
* @throws Exception if an internal processing error has occurred.
*/
- void processBatch(Queue exchanges) throws Exception;
-
+ void processBatch(Queue<Object> exchanges) throws Exception;
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/CamelExecutionException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelExecutionException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/CamelExecutionException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/CamelExecutionException.java Thu Nov 12 05:26:57 2009
@@ -25,6 +25,7 @@
* @version $Revision$
*/
public class CamelExecutionException extends RuntimeExchangeException {
+ private static final long serialVersionUID = -5821095325248904305L;
public CamelExecutionException(String message, Exchange exchange) {
super(message, exchange);
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/Channel.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/Channel.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/Channel.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/Channel.java Thu Nov 12 05:26:57 2009
@@ -82,7 +82,7 @@
* @param routeContext the route context
* @throws Exception is thrown if some error occured
*/
- void initChannel(ProcessorDefinition outputDefinition, RouteContext routeContext) throws Exception;
+ void initChannel(ProcessorDefinition<?> outputDefinition, RouteContext routeContext) throws Exception;
/**
* Gets the wrapped output that at runtime should be delegated to.
@@ -110,6 +110,5 @@
*
* @return the processor definition
*/
- ProcessorDefinition getProcessorDefinition();
-
+ ProcessorDefinition<?> getProcessorDefinition();
}
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=835240&r1=835239&r2=835240&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 Thu Nov 12 05:26:57 2009
@@ -125,7 +125,7 @@
*
* @param options the options (properties)
*/
- void configureProperties(Map options);
+ void configureProperties(Map<String, Object> options);
/**
* Sets the camel context.
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/ExchangeTimedOutException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/ExchangeTimedOutException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/ExchangeTimedOutException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/ExchangeTimedOutException.java Thu Nov 12 05:26:57 2009
@@ -22,6 +22,8 @@
* @version $Revision$
*/
public class ExchangeTimedOutException extends CamelExchangeException {
+ private static final long serialVersionUID = -7899162905421788853L;
+
private final long timeout;
public ExchangeTimedOutException(Exchange exchange, long timeout) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/ExpressionIllegalSyntaxException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/ExpressionIllegalSyntaxException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/ExpressionIllegalSyntaxException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/ExpressionIllegalSyntaxException.java Thu Nov 12 05:26:57 2009
@@ -22,6 +22,8 @@
* @version $Revision$
*/
public class ExpressionIllegalSyntaxException extends RuntimeCamelException {
+ private static final long serialVersionUID = 6545652894842621836L;
+
private final String expression;
public ExpressionIllegalSyntaxException(String expression) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateConsumerException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateConsumerException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateConsumerException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateConsumerException.java Thu Nov 12 05:26:57 2009
@@ -22,6 +22,8 @@
* @version $Revision$
*/
public class FailedToCreateConsumerException extends RuntimeCamelException {
+ private static final long serialVersionUID = 1916718168052020246L;
+
private final String uri;
public FailedToCreateConsumerException(Endpoint endpoint, Throwable cause) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateProducerException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateProducerException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateProducerException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateProducerException.java Thu Nov 12 05:26:57 2009
@@ -22,6 +22,8 @@
* @version $Revision$
*/
public class FailedToCreateProducerException extends RuntimeCamelException {
+ private static final long serialVersionUID = 1341435621084082033L;
+
private final String uri;
public FailedToCreateProducerException(Endpoint endpoint, Throwable cause) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToStartRouteException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToStartRouteException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToStartRouteException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToStartRouteException.java Thu Nov 12 05:26:57 2009
@@ -22,6 +22,7 @@
* @version $Revision$
*/
public class FailedToStartRouteException extends CamelException {
+ private static final long serialVersionUID = -6118520819865759888L;
public FailedToStartRouteException(String routeId, String message) {
super("Failed to start route " + routeId + " because of " + message);
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadException.java Thu Nov 12 05:26:57 2009
@@ -22,6 +22,7 @@
* @version $Revision$
*/
public class InvalidPayloadException extends CamelExchangeException {
+ private static final long serialVersionUID = -1689157578733908632L;
private final transient Class<?> type;
public InvalidPayloadException(Exchange exchange, Class<?> type) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadRuntimeException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadRuntimeException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadRuntimeException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadRuntimeException.java Thu Nov 12 05:26:57 2009
@@ -22,6 +22,7 @@
* @version $Revision$
*/
public class InvalidPayloadRuntimeException extends RuntimeExchangeException {
+ private static final long serialVersionUID = -155083097523464793L;
private final transient Class<?> type;
public InvalidPayloadRuntimeException(Exchange exchange, Class<?> type) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/NoFactoryAvailableException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/NoFactoryAvailableException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/NoFactoryAvailableException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/NoFactoryAvailableException.java Thu Nov 12 05:26:57 2009
@@ -24,6 +24,8 @@
* @version $Revision$
*/
public class NoFactoryAvailableException extends IOException {
+ private static final long serialVersionUID = -425141860196708627L;
+
private final String uri;
public NoFactoryAvailableException(String uri) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java Thu Nov 12 05:26:57 2009
@@ -23,16 +23,17 @@
*/
public class NoTypeConversionAvailableException extends CamelException {
private static final long serialVersionUID = -8721487434390572636L;
+
private final transient Object value;
- private final transient Class type;
+ private final transient Class<?> type;
- public NoTypeConversionAvailableException(Object value, Class type) {
+ public NoTypeConversionAvailableException(Object value, Class<?> type) {
super(createMessage(value, type));
this.value = value;
this.type = type;
}
- public NoTypeConversionAvailableException(Object value, Class type, Throwable cause) {
+ public NoTypeConversionAvailableException(Object value, Class<?> type, Throwable cause) {
this(value, type);
initCause(cause);
}
@@ -47,7 +48,7 @@
/**
* Returns the required <tt>to</tt> type
*/
- public Class getToType() {
+ public Class<?> getToType() {
return type;
}
@@ -55,7 +56,7 @@
* Returns the required <tt>from</tt> type.
* Returns <tt>null</tt> if the provided value was null.
*/
- public Class getFromType() {
+ public Class<?> getFromType() {
if (value != null) {
return value.getClass();
} else {
@@ -66,9 +67,8 @@
/**
* Returns an error message for no type converter available.
*/
- public static String createMessage(Object value, Class type) {
+ public static String createMessage(Object value, Class<?> type) {
return "No type converter available to convert from type: " + (value != null ? value.getClass().getCanonicalName() : null)
+ " to the required type: " + type.getCanonicalName() + " with value " + value;
}
-
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/ProducerTemplate.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/ProducerTemplate.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/ProducerTemplate.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/ProducerTemplate.java Thu Nov 12 05:26:57 2009
@@ -889,7 +889,7 @@
* @return the result (see class javadoc)
* @throws CamelExecutionException if the processing of the exchange failed
*/
- <T> T extractFutureBody(Future future, Class<T> type);
+ <T> T extractFutureBody(Future<Object> future, Class<T> type);
/**
* Gets the response body from the future handle, will wait at most the given time for the response to be ready.
@@ -905,7 +905,7 @@
* @throws java.util.concurrent.TimeoutException if the wait timed out
* @throws CamelExecutionException if the processing of the exchange failed
*/
- <T> T extractFutureBody(Future future, long timeout, TimeUnit unit, Class<T> type) throws TimeoutException;
+ <T> T extractFutureBody(Future<Object> future, long timeout, TimeUnit unit, Class<T> type) throws TimeoutException;
// Asynchronous methods with callback
// -----------------------------------------------------------------------
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/ResolveEndpointFailedException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/ResolveEndpointFailedException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/ResolveEndpointFailedException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/ResolveEndpointFailedException.java Thu Nov 12 05:26:57 2009
@@ -22,6 +22,8 @@
* @version $Revision$
*/
public class ResolveEndpointFailedException extends RuntimeCamelException {
+ private static final long serialVersionUID = -9121465713858552263L;
+
private final String uri;
public ResolveEndpointFailedException(String uri, Throwable cause) {
@@ -42,5 +44,4 @@
public String getUri() {
return uri;
}
-
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/RollbackExchangeException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/RollbackExchangeException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/RollbackExchangeException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/RollbackExchangeException.java Thu Nov 12 05:26:57 2009
@@ -22,6 +22,7 @@
* @version $Revision$
*/
public class RollbackExchangeException extends CamelExchangeException {
+ private static final long serialVersionUID = -7837446508365767066L;
public RollbackExchangeException(Exchange exchange) {
this("Intended rollback", exchange);
@@ -38,5 +39,4 @@
public RollbackExchangeException(String message, Exchange exchange, Throwable cause) {
super(message, exchange, cause);
}
-
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/RouteNode.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/RouteNode.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/RouteNode.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/RouteNode.java Thu Nov 12 05:26:57 2009
@@ -37,7 +37,7 @@
*
* @return the definition, is newer <tt>null</tt>
*/
- ProcessorDefinition getProcessorDefinition();
+ ProcessorDefinition<?> getProcessorDefinition();
/**
* Gets a label about this node to be used for tracing or tooling etc.
@@ -56,5 +56,4 @@
* @return whether this node is abstract or not
*/
boolean isAbstract();
-
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/ValidationException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/ValidationException.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/ValidationException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/ValidationException.java Thu Nov 12 05:26:57 2009
@@ -25,6 +25,7 @@
* @version $Revision$
*/
public class ValidationException extends CamelExchangeException {
+ private static final long serialVersionUID = -7485357452450907415L;
public ValidationException(Exchange exchange, String message) {
super(message, exchange);
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java Thu Nov 12 05:26:57 2009
@@ -27,6 +27,7 @@
import org.apache.camel.Processor;
import org.apache.camel.impl.DefaultExchange;
import org.apache.camel.impl.ScheduledPollConsumer;
+import org.apache.camel.util.CastUtils;
import org.apache.camel.util.ObjectHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -90,7 +91,8 @@
log.debug("Total " + total + " files to consume");
}
- processBatch(exchanges);
+ Queue<Exchange> q = exchanges;
+ processBatch(CastUtils.cast(q));
}
public void setMaxMessagesPerPoll(int maxMessagesPerPoll) {
@@ -98,7 +100,7 @@
}
@SuppressWarnings("unchecked")
- public void processBatch(Queue exchanges) {
+ public void processBatch(Queue<Object> exchanges) {
int total = exchanges.size();
// limit if needed
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=835240&r1=835239&r2=835240&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 Thu Nov 12 05:26:57 2009
@@ -200,7 +200,7 @@
return ExecutorServiceHelper.newScheduledThreadPool(DEFAULT_THREADPOOL_SIZE, getEndpointUri(), true);
}
- public void configureProperties(Map options) {
+ public void configureProperties(Map<String, Object> options) {
// do nothing by default
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducerTemplate.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducerTemplate.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducerTemplate.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducerTemplate.java Thu Nov 12 05:26:57 2009
@@ -471,11 +471,11 @@
return asyncRequestBodyAndHeaders(resolveMandatoryEndpoint(endpointUri), body, headers, type);
}
- public <T> T extractFutureBody(Future future, Class<T> type) {
+ public <T> T extractFutureBody(Future<Object> future, Class<T> type) {
return ExchangeHelper.extractFutureBody(context, future, type);
}
- public <T> T extractFutureBody(Future future, long timeout, TimeUnit unit, Class<T> type) throws TimeoutException {
+ public <T> T extractFutureBody(Future<Object> future, long timeout, TimeUnit unit, Class<T> type) throws TimeoutException {
return ExchangeHelper.extractFutureBody(context, future, timeout, unit, type);
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java Thu Nov 12 05:26:57 2009
@@ -155,7 +155,7 @@
return delegate.createPollingConsumer();
}
- public void configureProperties(Map options) {
+ public void configureProperties(Map<String, Object> options) {
delegate.configureProperties(options);
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollEndpoint.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollEndpoint.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollEndpoint.java Thu Nov 12 05:26:57 2009
@@ -32,7 +32,7 @@
* @version $Revision$
*/
public abstract class ScheduledPollEndpoint extends DefaultEndpoint {
- private Map consumerProperties;
+ private Map<String, Object> consumerProperties;
protected ScheduledPollEndpoint(String endpointUri, Component component) {
super(endpointUri, component);
@@ -49,11 +49,11 @@
protected ScheduledPollEndpoint() {
}
- public Map getConsumerProperties() {
+ public Map<String, Object> getConsumerProperties() {
return consumerProperties;
}
- public void setConsumerProperties(Map consumerProperties) {
+ public void setConsumerProperties(Map<String, Object> consumerProperties) {
this.consumerProperties = consumerProperties;
}
@@ -71,16 +71,15 @@
}
}
- public void configureProperties(Map options) {
- Map consumerProperties = IntrospectionSupport.extractProperties(options, "consumer.");
+ public void configureProperties(Map<String, Object> options) {
+ Map<String, Object> consumerProperties = IntrospectionSupport.extractProperties(options, "consumer.");
if (consumerProperties != null) {
setConsumerProperties(consumerProperties);
}
configureScheduledPollConsumerProperties(options, consumerProperties);
}
- @SuppressWarnings("unchecked")
- private void configureScheduledPollConsumerProperties(Map options, Map consumerProperties) {
+ private void configureScheduledPollConsumerProperties(Map<String, Object> options, Map<String, Object> consumerProperties) {
// special for scheduled poll consumers as we want to allow end users to configure its options
// from the URI parameters without the consumer. prefix
Object initialDelay = options.remove("initialDelay");
@@ -90,7 +89,7 @@
Object pollStrategy = options.remove("pollStrategy");
if (initialDelay != null || delay != null || timeUnit != null || useFixedDelay != null || pollStrategy != null) {
if (consumerProperties == null) {
- consumerProperties = new HashMap();
+ consumerProperties = new HashMap<String, Object>();
}
if (initialDelay != null) {
consumerProperties.put("initialDelay", initialDelay);
@@ -109,5 +108,4 @@
}
}
}
-
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java Thu Nov 12 05:26:57 2009
@@ -58,8 +58,7 @@
private Processor nextProcessor;
// the real output to invoke that has been wrapped
private Processor output;
- private ProcessorDefinition definition;
- private RouteContext routeContext;
+ private ProcessorDefinition<?> definition;
private CamelContext camelContext;
public List<Processor> next() {
@@ -91,7 +90,7 @@
return nextProcessor;
}
- public boolean hasInterceptorStrategy(Class type) {
+ public boolean hasInterceptorStrategy(Class<?> type) {
for (InterceptStrategy strategy : interceptors) {
if (type.isInstance(strategy)) {
return true;
@@ -120,7 +119,7 @@
return interceptors;
}
- public ProcessorDefinition getProcessorDefinition() {
+ public ProcessorDefinition<?> getProcessorDefinition() {
return definition;
}
@@ -134,9 +133,8 @@
ServiceHelper.stopServices(output, errorHandler);
}
- public void initChannel(ProcessorDefinition outputDefinition, RouteContext routeContext) throws Exception {
+ public void initChannel(ProcessorDefinition<?> outputDefinition, RouteContext routeContext) throws Exception {
this.definition = outputDefinition;
- this.routeContext = routeContext;
this.camelContext = routeContext.getCamelContext();
Processor target = nextProcessor;
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java Thu Nov 12 05:26:57 2009
@@ -69,7 +69,7 @@
* @return the created processor
* @throws Exception can be thrown
*/
- Processor createProcessor(ProcessorDefinition node) throws Exception;
+ Processor createProcessor(ProcessorDefinition<?> node) throws Exception;
/**
* Resolves an endpoint from the URI
@@ -185,5 +185,4 @@
* @param routePolicy the custom route policy
*/
void setRoutePolicy(RoutePolicy routePolicy);
-
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/CastUtils.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/CastUtils.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/CastUtils.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/CastUtils.java Thu Nov 12 05:26:57 2009
@@ -24,7 +24,9 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Queue;
import java.util.Set;
+import java.util.concurrent.Future;
@SuppressWarnings("unchecked")
public final class CastUtils {
@@ -69,6 +71,13 @@
return (Set<T>)p;
}
+ public static <T> Queue<T> cast(Queue<?> p) {
+ return (Queue<T>)p;
+ }
+ public static <T> Queue<T> cast(Queue<?> p, Class<T> cls) {
+ return (Queue<T>)p;
+ }
+
public static <T, U> Map.Entry<T, U> cast(Map.Entry<?, ?> p) {
return (Map.Entry<T, U>)p;
}
@@ -79,4 +88,8 @@
public static <T> Enumeration<T> cast(Enumeration<?> p) {
return (Enumeration<T>)p;
}
+
+ public static <T> Future<T> cast(Future<?> p) {
+ return (Future<T>)p;
+ }
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/view/GraphGeneratorSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/view/GraphGeneratorSupport.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/view/GraphGeneratorSupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/view/GraphGeneratorSupport.java Thu Nov 12 05:26:57 2009
@@ -112,7 +112,7 @@
protected abstract void generateFile(PrintWriter writer, Map<String, List<RouteDefinition>> map);
- protected boolean isMulticastNode(ProcessorDefinition node) {
+ protected boolean isMulticastNode(ProcessorDefinition<?> node) {
return node instanceof MulticastDefinition || node instanceof ChoiceDefinition;
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/view/NodeData.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/view/NodeData.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/view/NodeData.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/view/NodeData.java Thu Nov 12 05:26:57 2009
@@ -51,17 +51,15 @@
public String nodeType;
public boolean nodeWritten;
public String url;
- public List<ProcessorDefinition> outputs;
+ public List<ProcessorDefinition<?>> outputs;
public String association = "property";
- private final String imagePrefix;
@SuppressWarnings("unchecked")
public NodeData(String id, Object node, String imagePrefix) {
this.id = id;
- this.imagePrefix = imagePrefix;
if (node instanceof ProcessorDefinition) {
- ProcessorDefinition processorType = (ProcessorDefinition)node;
+ ProcessorDefinition<?> processorType = (ProcessorDefinition<?>)node;
this.edgeLabel = processorType.getLabel();
}
if (node instanceof FromDefinition) {
@@ -96,7 +94,7 @@
this.edgeLabel = "";
ChoiceDefinition choice = (ChoiceDefinition)node;
- List<ProcessorDefinition> outputs = new ArrayList<ProcessorDefinition>(choice.getWhenClauses());
+ List<ProcessorDefinition<?>> outputs = new ArrayList<ProcessorDefinition<?>>(choice.getWhenClauses());
if (choice.getOtherwise() != null) {
outputs.add(choice.getOtherwise());
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/view/RouteDotGenerator.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/view/RouteDotGenerator.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/view/RouteDotGenerator.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/view/RouteDotGenerator.java Thu Nov 12 05:26:57 2009
@@ -80,7 +80,7 @@
printNode(writer, nodeData);
NodeData from = nodeData;
- for (ProcessorDefinition output : route.getOutputs()) {
+ for (ProcessorDefinition<?> output : route.getOutputs()) {
NodeData newData = printNode(writer, from, output);
from = newData;
}
@@ -120,7 +120,7 @@
// now lets write any children
//List<ProcessorType> outputs = node.getOutputs();
- List<ProcessorDefinition> outputs = toData.outputs;
+ List<ProcessorDefinition<?>> outputs = toData.outputs;
if (outputs != null) {
for (ProcessorDefinition output : outputs) {
NodeData newData = printNode(writer, toData, output);
@@ -177,7 +177,7 @@
/**
* Is the given node a pipeline
*/
- private static boolean isPipeline(ProcessorDefinition node) {
+ private static boolean isPipeline(ProcessorDefinition<?> node) {
if (node instanceof MulticastDefinition) {
return false;
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/view/XmlGraphGenerator.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/view/XmlGraphGenerator.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/view/XmlGraphGenerator.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/view/XmlGraphGenerator.java Thu Nov 12 05:26:57 2009
@@ -93,7 +93,7 @@
// TODO we should add a transactional client / event driven consumer / polling client
NodeData from = nodeData;
- for (ProcessorDefinition output : route.getOutputs()) {
+ for (ProcessorDefinition<?> output : route.getOutputs()) {
NodeData newData = printNode(writer, from, output);
from = newData;
}
@@ -127,7 +127,7 @@
}
// now lets write any children
- List<ProcessorDefinition> outputs = toData.outputs;
+ List<ProcessorDefinition<?>> outputs = toData.outputs;
if (outputs != null) {
for (ProcessorDefinition output : outputs) {
NodeData newData = printNode(writer, toData, output);
Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerMoveExpressionTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerMoveExpressionTest.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerMoveExpressionTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerMoveExpressionTest.java Thu Nov 12 05:26:57 2009
@@ -65,7 +65,7 @@
assertMockEndpointsSatisfied();
// give time for consumer to rename file
- Thread.sleep(200);
+ Thread.sleep(500);
String id = mock.getExchanges().get(0).getIn().getMessageId();
File file = new File("target/filelanguage/" + id + ".bak");
Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java Thu Nov 12 05:26:57 2009
@@ -34,6 +34,7 @@
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.util.AsyncProcessorHelper;
+import org.apache.camel.util.CastUtils;
/**
* @version $Revision$
@@ -268,7 +269,7 @@
String echo = template.requestBody("direct:echo", "Hi", String.class);
assertEquals("HiHi", echo);
- String result = template.extractFutureBody(future, String.class);
+ String result = template.extractFutureBody(CastUtils.cast(future), String.class);
assertMockEndpointsSatisfied();
@@ -295,7 +296,7 @@
String echo = template.requestBody("direct:echo", "Hi", String.class);
assertEquals("HiHi", echo);
- String result = template.extractFutureBody(future, 5, TimeUnit.SECONDS, String.class);
+ String result = template.extractFutureBody(CastUtils.cast(future), 5, TimeUnit.SECONDS, String.class);
assertMockEndpointsSatisfied();
Modified: camel/trunk/components/camel-cometd/src/main/java/org/apache/camel/component/cometd/CometdEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cometd/src/main/java/org/apache/camel/component/cometd/CometdEndpoint.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/components/camel-cometd/src/main/java/org/apache/camel/component/cometd/CometdEndpoint.java (original)
+++ camel/trunk/components/camel-cometd/src/main/java/org/apache/camel/component/cometd/CometdEndpoint.java Thu Nov 12 05:26:57 2009
@@ -43,7 +43,7 @@
private URI uri;
private CometdComponent component;
- public CometdEndpoint(CometdComponent component, String uri, String remaining, Map parameters) {
+ public CometdEndpoint(CometdComponent component, String uri, String remaining, Map<String, Object> parameters) {
super(uri, component);
this.component = component;
try {
Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java (original)
+++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapEndpoint.java Thu Nov 12 05:26:57 2009
@@ -102,7 +102,7 @@
throw new UnsupportedOperationException();
}
- public void configureProperties(Map options) {
+ public void configureProperties(Map<String, Object> options) {
}
public Resource getWsdl() {
Modified: camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisPollingConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisPollingConsumer.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisPollingConsumer.java (original)
+++ camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisPollingConsumer.java Thu Nov 12 05:26:57 2009
@@ -26,6 +26,8 @@
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.apache.camel.impl.ScheduledPollConsumer;
+import org.apache.camel.util.CastUtils;
+import org.apache.camel.util.ObjectHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -141,7 +143,7 @@
if (LOG.isTraceEnabled()) {
LOG.trace("Polling: " + endpoint);
}
- List data = endpoint.getProcessingStrategy().poll(this, getEndpoint());
+ List<Object> data = CastUtils.cast(endpoint.getProcessingStrategy().poll(this, getEndpoint()));
// create a list of exchange objects with the data
Queue<DataHolder> answer = new LinkedList<DataHolder>();
@@ -164,14 +166,14 @@
}
// process all the exchanges in this batch
- processBatch(answer);
+ processBatch(CastUtils.cast(answer));
}
public void setMaxMessagesPerPoll(int maxMessagesPerPoll) {
this.maxMessagesPerPoll = maxMessagesPerPoll;
}
- public void processBatch(Queue exchanges) throws Exception {
+ public void processBatch(Queue<Object> exchanges) throws Exception {
final IBatisEndpoint endpoint = getEndpoint();
int total = exchanges.size();
@@ -184,7 +186,7 @@
for (int index = 0; index < total && isRunAllowed(); index++) {
// only loop if we are started (allowed to run)
- DataHolder holder = (DataHolder) exchanges.poll();
+ DataHolder holder = ObjectHelper.cast(DataHolder.class, exchanges.poll());
Exchange exchange = holder.exchange;
Object data = holder.data;
Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsQueueEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsQueueEndpoint.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsQueueEndpoint.java (original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsQueueEndpoint.java Thu Nov 12 05:26:57 2009
@@ -92,7 +92,7 @@
public List<Exchange> getExchanges() {
if (queueBrowseStrategy == null) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
String queue = getDestinationName();
JmsOperations template = getConfiguration().createInOnlyTemplate(this, false, queue);
@@ -114,7 +114,6 @@
return exchange.toString();
}
-
protected QueueBrowseStrategy createQueueBrowseStrategy() {
QueueBrowseStrategy answer = null;
try {
Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java (original)
+++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java Thu Nov 12 05:26:57 2009
@@ -30,6 +30,7 @@
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.impl.ScheduledPollConsumer;
+import org.apache.camel.util.CastUtils;
import org.apache.camel.util.ObjectHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -45,7 +46,7 @@
private final JpaEndpoint endpoint;
private final TransactionStrategy template;
private QueryFactory queryFactory;
- private DeleteHandler deleteHandler;
+ private DeleteHandler<Object> deleteHandler;
private String query;
private String namedQuery;
private String nativeQuery;
@@ -72,7 +73,7 @@
Query query = getQueryFactory().createQuery(entityManager);
configureParameters(query);
- List results = query.getResultList();
+ List<Object> results = CastUtils.cast(query.getResultList());
for (Object result : results) {
DataHolder holder = new DataHolder();
holder.manager = entityManager;
@@ -82,7 +83,7 @@
}
try {
- processBatch(answer);
+ processBatch(CastUtils.cast(answer));
} catch (Exception e) {
throw new PersistenceException(e);
}
@@ -97,7 +98,7 @@
this.maxMessagesPerPoll = maxMessagesPerPoll;
}
- public void processBatch(Queue exchanges) throws Exception {
+ public void processBatch(Queue<Object> exchanges) throws Exception {
if (exchanges.isEmpty()) {
return;
}
@@ -112,7 +113,7 @@
for (int index = 0; index < total && isRunAllowed(); index++) {
// only loop if we are started (allowed to run)
- DataHolder holder = (DataHolder) exchanges.poll();
+ DataHolder holder = ObjectHelper.cast(DataHolder.class, exchanges.poll());
EntityManager entityManager = holder.manager;
Exchange exchange = holder.exchange;
Object result = holder.result;
@@ -160,14 +161,14 @@
this.queryFactory = queryFactory;
}
- public DeleteHandler getDeleteHandler() {
+ public DeleteHandler<Object> getDeleteHandler() {
if (deleteHandler == null) {
deleteHandler = createDeleteHandler();
}
return deleteHandler;
}
- public void setDeleteHandler(DeleteHandler deleteHandler) {
+ public void setDeleteHandler(DeleteHandler<Object> deleteHandler) {
this.deleteHandler = deleteHandler;
}
Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java (original)
+++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java Thu Nov 12 05:26:57 2009
@@ -30,6 +30,7 @@
import org.apache.camel.Producer;
import org.apache.camel.impl.ExpressionAdapter;
import org.apache.camel.impl.ScheduledPollEndpoint;
+import org.apache.camel.util.CastUtils;
import org.apache.camel.util.IntrospectionSupport;
import org.apache.camel.util.ObjectHelper;
import org.springframework.orm.jpa.JpaTemplate;
@@ -47,7 +48,7 @@
private Expression producerExpression;
private int maximumResults = -1;
private Class<?> entityType;
- private Map entityManagerProperties;
+ private Map<Object, Object> entityManagerProperties;
private boolean consumeDelete = true;
private boolean consumeLockEntity = true;
private boolean flushOnSend = true;
@@ -91,11 +92,11 @@
}
@Override
- public void configureProperties(Map options) {
+ public void configureProperties(Map<String, Object> options) {
super.configureProperties(options);
- Map emProperties = IntrospectionSupport.extractProperties(options, "emf.");
+ Map<String, Object> emProperties = IntrospectionSupport.extractProperties(options, "emf.");
if (emProperties != null) {
- setEntityManagerProperties(emProperties);
+ setEntityManagerProperties(CastUtils.cast(emProperties));
}
}
@@ -171,14 +172,14 @@
this.transactionManager = transactionManager;
}
- public Map getEntityManagerProperties() {
+ public Map<Object, Object> getEntityManagerProperties() {
if (entityManagerProperties == null) {
entityManagerProperties = System.getProperties();
}
return entityManagerProperties;
}
- public void setEntityManagerProperties(Map entityManagerProperties) {
+ public void setEntityManagerProperties(Map<Object, Object> entityManagerProperties) {
this.entityManagerProperties = entityManagerProperties;
}
Modified: camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java (original)
+++ camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java Thu Nov 12 05:26:57 2009
@@ -30,6 +30,8 @@
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.impl.ScheduledPollConsumer;
+import org.apache.camel.util.CastUtils;
+import org.apache.camel.util.ObjectHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.mail.javamail.JavaMailSenderImpl;
@@ -107,9 +109,7 @@
messages = folder.getMessages();
}
- Queue<Exchange> exchanges = createExchanges(messages);
- processBatch(exchanges);
-
+ processBatch(CastUtils.cast(createExchanges(messages)));
} else if (count == -1) {
throw new MessagingException("Folder: " + folder.getFullName() + " is closed");
}
@@ -132,7 +132,7 @@
this.maxMessagesPerPoll = maxMessagesPerPoll;
}
- public void processBatch(Queue exchanges) throws Exception {
+ public void processBatch(Queue<Object> exchanges) throws Exception {
int total = exchanges.size();
// limit if needed
@@ -143,7 +143,7 @@
for (int index = 0; index < total && isRunAllowed(); index++) {
// only loop if we are started (allowed to run)
- Exchange exchange = (Exchange)exchanges.poll();
+ Exchange exchange = ObjectHelper.cast(Exchange.class, exchanges.poll());
// add current index and total as properties
exchange.setProperty(Exchange.BATCH_INDEX, index);
exchange.setProperty(Exchange.BATCH_SIZE, total);
Modified: camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java (original)
+++ camel/trunk/components/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java Thu Nov 12 05:26:57 2009
@@ -35,7 +35,7 @@
*/
public class RmiEndpoint extends DefaultEndpoint {
- private List<Class> remoteInterfaces;
+ private List<Class<?>> remoteInterfaces;
private ClassLoader classLoader;
private URI uri;
private int port;
@@ -100,18 +100,18 @@
}
}
- public List<Class> getRemoteInterfaces() {
+ public List<Class<?>> getRemoteInterfaces() {
return remoteInterfaces;
}
- public void setRemoteInterfaces(List<Class> remoteInterfaces) {
+ public void setRemoteInterfaces(List<Class<?>> remoteInterfaces) {
this.remoteInterfaces = remoteInterfaces;
if (classLoader == null && !remoteInterfaces.isEmpty()) {
classLoader = remoteInterfaces.get(0).getClassLoader();
}
}
- public void setRemoteInterfaces(Class... remoteInterfaces) {
+ public void setRemoteInterfaces(Class<?>... remoteInterfaces) {
setRemoteInterfaces(Arrays.asList(remoteInterfaces));
}
Modified: camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationEndpoint.java?rev=835240&r1=835239&r2=835240&view=diff
==============================================================================
--- camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationEndpoint.java (original)
+++ camel/trunk/components/camel-spring-integration/src/main/java/org/apache/camel/component/spring/integration/SpringIntegrationEndpoint.java Thu Nov 12 05:26:57 2009
@@ -21,8 +21,6 @@
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.impl.ScheduledPollEndpoint;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.springframework.integration.core.MessageChannel;
/**
@@ -31,8 +29,6 @@
* @version $Revision$
*/
public class SpringIntegrationEndpoint extends ScheduledPollEndpoint {
- private static final Log LOG = LogFactory.getLog(SpringIntegrationEndpoint.class);
-
private String inputChannel;
private String outputChannel;
private String defaultChannel;