Author: jstrachan
Date: Mon May 14 06:16:39 2007
New Revision: 537816
URL: http://svn.apache.org/viewvc?view=rev&rev=537816
Log:
added test cases now working for the use of @EndpointInject and @MessageDriven
to drive POJOs from Camel and Spring. Also disabled the use of automatically
starting a Producer or Consumer in the factory methods - its now up to the
caller to start these objects
Added:
activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/MyConsumer.java
activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/PojoConsumerTest.java
activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/example/pojoConsumer.xml
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
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/pojo/PojoEndpoint.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerEndpoint.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/processor/ProcessorEndpoint.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueEndpoint.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ProducerCache.java
activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfInvokeEndpoint.java
activemq/camel/trunk/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/JbiEndpoint.java
activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java
activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java
activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java
activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java
activemq/camel/trunk/camel-spring/pom.xml
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/BeanInfo.java
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/DefaultMethodInvocationStrategy.java
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/MethodInvocationStrategy.java
activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
activemq/camel/trunk/pom.xml
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
Mon May 14 06:16:39 2007
@@ -26,6 +26,9 @@
import org.apache.camel.impl.DefaultEndpoint;
import org.apache.camel.impl.DefaultExchange;
import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.util.ProducerCache;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* Represents a direct endpoint that synchronously invokes the consumers of
the endpoint when a producer
@@ -35,6 +38,7 @@
* @version $Revision: 519973 $
*/
public class DirectEndpoint<E extends Exchange> extends DefaultEndpoint<E> {
+ private static final Log log = LogFactory.getLog(DirectEndpoint.class);
private final CopyOnWriteArrayList<DefaultConsumer<E>> consumers = new
CopyOnWriteArrayList<DefaultConsumer<E>>();
@@ -45,21 +49,26 @@
}
public Producer createProducer() throws Exception {
- return startService(new DefaultProducer(this) {
+ return new DefaultProducer(this) {
public void process(Exchange exchange) throws Exception {
DirectEndpoint.this.process(exchange);
}
- });
+ };
}
protected void process(Exchange exchange) throws Exception {
- for (DefaultConsumer<E> consumer : consumers) {
- consumer.getProcessor().process(exchange);
- }
- }
+ if (consumers.isEmpty()) {
+ log.warn("No consumers available on " + this + " for " +
exchange);
+ }
+ else {
+ for (DefaultConsumer<E> consumer : consumers) {
+ consumer.getProcessor().process(exchange);
+ }
+ }
+ }
public Consumer<E> createConsumer(Processor processor) throws Exception
{
- DefaultConsumer<E> consumer = new DefaultConsumer<E>(this,
processor) {
+ return new DefaultConsumer<E>(this, processor) {
@Override
public void start() throws Exception {
if( !allowMultipleConsumers &&
!consumers.isEmpty() )
@@ -75,8 +84,6 @@
consumers.remove(this);
}
};
-
- return consumer;
}
public E createExchange() {
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?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
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
Mon May 14 06:16:39 2007
@@ -45,7 +45,7 @@
*/
public Producer<FileExchange> createProducer() throws Exception {
Producer<FileExchange> result = new FileProducer(this);
- return startService(result);
+ return result;
}
/**
@@ -57,7 +57,7 @@
public Consumer<FileExchange> createConsumer(Processor file) throws
Exception {
Consumer<FileExchange> result = new FileConsumer(this, file);
configureConsumer(result);
- return startService(result);
+ return result;
}
/**
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoEndpoint.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/PojoEndpoint.java
Mon May 14 06:16:39 2007
@@ -48,13 +48,13 @@
if( pojo == null )
throw new NoSuchEndpointException(getEndpointUri());
- return startService(new DefaultProducer(this) {
+ return new DefaultProducer(this) {
public void process(Exchange exchange) {
PojoExchange pojoExchange = toExchangeType(exchange);
invoke(pojo, pojoExchange);
exchange.copyFrom(pojoExchange);
}
- });
+ };
}
public Consumer<PojoExchange> createConsumer(Processor processor) throws
Exception {
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerEndpoint.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/pojo/timer/TimerEndpoint.java
Mon May 14 06:16:39 2007
@@ -63,8 +63,7 @@
}
public Consumer<PojoExchange> createConsumer(Processor processor) throws
Exception {
- TimerConsumer consumer = new TimerConsumer(this, processor);
- return startService(consumer);
+ return new TimerConsumer(this, processor);
}
public PojoExchange createExchange() {
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/processor/ProcessorEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/processor/ProcessorEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/processor/ProcessorEndpoint.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/processor/ProcessorEndpoint.java
Mon May 14 06:16:39 2007
@@ -48,15 +48,15 @@
}
public Producer<Exchange> createProducer() throws Exception {
- return startService(new DefaultProducer<Exchange>(this) {
+ return new DefaultProducer<Exchange>(this) {
public void process(Exchange exchange) throws Exception {
onExchange(exchange);
}
- });
+ };
}
public Consumer<Exchange> createConsumer(Processor processor) throws
Exception {
- return startService(new ProcessorEndpointConsumer(this, processor));
+ return new ProcessorEndpointConsumer(this, processor);
}
public Processor getProcessor() {
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueEndpoint.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/queue/QueueEndpoint.java
Mon May 14 06:16:39 2007
@@ -42,15 +42,15 @@
}
public Producer<E> createProducer() throws Exception {
- return startService(new DefaultProducer(this) {
+ return new DefaultProducer(this) {
public void process(Exchange exchange) {
queue.add(toExchangeType(exchange));
}
- });
+ };
}
public Consumer<E> createConsumer(Processor processor) throws Exception {
- return startService(new QueueEndpointConsumer<E>(this, processor));
+ return new QueueEndpointConsumer<E>(this, processor);
}
public E createExchange() {
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java
Mon May 14 06:16:39 2007
@@ -37,7 +37,14 @@
this.processor = processor;
}
- public Endpoint<E> getEndpoint() {
+
+ @Override
+ public String toString() {
+ return "Consumer on " + endpoint;
+ }
+
+
+ public Endpoint<E> getEndpoint() {
return endpoint;
}
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
Mon May 14 06:16:39 2007
@@ -147,15 +147,7 @@
return null;
}
- /**
- * A helper method to reduce the clutter of implementors of [EMAIL
PROTECTED] #createProducer()} and [EMAIL PROTECTED] #createConsumer(Processor)}
- */
- protected <T extends Service> T startService(T service) throws Exception {
- service.start();
- return service;
- }
-
- protected ScheduledThreadPoolExecutor createExecutorService() {
+ protected ScheduledThreadPoolExecutor createExecutorService() {
return new ScheduledThreadPoolExecutor(10);
}
}
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
Mon May 14 06:16:39 2007
@@ -164,16 +164,17 @@
}
// lets try classes derived from this toType
-
- Set<Map.Entry<TypeMapping, TypeConverter>> entries =
typeMappings.entrySet();
- for (Map.Entry<TypeMapping, TypeConverter> entry : entries) {
- TypeMapping key = entry.getKey();
- Class aToType = key.getToType();
- if (toType.isAssignableFrom(aToType)) {
- if (fromType.isAssignableFrom(key.getFromType())) {
- return entry.getValue();
- }
- }
+ if (fromType != null) {
+ Set<Map.Entry<TypeMapping, TypeConverter>> entries =
typeMappings.entrySet();
+ for (Map.Entry<TypeMapping, TypeConverter> entry : entries) {
+ TypeMapping key = entry.getKey();
+ Class aToType = key.getToType();
+ if (toType.isAssignableFrom(aToType)) {
+ if (fromType.isAssignableFrom(key.getFromType())) {
+ return entry.getValue();
+ }
+ }
+ }
}
// TODO look at constructors of toType?
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ProducerCache.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ProducerCache.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ProducerCache.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ProducerCache.java
Mon May 14 06:16:39 2007
@@ -17,21 +17,24 @@
*/
package org.apache.camel.util;
-import org.apache.camel.Exchange;
-import org.apache.camel.Producer;
import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
import org.apache.camel.FailedToCreateProducerException;
import org.apache.camel.Processor;
+import org.apache.camel.Producer;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.impl.ServiceSupport;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
-import java.util.Map;
import java.util.HashMap;
+import java.util.Map;
/**
* @version $Revision$
*/
public class ProducerCache<E extends Exchange> extends ServiceSupport {
+ private static final Log log = LogFactory.getLog(ProducerCache.class);
private Map<String, Producer<E>> producers = new HashMap<String,
Producer<E>>();
@@ -41,12 +44,12 @@
if (answer == null) {
try {
answer = endpoint.createProducer();
+ answer.start();
}
catch (Exception e) {
throw new FailedToCreateProducerException(endpoint, e);
}
producers.put(key, answer);
- // TODO auto-start?
}
return answer;
}
@@ -59,33 +62,38 @@
*/
public void send(Endpoint<E> endpoint, E exchange) {
try {
- Producer<E> producer = getProducer(endpoint);
- producer.process(exchange);
- } catch (Exception e) {
- throw new RuntimeCamelException(e);
- }
+ Producer<E> producer = getProducer(endpoint);
+ producer.process(exchange);
+ }
+ catch (Exception e) {
+ throw new RuntimeCamelException(e);
+ }
}
/**
* Sends an exchange to an endpoint using a supplied @{link Processor} to
populate the exchange
*
- * @param endpoint the endpoint to send the exchange to
+ * @param endpoint the endpoint to send the exchange to
* @param processor the transformer used to populate the new exchange
*/
public E send(Endpoint<E> endpoint, Processor processor) {
- try {
- Producer<E> producer = getProducer(endpoint);
- E exchange = producer.createExchange();
-
- // lets populate using the processor callback
- processor.process(exchange);
-
- // now lets dispatch
- producer.process(exchange);
- return exchange;
- } catch (Exception e) {
- throw new RuntimeCamelException(e);
- }
+ try {
+ Producer<E> producer = getProducer(endpoint);
+ E exchange = producer.createExchange();
+
+ // lets populate using the processor callback
+ processor.process(exchange);
+
+ // now lets dispatch
+ if (log.isDebugEnabled()) {
+ log.debug(">>>> " + endpoint + " " + exchange);
+ }
+ producer.process(exchange);
+ return exchange;
+ }
+ catch (Exception e) {
+ throw new RuntimeCamelException(e);
+ }
}
protected void doStop() throws Exception {
Modified:
activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
(original)
+++
activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
Mon May 14 06:16:39 2007
@@ -44,11 +44,11 @@
}
public Producer<CxfExchange> createProducer() throws Exception {
- return startService(new CxfProducer(this, getLocalTransportFactory()));
+ return new CxfProducer(this, getLocalTransportFactory());
}
public Consumer<CxfExchange> createConsumer(Processor processor) throws
Exception {
- return startService(new CxfConsumer(this, processor,
getLocalTransportFactory()));
+ return new CxfConsumer(this, processor, getLocalTransportFactory());
}
public CxfExchange createExchange() {
Modified:
activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfInvokeEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfInvokeEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfInvokeEndpoint.java
(original)
+++
activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfInvokeEndpoint.java
Mon May 14 06:16:39 2007
@@ -44,11 +44,11 @@
}
public Producer<CxfExchange> createProducer() throws Exception {
- return startService(new CxfInvokeProducer(this));
+ return new CxfInvokeProducer(this);
}
public Consumer<CxfExchange> createConsumer(Processor processor) throws
Exception {
- return startService(new CxfInvokeConsumer(this, processor));
+ return new CxfInvokeConsumer(this, processor);
}
public CxfExchange createExchange() {
Modified:
activemq/camel/trunk/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
(original)
+++
activemq/camel/trunk/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
Mon May 14 06:16:39 2007
@@ -42,16 +42,16 @@
}
public Producer<HttpExchange> createProducer() throws Exception {
- return startService(new DefaultProducer(this) {
+ return new DefaultProducer(this) {
public void process(Exchange exchange) {
/** TODO */
}
- });
+ };
}
public Consumer<HttpExchange> createConsumer(Processor processor) throws
Exception {
// TODO
- return startService(new DefaultConsumer<HttpExchange>(this, processor)
{});
+ return new DefaultConsumer<HttpExchange>(this, processor) {};
}
public HttpExchange createExchange() {
Modified:
activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/JbiEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/JbiEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/JbiEndpoint.java
(original)
+++
activemq/camel/trunk/camel-jbi/src/main/java/org/apache/camel/component/jbi/JbiEndpoint.java
Mon May 14 06:16:39 2007
@@ -42,15 +42,15 @@
}
public Producer<Exchange> createProducer() throws Exception {
- return startService(new DefaultProducer<Exchange>(this) {
- public void process(Exchange exchange) throws Exception {
- toJbiProcessor.process(exchange);
- }
- });
+ return new DefaultProducer<Exchange>(this) {
+ public void process(Exchange exchange) throws Exception {
+ toJbiProcessor.process(exchange);
+ }
+ };
}
public Consumer<Exchange> createConsumer(final Processor processor) throws
Exception {
- return startService(new DefaultConsumer<Exchange>(this, processor) {
+ return new DefaultConsumer<Exchange>(this, processor) {
CamelJbiEndpoint jbiEndpoint;
@Override
@@ -68,7 +68,7 @@
*/
super.doStop();
}
- });
+ };
}
Modified:
activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
(original)
+++
activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
Mon May 14 06:16:39 2007
@@ -57,7 +57,7 @@
jmsTemplate.setPubSubDomain(pubSubDomain);
jmsTemplate.setDefaultDestinationName(destination);
}
- return startService(new JmsProducer(this, template));
+ return new JmsProducer(this, template);
}
public Consumer<JmsExchange> createConsumer(Processor processor) throws
Exception {
@@ -79,7 +79,7 @@
if (selector != null) {
listenerContainer.setMessageSelector(selector);
}
- return startService(new JmsConsumer(this, processor,
listenerContainer));
+ return new JmsConsumer(this, processor, listenerContainer);
}
public JmsExchange createExchange() {
Modified:
activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
(original)
+++
activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
Mon May 14 06:16:39 2007
@@ -57,13 +57,13 @@
}
public Producer<Exchange> createProducer() throws Exception {
- return startService(new JpaProducer(this, getProducerExpression()));
+ return new JpaProducer(this, getProducerExpression());
}
public Consumer<Exchange> createConsumer(Processor processor) throws
Exception {
JpaConsumer consumer = new JpaConsumer(this, processor);
configureConsumer(consumer);
- return startService(consumer);
+ return consumer;
}
@Override
Modified:
activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java
(original)
+++
activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java
Mon May 14 06:16:39 2007
@@ -88,6 +88,7 @@
latch.countDown();
}
});
+ consumer.start();
boolean received = latch.await(50, TimeUnit.SECONDS);
assertTrue("Did not receive the message!", received);
Modified:
activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
(original)
+++
activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
Mon May 14 06:16:39 2007
@@ -92,6 +92,7 @@
latch.countDown();
}
});
+ consumer.start();
boolean received = latch.await(50, TimeUnit.SECONDS);
assertTrue("Did not receive the message!", received);
Modified:
activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java
(original)
+++
activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java
Mon May 14 06:16:39 2007
@@ -48,7 +48,7 @@
* Creates a producer using the given sender
*/
public Producer<MailExchange> createProducer(JavaMailSender sender) throws
Exception {
- return startService(new MailProducer(this, sender));
+ return new MailProducer(this, sender);
}
public Consumer<MailExchange> createConsumer(Processor processor) throws
Exception {
@@ -76,7 +76,7 @@
public Consumer<MailExchange> createConsumer(Processor processor, Folder
folder) throws Exception {
MailConsumer answer = new MailConsumer(this, processor, folder);
configureConsumer(answer);
- return startService(answer);
+ return answer;
}
public MailExchange createExchange() {
Modified:
activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java
(original)
+++
activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java
Mon May 14 06:16:39 2007
@@ -50,11 +50,11 @@
}
public Producer<MinaExchange> createProducer() throws Exception {
- return startService(new MinaProducer(this));
+ return new MinaProducer(this);
}
public Consumer<MinaExchange> createConsumer(Processor processor) throws
Exception {
- return startService(new MinaConsumer(this, processor));
+ return new MinaConsumer(this, processor);
}
public MinaExchange createExchange() {
Modified:
activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java
(original)
+++
activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java
Mon May 14 06:16:39 2007
@@ -50,6 +50,7 @@
message.setHeader("cheese", 123);
producer = endpoint.createProducer();
+ producer.start();
producer.process(exchange);
// now lets sleep for a while
Modified: activemq/camel/trunk/camel-spring/pom.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/pom.xml?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
--- activemq/camel/trunk/camel-spring/pom.xml (original)
+++ activemq/camel/trunk/camel-spring/pom.xml Mon May 14 06:16:39 2007
@@ -40,27 +40,30 @@
</dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<type>test-jar</type>
<optional>true</optional>
<scope>test</scope>
</dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
- </dependency>
-
<dependency>
<groupId>commons-logging</groupId>
- <artifactId>commons-logging-api</artifactId>
- <optional>true</optional>
+ <artifactId>commons-logging</artifactId>
+ <scope>test</scope>
</dependency>
-
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
<scope>test</scope>
</dependency>
Modified:
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
(original)
+++
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
Mon May 14 06:16:39 2007
@@ -44,6 +44,8 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
/**
* A post processor to perform injection of [EMAIL PROTECTED] Endpoint} and
[EMAIL PROTECTED] Producer} instances together with binding
@@ -57,6 +59,7 @@
private CamelContext camelContext;
private ApplicationContext applicationContext;
private MethodInvocationStrategy invocationStrategy = new
DefaultMethodInvocationStrategy();
+ //private List<Consumer> consumers = new ArrayList<Consumer>();
public CamelBeanPostProcessor() {
}
@@ -176,15 +179,20 @@
protected void consumerInjection(Method method, Object bean) {
MessageDriven annotation = method.getAnnotation(MessageDriven.class);
if (annotation != null) {
+ log.info("Creating a consumer for: " + annotation);
+
// lets bind this method to a listener
Endpoint endpoint = getEndpointInjection(annotation.uri(),
annotation.name());
if (endpoint != null) {
try {
Processor processor = createConsumerProcessor(bean,
method, endpoint);
+ log.info("Created processor: " + processor);
Consumer consumer = endpoint.createConsumer(processor);
+ consumer.start();
addConsumer(consumer);
}
catch (Exception e) {
+ log.warn(e);
throw new RuntimeCamelException(e);
}
}
@@ -198,10 +206,21 @@
final BeanInfo beanInfo = new BeanInfo(pojo.getClass(),
invocationStrategy);
return new Processor() {
- public void process(Exchange exchange) throws Exception {
- MethodInvocation invocation = beanInfo.createInvocation(pojo,
exchange);
+ @Override
+ public String toString() {
+ return "Processor on " + endpoint;
+ }
+
+ public void process(Exchange exchange) throws Exception
{
+ if (log.isDebugEnabled()) {
+ log.debug(">>>> invoking method for: "
+ exchange);
+ }
+ MethodInvocation invocation =
beanInfo.createInvocation(method, pojo, exchange);
+ if (invocation == null) {
+ throw new IllegalStateException("No method invocation
could be created");
+ }
try {
- invocation.proceed();
+ invocation.proceed();
}
catch (Exception e) {
throw e;
@@ -215,6 +234,7 @@
protected void addConsumer(Consumer consumer) {
log.debug("Adding consumer: " + consumer);
+ //consumers.add(consumer);
}
/**
Modified:
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/BeanInfo.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/BeanInfo.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/BeanInfo.java
(original)
+++
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/BeanInfo.java
Mon May 14 06:16:39 2007
@@ -67,6 +67,11 @@
}
}
+ public MethodInvocation createInvocation(Method method, Object pojo,
Exchange messageExchange) throws RuntimeCamelException {
+ MethodInfo methodInfo = introspect(type, method);
+ return methodInfo.createMethodInvocation(pojo, messageExchange);
+ }
+
public MethodInvocation createInvocation(Object pojo, Exchange
messageExchange) throws RuntimeCamelException {
MethodInfo methodInfo = null;
@@ -95,7 +100,7 @@
}
}
- protected void introspect(Class clazz, Method method) {
+ protected MethodInfo introspect(Class clazz, Method method) {
Class[] parameterTypes = method.getParameterTypes();
Annotation[][] parameterAnnotations = method.getParameterAnnotations();
final Expression[] parameterExpressions = new
Expression[parameterTypes.length];
@@ -108,7 +113,13 @@
log.debug("No expression available for method: "
+ method.toString() + " parameter: " + i + " so
ignoring method");
}
- return;
+ if (parameterTypes.length == 1) {
+ // lets assume its the body
+ expression =
ExpressionBuilder.bodyExpression(parameterType);
+ }
+ else {
+ return null;
+ }
}
parameterExpressions[i] = expression;
}
@@ -128,7 +139,9 @@
}
*/
Expression parametersExpression =
createMethodParametersExpression(parameterExpressions);
- operations.put(opName, new MethodInfo(clazz, method,
parametersExpression));
+ MethodInfo methodInfo = new MethodInfo(clazz, method,
parametersExpression);
+ operations.put(opName, methodInfo);
+ return methodInfo;
}
protected Expression createMethodParametersExpression(final Expression[]
parameterExpressions) {
Modified:
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/DefaultMethodInvocationStrategy.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/DefaultMethodInvocationStrategy.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/DefaultMethodInvocationStrategy.java
(original)
+++
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/DefaultMethodInvocationStrategy.java
Mon May 14 06:16:39 2007
@@ -55,12 +55,14 @@
* Creates an invocation on the given POJO using annotations to decide
which method to invoke
* and to figure out which parameters to use
*/
- public MethodInvocation createInvocation(Object pojo,
+/*
+ public MethodInvocation createInvocation(Object pojo,
BeanInfo beanInfo,
Exchange messageExchange,
Endpoint pojoEndpoint) throws
RuntimeCamelException {
return beanInfo.createInvocation(pojo, messageExchange);
}
+*/
public void loadDefaultRegistry() {
Modified:
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/MethodInvocationStrategy.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/MethodInvocationStrategy.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/MethodInvocationStrategy.java
(original)
+++
activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/util/MethodInvocationStrategy.java
Mon May 14 06:16:39 2007
@@ -16,11 +16,7 @@
*/
package org.apache.camel.spring.util;
-import org.aopalliance.intercept.MethodInvocation;
-import org.apache.camel.Exchange;
import org.apache.camel.Expression;
-import org.apache.camel.Endpoint;
-import org.apache.camel.RuntimeCamelException;
/**
* A strategy for invoking a method on a pojo from a message exchange
@@ -32,10 +28,10 @@
* Creates an invocation on the given POJO using annotations to decide
which method to invoke
* and to figure out which parameters to use
*/
- MethodInvocation createInvocation(Object pojo,
+/* MethodInvocation createInvocation(Object pojo,
BeanInfo beanInfo,
Exchange messageExchange,
- Endpoint pojoEndpoint) throws
RuntimeCamelException;
+ Endpoint pojoEndpoint) throws
RuntimeCamelException;*/
Expression getDefaultParameterTypeExpression(Class parameterType);
}
Added:
activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/MyConsumer.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/MyConsumer.java?view=auto&rev=537816
==============================================================================
---
activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/MyConsumer.java
(added)
+++
activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/MyConsumer.java
Mon May 14 06:16:39 2007
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring.example;
+
+import org.apache.camel.CamelTemplate;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.MessageDriven;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * An example POJO which is injected with a CamelTemplate
+ *
+ * @version $Revision: $
+ */
+public class MyConsumer {
+ private static final Log log = LogFactory.getLog(MyConsumer.class);
+
+ @EndpointInject(uri = "mock:result")
+ private CamelTemplate destination;
+
+
+ @MessageDriven(uri = "direct:start")
+ public void doSomething(String body) {
+ ObjectHelper.notNull(destination, "destination");
+
+ log.info("Received body: " + body);
+ destination.sendBody(body);
+ }
+
+ public CamelTemplate getDestination() {
+ return destination;
+ }
+
+ public void setDestination(CamelTemplate destination) {
+ this.destination = destination;
+ }
+}
Added:
activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/PojoConsumerTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/PojoConsumerTest.java?view=auto&rev=537816
==============================================================================
---
activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/PojoConsumerTest.java
(added)
+++
activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/PojoConsumerTest.java
Mon May 14 06:16:39 2007
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring.example;
+
+import org.apache.camel.spring.SpringTestSupport;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @version $Revision: $
+ */
+public class PojoConsumerTest extends SpringTestSupport {
+ protected MockEndpoint resultEndpoint;
+
+ public void testMessagesSentToConsumerArrive() throws Exception {
+ String body = "<hello>world!</hello>";
+ resultEndpoint.expectedBodiesReceived(body);
+
+ template.sendBody("direct:start", body);
+
+ resultEndpoint.assertIsSatisfied();
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ resultEndpoint = (MockEndpoint)
resolveMandatoryEndpoint("mock:result");
+ }
+
+ protected ClassPathXmlApplicationContext createApplicationContext() {
+ return new
ClassPathXmlApplicationContext("org/apache/camel/spring/example/pojoConsumer.xml");
+ }
+
+ protected int getExpectedRouteCount() {
+ return 0;
+ }
+}
Added:
activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/example/pojoConsumer.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/example/pojoConsumer.xml?view=auto&rev=537816
==============================================================================
---
activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/example/pojoConsumer.xml
(added)
+++
activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/example/pojoConsumer.xml
Mon May 14 06:16:39 2007
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (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
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://activemq.apache.org/camel/schema/camel-1.0.xsd
http://activemq.apache.org/camel/schema/camel-1.0.xsd
+ ">
+
+ <!-- START SNIPPET: example -->
+ <camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/camel-1.0.xsd">
+ <beanPostProcessor/>
+ </camelContext>
+ <!-- END SNIPPET: example -->
+
+ <bean id="myConsumer" class="org.apache.camel.spring.example.MyConsumer"/>
+</beans>
Modified:
activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
---
activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
(original)
+++
activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
Mon May 14 06:16:39 2007
@@ -68,15 +68,15 @@
}
public Producer<XmppExchange> createGroupChatProducer(String room) throws
Exception {
- return startService(new XmppGroupChatProducer(this, room));
+ return new XmppGroupChatProducer(this, room);
}
public Producer<XmppExchange> createPrivateChatProducer(String
participant) throws Exception {
- return startService(new XmppPrivateChatProducer(this, participant));
+ return new XmppPrivateChatProducer(this, participant);
}
public Consumer<XmppExchange> createConsumer(Processor processor) throws
Exception {
- return startService(new XmppConsumer(this, processor));
+ return new XmppConsumer(this, processor);
}
public XmppExchange createExchange() {
Modified: activemq/camel/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/pom.xml?view=diff&rev=537816&r1=537815&r2=537816
==============================================================================
--- activemq/camel/trunk/pom.xml (original)
+++ activemq/camel/trunk/pom.xml Mon May 14 06:16:39 2007
@@ -127,7 +127,7 @@
<module>camel-jbi</module>
<module>camel-jms</module>
<module>camel-josql</module>
- <module>camel-jpa</module>
+ <module>camel-jpa</module>
<module>camel-mail</module>
<module>camel-mina</module>
<module>camel-rmi</module>
@@ -248,11 +248,16 @@
<!-- optional dependencies -->
<dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.12</version>
- <scope>runtime</scope>
- <optional>true</optional>
+ <scope>test</scope>
</dependency>