svn commit: r738390 - in /camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote: FtpRemoteFileOperations.java SftpRemoteFileOperations.java

2009-01-27 Thread davsclaus
Author: davsclaus
Date: Wed Jan 28 07:33:19 2009
New Revision: 738390

URL: http://svn.apache.org/viewvc?rev=738390&view=rev
Log:
CAMEL-1241: A little cleanup in the camel-ftp component. Forgot sourcecheck

Modified:

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpRemoteFileOperations.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpRemoteFileOperations.java

Modified: 
camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpRemoteFileOperations.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpRemoteFileOperations.java?rev=738390&r1=738389&r2=738390&view=diff
==
--- 
camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpRemoteFileOperations.java
 (original)
+++ 
camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpRemoteFileOperations.java
 Wed Jan 28 07:33:19 2009
@@ -21,8 +21,8 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.ArrayList;
-import java.util.List;
 import java.util.Arrays;
+import java.util.List;
 
 import org.apache.camel.component.file.GenericFile;
 import org.apache.camel.component.file.GenericFileExchange;

Modified: 
camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpRemoteFileOperations.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpRemoteFileOperations.java?rev=738390&r1=738389&r2=738390&view=diff
==
--- 
camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpRemoteFileOperations.java
 (original)
+++ 
camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpRemoteFileOperations.java
 Wed Jan 28 07:33:19 2009
@@ -30,15 +30,15 @@
 import com.jcraft.jsch.Session;
 import com.jcraft.jsch.SftpException;
 import com.jcraft.jsch.UserInfo;
+import org.apache.camel.InvalidPayloadException;
 import org.apache.camel.component.file.GenericFile;
 import org.apache.camel.component.file.GenericFileExchange;
 import org.apache.camel.component.file.GenericFileOperationFailedException;
-import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ExchangeHelper;
+import org.apache.camel.util.ObjectHelper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import static org.apache.camel.util.ObjectHelper.isNotEmpty;
-import org.apache.camel.InvalidPayloadException;
 
 /**
  * SFTP remote file operations




svn commit: r738386 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/component/file/ components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/

2009-01-27 Thread davsclaus
Author: davsclaus
Date: Wed Jan 28 07:30:02 2009
New Revision: 738386

URL: http://svn.apache.org/viewvc?rev=738386&view=rev
Log:
CAMEL-1241: A little cleanup in the camel-ftp component.

Removed:

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileExclusiveReadLockStrategy.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileMessage.java
Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java

camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileExchange.java

camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpRemoteFileComponent.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpRemoteFileOperations.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFile.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileComponent.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileExchange.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileOperations.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpRemoteFileComponent.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpRemoteFileEndpoint.java

camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpRemoteFileOperations.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java?rev=738386&r1=738385&r2=738386&view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
 Wed Jan 28 07:30:02 2009
@@ -47,7 +47,7 @@
 protected final transient Log log = LogFactory.getLog(getClass());
 
 protected GenericFileProcessStrategy processStrategy;
-protected GenericFileOperations operations;
+protected GenericFileOperations operations;
 protected GenericFileConfiguration configuration;
 
 // TODO: Consider remove setNames
@@ -404,11 +404,11 @@
 this.autoCreate = autoCreate;
 }
 
-public GenericFileOperations getOperations() {
+public GenericFileOperations getOperations() {
 return operations;
 }
 
-public void setOperations(GenericFileOperations operations) {
+public void setOperations(GenericFileOperations operations) {
 this.operations = operations;
 }
 

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileExchange.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileExchange.java?rev=738386&r1=738385&r2=738386&view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileExchange.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileExchange.java
 Wed Jan 28 07:30:02 2009
@@ -28,8 +28,6 @@
 
 private GenericFile genericFile;
 
-// TODO: Consider removing some of he constructors
-
 public GenericFileExchange(CamelContext context) {
 super(context);
 }
@@ -92,7 +90,7 @@
 }
 
 public Exchange newInstance() {
-return new GenericFileExchange(this, genericFile);
+return new GenericFileExchange(this, genericFile);
 }
 
 }

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java?rev=738386&r1=738385&r2=738386&view=diff
==

svn commit: r738346 - in /camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf: CxfComponent.java CxfEndpoint.java CxfSpringEndpoint.java DefaultCxfBinding.java

2009-01-27 Thread wtam
Author: wtam
Date: Wed Jan 28 02:57:56 2009
New Revision: 738346

URL: http://svn.apache.org/viewvc?rev=738346&view=rev
Log:
minor code cleanup to camel-cxf

Modified:

camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java

camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java

camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java

camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java

Modified: 
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java?rev=738346&r1=738345&r2=738346&view=diff
==
--- 
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java
 (original)
+++ 
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java
 Wed Jan 28 02:57:56 2009
@@ -59,7 +59,7 @@
 CxfEndpointBean bean = 
CamelContextHelper.mandatoryLookup(getCamelContext(), beanId, 
 CxfEndpointBean.class);
 
-result = new CxfSpringEndpoint(this, beanId, bean);
+result = new CxfSpringEndpoint(this, bean);
 
 } else {
 // endpoint URI does not specify a bean

Modified: 
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java?rev=738346&r1=738345&r2=738346&view=diff
==
--- 
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
 (original)
+++ 
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
 Wed Jan 28 02:57:56 2009
@@ -52,6 +52,7 @@
 import org.apache.cxf.headers.Header;
 import org.apache.cxf.jaxws.JaxWsClientFactoryBean;
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.apache.cxf.message.Message;
 
 /**
@@ -76,8 +77,6 @@
 private Bus bus;
 private CxfBinding cxfBinding;
 private HeaderFilterStrategy headerFilterStrategy;
-private boolean hasWSProviderAnnotation;
-private boolean hasWebServiceAnnotation;
 private AtomicBoolean cxfBindingInitialized = new AtomicBoolean(false);
 private AtomicBoolean getBusHasBeenCalled = new AtomicBoolean(false);
 private boolean isSetDefaultBus;
@@ -111,8 +110,6 @@
  * Populate server factory bean
  */
 protected void setupServerFactoryBean(ServerFactoryBean sfb, Class cls) 
{
-hasWSProviderAnnotation = CxfEndpointUtils.hasAnnotation(cls, 
-WebServiceProvider.class);
 
 // address
 sfb.setAddress(getEndpointUri());
@@ -136,7 +133,7 @@
 }
 
 // apply feature here
-if (!webServiceProviderAnnotated()) {
+if (!CxfEndpointUtils.hasAnnotation(cls, WebServiceProvider.class)) {
 if (getDataFormat() == DataFormat.PAYLOAD) {
 sfb.getFeatures().add(new PayLoadDataFormatFeature());
 } else if (getDataFormat() == DataFormat.MESSAGE) {
@@ -162,8 +159,7 @@
 // quick null point check for serviceClass
 ObjectHelper.notNull(cls, "Please provide endpoint service interface 
class");
 
-hasWebServiceAnnotation = 
CxfEndpointUtils.hasWebServiceAnnotation(cls);
-if (hasWebServiceAnnotation) {
+if (CxfEndpointUtils.hasWebServiceAnnotation(cls)) {
 return new JaxWsProxyFactoryBean(new JaxWsClientFactoryBean() {
 @Override
 protected void createClient(Endpoint ep) {
@@ -256,21 +252,20 @@
 Class cls = ClassLoaderUtils.loadClass(getServiceClass(), 
getClass());
 
 // create server factory bean
-ServerFactoryBean answer = CxfEndpointUtils.getServerFactoryBean(cls);
+// Shouldn't use CxfEndpointUtils.getServerFactoryBean(cls) as it is 
for
+// CxfSoapComponent
+ServerFactoryBean answer = null;
+if (CxfEndpointUtils.hasWebServiceAnnotation(cls)) {
+answer = new JaxWsServerFactoryBean();
+} else {
+answer = new ServerFactoryBean();
+}
 
 // setup server factory bean
 setupServerFactoryBean(answer, cls);
 return answer;
 }
 
-boolean webServiceProviderAnnotated() {
-return hasWSProviderAnnotation;
-}
-
-boolean webServiceAnnotated() {
-return hasWebServiceAnnotation;
-}
-
 // Properties
 // 

[CONF] Apache Camel: Quartz (page edited)

2009-01-27 Thread confluence










Page Edited :
CAMEL :
Quartz



 
Quartz
has been edited by Hadrian Zbarcea
(Jan 27, 2009).
 

 
 (View changes)
 

Content:
Quartz Component

The quartz: component provides a scheduled delivery of messages using the Quartz scheduler. 
Each endpoint represents a different timer (in Quartz terms, a Trigger and JobDetail).

URI format


quartz://timerName?parameters
quartz://groupName/timerName?parameters
quartz://groupName/timerName/cronExpression


You can configure the Trigger and JobDetail using the parameters (if not using cron _expression_)



 Parameter 
 Description 


 trigger.repeatCount 
 How many times should the timer repeat for? 


 trigger.repeatInterval 
 The amount of time in milliseconds between repeated triggers 


 job.name 
 Sets the name of the job 


 stateful 
 Uses a Quartz StatefulJob instead of the default Job 



For example the following routing rule will fire 2 timer events to the endpoint mock:results


from("quartz://myGroup/myTimerName?trigger.repeatInterval=2&trigger.repeatCount=1").to("mock:result");


When using a StatefulJob the JobDataMap is re-persisted after every execution of the job, thus preserving state for the next execution.

Message Headers
Camel adds the getters from Quartz Execution Context as header values. These headers is added:
calendar, fireTime, jobDetail, jobInstance, jobRuntTime, mergedJobDataMap, nextFireTime, previousFireTime, refireCount, result, scheduledFireTime, scheduler, trigger, triggerName, triggerGroup.

The fireTime header contains the java.util.Date for when the exchange was fired.

Using Cron Triggers

Quartz supports Cron-like expressions for specifying timers in a handy format. You can use these expressions in the URI; though to preserve valid URI encoding we allow / to be used instead of spaces and $ to be used instead of ?.

For example the following will fire a message at 12pm (noon) every day


from("quartz://myGroup/myTimerName/0/0/12/*/*/$").to("activemq:Totally.Rocks");


which is equivalent to using the cron _expression_


0 0 12 * * ?


The following table shows the URI character encodings we use to preserve valid URI syntax



URI Character
Cron character


 '/' 
 ' ' 


 '$' 
 '?' 



See Also

	Configuring Camel
	Component
	Endpoint
	Getting Started



	Timer














Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request

Unsubscribe or edit your notifications preferences








svn commit: r738298 - in /camel/trunk/components/camel-quartz/src: main/java/org/apache/camel/component/quartz/StatefulCamelJob.java test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest

2009-01-27 Thread hadrian
Author: hadrian
Date: Tue Jan 27 23:25:12 2009
New Revision: 738298

URL: http://svn.apache.org/viewvc?rev=738298&view=rev
Log:
A tiny bit of tab/whitespace cleanup.

Modified:

camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/StatefulCamelJob.java

camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java

Modified: 
camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/StatefulCamelJob.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/StatefulCamelJob.java?rev=738298&r1=738297&r2=738298&view=diff
==
--- 
camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/StatefulCamelJob.java
 (original)
+++ 
camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/StatefulCamelJob.java
 Tue Jan 27 23:25:12 2009
@@ -33,20 +33,18 @@
/* (non-Javadoc)
 * @see org.quartz.Job#execute(org.quartz.JobExecutionContext)
 */
-   public void execute(final JobExecutionContext context) throws 
JobExecutionException {
+public void execute(final JobExecutionContext context) throws 
JobExecutionException {
 
-   SchedulerContext schedulerContext;
-   try {
-   schedulerContext = context.getScheduler().getContext();
-   }
-   catch (SchedulerException e) {
-   throw new JobExecutionException("Failed to obtain 
scheduler context for job " + context.getJobDetail().getName());
-   }
-
-   CamelContext camelContext = (CamelContext) 
schedulerContext.get(QuartzEndpoint.CONTEXT_KEY);
-   String endpointUri = (String) 
context.getJobDetail().getJobDataMap().get(QuartzEndpoint.ENDPOINT_KEY);
-   QuartzEndpoint quartzEndpoint = (QuartzEndpoint) 
camelContext.getEndpoint(endpointUri);
-   quartzEndpoint.onJobExecute(context);
-   }
+SchedulerContext schedulerContext;
+try {
+schedulerContext = context.getScheduler().getContext();
+} catch (SchedulerException e) {
+throw new JobExecutionException("Failed to obtain scheduler 
context for job " + context.getJobDetail().getName());
+}
 
+CamelContext camelContext = (CamelContext) 
schedulerContext.get(QuartzEndpoint.CONTEXT_KEY);
+String endpointUri = (String) 
context.getJobDetail().getJobDataMap().get(QuartzEndpoint.ENDPOINT_KEY);
+QuartzEndpoint quartzEndpoint =(QuartzEndpoint) 
camelContext.getEndpoint(endpointUri);
+quartzEndpoint.onJobExecute(context);
+}
 }

Modified: 
camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java?rev=738298&r1=738297&r2=738298&view=diff
==
--- 
camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
 (original)
+++ 
camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
 Tue Jan 27 23:25:12 2009
@@ -49,19 +49,18 @@
 }
 
 
-   /* (non-Javadoc)
-* @see org.apache.camel.ContextTestSupport#createRouteBuilder()
-*/
-   @Override
-   protected RouteBuilder createRouteBuilder() throws Exception {
-   return new RouteBuilder() {
+/* (non-Javadoc)
+ * @see org.apache.camel.ContextTestSupport#createRouteBuilder()
+ */
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
 @Override
-   public void configure() {
+public void configure() {
 // START SNIPPET: example
 
from("quartz://myGroup/myTimerName?trigger.repeatInterval=2&trigger.repeatCount=1&stateful=true").to("mock:result");
 // END SNIPPET: example
 }
 };
-   }
-
+}
 }




[CONF] Apache Camel: POJO Messaging Example (page edited)

2009-01-27 Thread confluence










Page Edited :
CAMEL :
POJO Messaging Example



 
POJO Messaging Example
has been edited by Jonathan Anstey
(Jan 27, 2009).
 

 
 (View changes)
 

Content:
POJO Messaging Example


Introduction

This example shows that you don't need to learn Camel's super cool DSLs if you don't want to. Camel has a set of annotations that allow you to produce, consume or route messages to endpoints.

Requirements

This requires Camel 2.0, the camel-jms component and Apache ActiveMQ. Of course, since we are using Maven these dependencies will be downloaded automatically.

Running the example

The README.txt states how to run the example from either Ant or Maven.

Here's how to run it with Maven:

mvn camel:run


Whats happening?

When you start the example up you'll see a whole bunch of logs that won't really mean anything to you  The interesting stuff is happening in the background. Here's a diagram of whats going on.



TODO

See also


	Bean Integration
	Examples
	Tutorials
	User Guide













Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request

Unsubscribe or edit your notifications preferences








[CONF] Apache Camel: POJO Messaging Example (page edited)

2009-01-27 Thread confluence










Page Edited :
CAMEL :
POJO Messaging Example



 
POJO Messaging Example
has been edited by Jonathan Anstey
(Jan 27, 2009).
 

 
 (View changes)
 

Content:
POJO Messaging Example


Introduction

This example shows that you don't need to learn Camel's super cool DSLs if you don't want to. Camel has a set of annotations
that allow you to produce, consume or route messages to endpoints.

Requirements

This requires Camel 2.0, the camel-jms component and Apache ActiveMQ. Of course, since we are using Maven these
dependencies will be downloaded automatically.

Running the example

The README.txt states how to run the example from either Ant or Maven.

Here's how to run it with Maven:

mvn camel:run


Whats happening?

When you start the example up you'll see a whole bunch of logs that won't really mean anything to you  The
interesting stuff is happening in the background. Here's a diagram of whats going on.



TODO

See also


	Bean Integration
	Examples
	Tutorials
	User Guide













Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request

Unsubscribe or edit your notifications preferences








[CONF] Apache Camel: POJO Messaging Example (attachment added)

2009-01-27 Thread confluence










New files attached to:
CAMEL :
POJO Messaging Example




POJO Messaging Example
by Jonathan Anstey
.


Attached file(s):

pojo-messaging.jpg (image/jpeg, 39 kb)














Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request

Unsubscribe or edit your notifications preferences








[CONF] Apache Camel: POJO Messaging Example (page created)

2009-01-27 Thread confluence










Page Created :
CAMEL :
POJO Messaging Example



 
POJO Messaging Example
has been created by Jonathan Anstey
(Jan 27, 2009).
 

Content:
POJO Messaging Example


Introduction

This example shows that you don't need to learn Camel's super cool DSLs if you don't want to. Camel has a set of annotations
that allow you to produce, consume or route messages to endpoints.

Requirements

This requires Camel 2.0, the camel-jms component and Apache ActiveMQ. Of course, since we are using Maven these
dependencies will be downloaded automatically.

Running the example

The README.txt states how to run the example from either Ant or Maven.

Here's how to run it with Maven:

mvn camel:run


Whats happening?

When you start the example up you'll see a whole bunch of logs that won't really mean anything to you  The
interesting stuff is happening in the background. Here's a diagram of whats going on.

TODO

See also


	Bean Integration
	Examples
	Tutorials
	User Guide













Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request

Unsubscribe or edit your notifications preferences








svn commit: r738191 - in /camel/trunk/examples: ./ camel-example-pojo-messaging/ camel-example-pojo-messaging/src/ camel-example-pojo-messaging/src/data/ camel-example-pojo-messaging/src/main/ camel-e

2009-01-27 Thread janstey
Author: janstey
Date: Tue Jan 27 19:08:20 2009
New Revision: 738191

URL: http://svn.apache.org/viewvc?rev=738191&view=rev
Log:
CAMEL-1259 - Initial stab at POJO messaging example

Added:
camel/trunk/examples/camel-example-pojo-messaging/
camel/trunk/examples/camel-example-pojo-messaging/pom.xml   (with props)
camel/trunk/examples/camel-example-pojo-messaging/src/
camel/trunk/examples/camel-example-pojo-messaging/src/data/
camel/trunk/examples/camel-example-pojo-messaging/src/data/message1.xml   
(with props)
camel/trunk/examples/camel-example-pojo-messaging/src/data/message2.xml   
(with props)
camel/trunk/examples/camel-example-pojo-messaging/src/data/message3.xml   
(with props)
camel/trunk/examples/camel-example-pojo-messaging/src/main/
camel/trunk/examples/camel-example-pojo-messaging/src/main/java/
camel/trunk/examples/camel-example-pojo-messaging/src/main/java/org/
camel/trunk/examples/camel-example-pojo-messaging/src/main/java/org/apache/

camel/trunk/examples/camel-example-pojo-messaging/src/main/java/org/apache/camel/

camel/trunk/examples/camel-example-pojo-messaging/src/main/java/org/apache/camel/example/

camel/trunk/examples/camel-example-pojo-messaging/src/main/java/org/apache/camel/example/pojo_messaging/

camel/trunk/examples/camel-example-pojo-messaging/src/main/java/org/apache/camel/example/pojo_messaging/DistributeRecordsBean.java
   (with props)

camel/trunk/examples/camel-example-pojo-messaging/src/main/java/org/apache/camel/example/pojo_messaging/SendFileRecordsToQueueBean.java
   (with props)
camel/trunk/examples/camel-example-pojo-messaging/src/main/resources/

camel/trunk/examples/camel-example-pojo-messaging/src/main/resources/META-INF/

camel/trunk/examples/camel-example-pojo-messaging/src/main/resources/META-INF/LICENSE.txt
   (with props)

camel/trunk/examples/camel-example-pojo-messaging/src/main/resources/META-INF/NOTICE.txt
   (with props)

camel/trunk/examples/camel-example-pojo-messaging/src/main/resources/META-INF/spring/

camel/trunk/examples/camel-example-pojo-messaging/src/main/resources/META-INF/spring/camel-context.xml
   (with props)

camel/trunk/examples/camel-example-pojo-messaging/src/main/resources/log4j.properties
   (with props)
Modified:
camel/trunk/examples/pom.xml

Added: camel/trunk/examples/camel-example-pojo-messaging/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-pojo-messaging/pom.xml?rev=738191&view=auto
==
--- camel/trunk/examples/camel-example-pojo-messaging/pom.xml (added)
+++ camel/trunk/examples/camel-example-pojo-messaging/pom.xml Tue Jan 27 
19:08:20 2009
@@ -0,0 +1,101 @@
+
+
+
+
+http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://maven.apache.org/POM/4.0.0";>
+
+  4.0.0
+
+  
+org.apache.camel
+examples
+2.0-SNAPSHOT
+  
+
+  camel-example-pojo-messaging
+  Camel :: Example :: POJO Messaging
+  An example showing how to produce and consume messages from 
Camel endpoints using annotated POJOs
+
+  
+
+  org.apache.activemq
+  activemq-core
+
+
+  org.apache.activemq
+  activemq-camel
+
+
+  org.apache.camel
+  camel-core
+
+
+  org.apache.camel
+  camel-jms
+
+
+  org.apache.camel
+  camel-spring
+
+
+  org.apache.xbean
+  xbean-spring
+
+
+
+
+  commons-logging
+  commons-logging
+
+
+  log4j
+  log4j
+
+
+
+
+  junit
+  junit
+  test
+
+  
+
+  
+
+  
+  
+org.apache.camel
+camel-maven-plugin
+${pom.version}
+  
+
+
+  
+
+  
+
+  
+  
+org.apache.camel
+camel-maven-plugin
+${pom.version}
+  
+
+  
+

Propchange: camel/trunk/examples/camel-example-pojo-messaging/pom.xml
--
svn:eol-style = native

Added: camel/trunk/examples/camel-example-pojo-messaging/src/data/message1.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-pojo-messaging/src/data/message1.xml?rev=738191&view=auto
==
--- camel/trunk/examples/camel-example-pojo-messaging/src/data/message1.xml 
(added)
+++ camel/trunk/examples/camel-example-pojo-messaging/src/data/message1.xml Tue 
Jan 27 19:08:20 2009
@@ -0,0 +1,22 @@
+
+
+
+  James
+  Strachan
+  London
+
\ No newline at end of file

Propchange: 
camel/trunk/examples/camel-example-pojo-messaging/src/data/message1.xml
--
svn:eol-style = native

Added: camel/trunk/examples/camel-example-pojo-messaging/src/data/message2.xml
URL:

svn commit: r738173 - in /camel/trunk/components/camel-quartz/src: main/java/org/apache/camel/component/quartz/StatefulCamelJob.java test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest

2009-01-27 Thread hadrian
Author: hadrian
Date: Tue Jan 27 17:59:30 2009
New Revision: 738173

URL: http://svn.apache.org/viewvc?rev=738173&view=rev
Log:
Add missing Apache license comment.

Modified:

camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/StatefulCamelJob.java

camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java

Modified: 
camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/StatefulCamelJob.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/StatefulCamelJob.java?rev=738173&r1=738172&r2=738173&view=diff
==
--- 
camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/StatefulCamelJob.java
 (original)
+++ 
camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/StatefulCamelJob.java
 Tue Jan 27 17:59:30 2009
@@ -1,6 +1,20 @@
 /**
+ * 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.component.quartz;
 
 import org.apache.camel.CamelContext;

Modified: 
camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java?rev=738173&r1=738172&r2=738173&view=diff
==
--- 
camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
 (original)
+++ 
camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
 Tue Jan 27 17:59:30 2009
@@ -1,6 +1,20 @@
 /**
+ * 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.component.quartz;
 
 import java.util.List;




svn commit: r738171 - in /camel/trunk/components/camel-quartz/src: main/java/org/apache/camel/component/quartz/ test/java/org/apache/camel/component/quartz/

2009-01-27 Thread hadrian
Author: hadrian
Date: Tue Jan 27 17:58:08 2009
New Revision: 738171

URL: http://svn.apache.org/viewvc?rev=738171&view=rev
Log:
CAMEL-1002. Patch applied with thanks. 

Added:

camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/StatefulCamelJob.java

camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
Modified:

camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java

camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java

Modified: 
camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java?rev=738171&r1=738170&r2=738171&view=diff
==
--- 
camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
 (original)
+++ 
camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
 Tue Jan 27 17:58:08 2009
@@ -46,12 +46,12 @@
 public QuartzComponent() {
 }
 
-public QuartzComponent(CamelContext context) {
+public QuartzComponent(final CamelContext context) {
 super(context);
 }
 
 @Override
-protected QuartzEndpoint createEndpoint(String uri, String remaining, Map 
parameters) throws Exception {
+protected QuartzEndpoint createEndpoint(final String uri, final String 
remaining, final Map parameters) throws Exception {
 QuartzEndpoint answer = new QuartzEndpoint(uri, this, getScheduler());
 
 // lets split the remaining into a group/name
@@ -126,7 +126,7 @@
 return factory;
 }
 
-public void setFactory(SchedulerFactory factory) {
+public void setFactory(final SchedulerFactory factory) {
 this.factory = factory;
 }
 
@@ -137,7 +137,7 @@
 return scheduler;
 }
 
-public void setScheduler(Scheduler scheduler) {
+public void setScheduler(final Scheduler scheduler) {
 this.scheduler = scheduler;
 }
 
@@ -145,7 +145,7 @@
 return triggers;
 }
 
-public void setTriggers(Map triggers) {
+public void setTriggers(final Map triggers) {
 this.triggers = triggers;
 }
 
@@ -156,6 +156,8 @@
 }
 
 protected Scheduler createScheduler() throws SchedulerException {
-return getFactory().getScheduler();
+   Scheduler scheduler = getFactory().getScheduler();
+   scheduler.getContext().put(QuartzEndpoint.CONTEXT_KEY, 
getCamelContext());
+return scheduler;
 }
 }

Modified: 
camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java?rev=738171&r1=738170&r2=738171&view=diff
==
--- 
camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
 (original)
+++ 
camel/trunk/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
 Tue Jan 27 17:58:08 2009
@@ -45,25 +45,29 @@
  * @version $Revision:520964 $
  */
 public class QuartzEndpoint extends DefaultEndpoint {
-public static final String ENDPOINT_KEY = "org.apache.camel.quartz";
 private static final transient Log LOG = 
LogFactory.getLog(QuartzEndpoint.class);
+
+public static final String ENDPOINT_KEY = "org.apache.camel.quartz";
+public static final String CONTEXT_KEY = "org.apache.camel.CamelContext";
+
 private Scheduler scheduler;
 private LoadBalancer loadBalancer;
 private Trigger trigger;
 private JobDetail jobDetail;
 private boolean started;
+private boolean stateful;
 
-public QuartzEndpoint(String endpointUri, QuartzComponent component, 
Scheduler scheduler) {
+public QuartzEndpoint(final String endpointUri, final QuartzComponent 
component, final Scheduler scheduler) {
 super(endpointUri, component);
 this.scheduler = scheduler;
 }
 
-public QuartzEndpoint(String endpointUri, Scheduler scheduler) {
+public QuartzEndpoint(final String endpointUri, final Scheduler scheduler) 
{
 super(endpointUri);
 this.scheduler = scheduler;
 }
 
-public void addTriggers(Map triggerMap) throws 
SchedulerException {
+public void addTriggers(final Map triggerMap) throws 
SchedulerException {
 if (triggerMap != null) {
 Set> entries = triggerMap.entrySet();
 for (Map.Entry entry : entries) {
@@ -77,7 +81,7 @@
 }
 }
 
-public void addTrigger(Trigger trigger, JobDetail detail) throws

svn commit: r738122 - in /camel/branches/camel-1.x/components/camel-quartz/src: main/java/org/apache/camel/component/quartz/ test/java/org/apache/camel/component/quartz/

2009-01-27 Thread hadrian
Author: hadrian
Date: Tue Jan 27 16:04:02 2009
New Revision: 738122

URL: http://svn.apache.org/viewvc?rev=738122&view=rev
Log:
CAMEL-1002.  Patch applied with thanks to Martin.

Added:

camel/branches/camel-1.x/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/StatefulCamelJob.java

camel/branches/camel-1.x/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
Modified:

camel/branches/camel-1.x/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java

camel/branches/camel-1.x/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java

Modified: 
camel/branches/camel-1.x/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java?rev=738122&r1=738121&r2=738122&view=diff
==
--- 
camel/branches/camel-1.x/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
 (original)
+++ 
camel/branches/camel-1.x/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
 Tue Jan 27 16:04:02 2009
@@ -46,12 +46,12 @@
 public QuartzComponent() {
 }
 
-public QuartzComponent(CamelContext context) {
+public QuartzComponent(final CamelContext context) {
 super(context);
 }
 
 @Override
-protected QuartzEndpoint createEndpoint(String uri, String remaining, Map 
parameters) throws Exception {
+protected QuartzEndpoint createEndpoint(final String uri, final String 
remaining, final Map parameters) throws Exception {
 QuartzEndpoint answer = new QuartzEndpoint(uri, this, getScheduler());
 
 // lets split the remaining into a group/name
@@ -126,7 +126,7 @@
 return factory;
 }
 
-public void setFactory(SchedulerFactory factory) {
+public void setFactory(final SchedulerFactory factory) {
 this.factory = factory;
 }
 
@@ -137,7 +137,7 @@
 return scheduler;
 }
 
-public void setScheduler(Scheduler scheduler) {
+public void setScheduler(final Scheduler scheduler) {
 this.scheduler = scheduler;
 }
 
@@ -145,7 +145,7 @@
 return triggers;
 }
 
-public void setTriggers(Map triggers) {
+public void setTriggers(final Map triggers) {
 this.triggers = triggers;
 }
 
@@ -156,6 +156,8 @@
 }
 
 protected Scheduler createScheduler() throws SchedulerException {
-return getFactory().getScheduler();
+Scheduler scheduler = getFactory().getScheduler();
+scheduler.getContext().put(QuartzEndpoint.CONTEXT_KEY, 
getCamelContext());
+return scheduler;
 }
 }

Modified: 
camel/branches/camel-1.x/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java?rev=738122&r1=738121&r2=738122&view=diff
==
--- 
camel/branches/camel-1.x/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
 (original)
+++ 
camel/branches/camel-1.x/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
 Tue Jan 27 16:04:02 2009
@@ -44,24 +44,27 @@
  */
 public class QuartzEndpoint extends DefaultEndpoint {
 public static final String ENDPOINT_KEY = "org.apache.camel.quartz";
+public static final String CONTEXT_KEY = "org.apache.camel.CamelContext";
+
 private static final transient Log LOG = 
LogFactory.getLog(QuartzEndpoint.class);
 private Scheduler scheduler;
 private LoadBalancer loadBalancer;
 private Trigger trigger;
 private JobDetail jobDetail;
 private boolean started;
+private boolean stateful;
 
-public QuartzEndpoint(String endpointUri, QuartzComponent component, 
Scheduler scheduler) {
+public QuartzEndpoint(final String endpointUri, final QuartzComponent 
component, final Scheduler scheduler) {
 super(endpointUri, component);
 this.scheduler = scheduler;
 }
 
-public QuartzEndpoint(String endpointUri, Scheduler scheduler) {
+public QuartzEndpoint(final String endpointUri, final Scheduler scheduler) 
{
 super(endpointUri);
 this.scheduler = scheduler;
 }
 
-public void addTriggers(Map triggerMap) throws 
SchedulerException {
+public void addTriggers(final Map triggerMap) throws 
SchedulerException {
 if (triggerMap != null) {
 Set> entries = triggerMap.entrySet();
 for (Map.Entry entry : entries) {
@@ -75,7 +78,7 @@
 }
 }
 
-publ

svn commit: r738115 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/component/file/ main/java/org/apache/camel/component/file/strategy/ test/java/org/apache/camel/component/file/ test/jav

2009-01-27 Thread davsclaus
Author: davsclaus
Date: Tue Jan 27 15:53:52 2009
New Revision: 738115

URL: http://svn.apache.org/viewvc?rev=738115&view=rev
Log:
Fixed failing unit tests reported by team city. Fixed checkstyle errors.

Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java

camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileExchange.java

camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/NewFileLockExclusiveReadLockStrategy.java

camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/NewMarkerFileExclusiveReadLockStrategy.java

camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileNoOpLockFileTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationUsingDefaultsTest.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java?rev=738115&r1=738114&r2=738115&view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
 Tue Jan 27 15:53:52 2009
@@ -16,14 +16,13 @@
  */
 package org.apache.camel.component.file;
 
-import java.io.IOException;
 import java.io.File;
+import java.io.IOException;
 import java.lang.reflect.Method;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.camel.CamelContext;
 import org.apache.camel.Component;
 import org.apache.camel.Expression;
 import org.apache.camel.Message;

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileExchange.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileExchange.java?rev=738115&r1=738114&r2=738115&view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileExchange.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileExchange.java
 Tue Jan 27 15:53:52 2009
@@ -17,7 +17,6 @@
 package org.apache.camel.component.file;
 
 import java.util.Date;
-import java.io.IOException;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/NewFileLockExclusiveReadLockStrategy.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/NewFileLockExclusiveReadLockStrategy.java?rev=738115&r1=738114&r2=738115&view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/NewFileLockExclusiveReadLockStrategy.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/NewFileLockExclusiveReadLockStrategy.java
 Tue Jan 27 15:53:52 2009
@@ -41,8 +41,7 @@
 private static final transient Log LOG = 
LogFactory.getLog(NewFileLockExclusiveReadLockStrategy.class);
 private long timeout;
 
-public boolean acquireExclusiveReadLock(GenericFileOperations 
operations, GenericFile file, Exchange exchange)
-throws Exception {
+public boolean acquireExclusiveReadLock(GenericFileOperations 
operations, GenericFile file, Exchange exchange) throws Exception {
 File target = new File(file.getAbsoluteFileName());
 
 if (LOG.isTraceEnabled()) {
@@ -111,8 +110,7 @@
 Channel channel = lock.channel();
 try {
 lock.release();
-}
-finally {
+} finally {
 // must close channel
 ObjectHelper.close(channel, "while acquiring exclusive read lock 
for file: " + lockFileName, LOG);
 }

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/NewMarkerFileExclusiveReadLockStrategy.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/NewMarkerFileExclusiveReadLockStrategy.java?rev=738115&r1=738114&r2=738115&view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/NewMarkerFileExclusiveReadLockStrategy.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/NewMarkerFileExclusiveReadLockStrategy.java
 Tue Jan 27 15:53:5

svn commit: r738093 [2/2] - in /camel/trunk: camel-core/src/main/java/org/apache/camel/builder/ camel-core/src/main/java/org/apache/camel/component/file/ camel-core/src/main/java/org/apache/camel/comp

2009-01-27 Thread davsclaus
Modified: 
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProduceGeneratedFileNameTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProduceGeneratedFileNameTest.java?rev=738093&r1=738092&r2=738093&view=diff
==
--- 
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProduceGeneratedFileNameTest.java
 (original)
+++ 
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProduceGeneratedFileNameTest.java
 Tue Jan 27 13:55:53 2009
@@ -30,7 +30,7 @@
 
 public void testGeneratedFileName() throws Exception {
 Endpoint endpoint = context.getEndpoint("direct:a");
-FileEndpoint fileEndpoint = resolveMandatoryEndpoint("file://target", 
FileEndpoint.class);
+NewFileEndpoint fileEndpoint = 
resolveMandatoryEndpoint("newfile://target", NewFileEndpoint.class);
 
 Exchange exchange = endpoint.createExchange();
 exchange.getIn().setBody("Hello World");
@@ -47,7 +47,7 @@
 protected RouteBuilder createRouteBuilder() throws Exception {
 return new RouteBuilder() {
 public void configure() throws Exception {
-from("direct:a").to("file://target");
+from("direct:a").to("newfile://target");
 }
 };
 }

Modified: 
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProduceTempPrefixTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProduceTempPrefixTest.java?rev=738093&r1=738092&r2=738093&view=diff
==
--- 
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProduceTempPrefixTest.java
 (original)
+++ 
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProduceTempPrefixTest.java
 Tue Jan 27 13:55:53 2009
@@ -27,24 +27,22 @@
  */
 public class FileProduceTempPrefixTest extends ContextTestSupport {
 
-private String fileUrl = 
"file://target/tempandrename/?tempPrefix=inprogress.";
+private String fileUrl = 
"newfile://target/tempandrename/?tempPrefix=inprogress.";
 
 public void testCreateTempFileName() throws Exception {
 Endpoint endpoint = context.getEndpoint(fileUrl);
-FileProducer producer = (FileProducer) endpoint.createProducer();
+GenericFileProducer producer = (GenericFileProducer) 
endpoint.createProducer();
 
-File fileName = new File("target/tempandrename/claus.txt");
-File tempFileName = producer.createTempFileName(fileName);
-assertEquals("target" + File.separatorChar + "tempandrename" + 
File.separatorChar + "inprogress.claus.txt", tempFileName.getPath());
+String tempFileName = 
producer.createTempFileName("target/tempandrename/claus.txt");
+assertEquals("target" + File.separatorChar + "tempandrename" + 
File.separatorChar + "inprogress.claus.txt", tempFileName);
 }
 
 public void testNoPathCreateTempFileName() throws Exception {
 Endpoint endpoint = context.getEndpoint(fileUrl);
-FileProducer producer = (FileProducer) endpoint.createProducer();
+GenericFileProducer producer = (GenericFileProducer) 
endpoint.createProducer();
 
-File fileName = new File("claus.txt");
-File tempFileName = producer.createTempFileName(fileName);
-assertEquals("inprogress.claus.txt", tempFileName.getPath());
+String tempFileName = producer.createTempFileName("claus.txt");
+assertEquals("inprogress.claus.txt", tempFileName);
 }
 
 public void testTempPrefix() throws Exception {

Modified: 
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileRouteTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileRouteTest.java?rev=738093&r1=738092&r2=738093&view=diff
==
--- 
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileRouteTest.java
 (original)
+++ 
camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileRouteTest.java
 Tue Jan 27 13:55:53 2009
@@ -31,7 +31,7 @@
 protected Object expectedBody = "Hello there!";
 protected String targetdir = "target/test-default-inbox";
 protected String params = "?recursive=true";
-protected String uri = "file:" + targetdir + params;
+protected String uri = "newfile:" + targetdir + params;
 protected LockRecorderProcessor recorder = new LockRecorderProcessor();
 
 public void testFileRoute() throws Exception {
@@ -47,7 +47,7 @@
 @Override
 protected void setUp() throws Exception {
 deleteDirectory(targetdir);
-uri = "file:" + targetdir + params;
+uri = "newfile:" + targetdir +

[CONF] Apache Camel: RecipientList Annotation (page edited)

2009-01-27 Thread confluence










Page Edited :
CAMEL :
RecipientList Annotation



 
RecipientList Annotation
has been edited by James Strachan
(Jan 27, 2009).
 

 
 (View changes)
 

Content:
@RecipientList Annotation

As of 1.5.0 we now support the use of @RecipientList on a bean method to easily create a dynamic Recipient List using a Java method.

Simple Example using @Consume


package com.acme.foo;

public class RouterBean {

@Consume(uri = "activemq:foo")
@RecipientList
public String[] route(String body) {
return new String[]{"activemq:bar", "activemq:whatnot"};
}
}


For example if the above bean is configured in Spring when using a  element as follows


"1.0" encoding="UTF-8"?>
"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.5.xsd
   http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
">

  "http://activemq.apache.org/camel/schema/spring"/>

  "myRecipientList" class="com.acme.foo.RouterBean"/>




then a route will be created consuming from the foo queue on the ActiveMQ component which when a message is received the message will be forwarded to the endpoints defined by the result of this method call - namely the bar and whatnot queues.

How it works

The return value of the @RecipientList method is  converted to either a java.util.Collection / java.util.Iterator or array of objects where each element is converted to an Endpoint or a String, or if you are only going to route to a single endpoint then just return either an Endpoint object or an object that can be converted to a String. So the following methods are all valid 


@RecipientList 
public String[] route(String body) { ... }

@RecipientList 
public List route(String body) { ... }

@RecipientList 
public Endpoint route(String body) { ... }

@RecipientList 
public Endpoint[] route(String body) { ... }

@RecipientList 
public Collection route(String body) { ... }

@RecipientList 
public URI route(String body) { ... }

@RecipientList 
public URI[] route(String body) { ... }


Then for each endpoint or URI the message is forwarded a separate copy to that endpoint. 

You can then use whatever Java code you wish to figure out what endpoints to route to; for example you can use the Bean Binding annotations to inject parts of the message body or headers or use _expression_ values on the message.

More Complex Example Using DSL

In this example we will use more complex Bean Binding, plus we will use a separate route to invoke the Recipient List


public class RouterBean2 {

@RecipientList
public String route(@Header("customerID") String custID String body) {
	if (custID == null)  return null;
return "activemq:Customers.Orders." + custID;
}
}

public class MyRouteBuilder extends RouteBuilder {
protected void configure() {
from("activemq:Orders.Incoming").beanRef("myRouterBean", "route");
}
}



Notice how we are injecting some headers or expressions and using them to determine the recipients. See the Bean Integration for more details.












Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request

Unsubscribe or edit your notifications preferences








[CONF] Apache Camel: RecipientList Annotation (page edited)

2009-01-27 Thread confluence










Page Edited :
CAMEL :
RecipientList Annotation



 
RecipientList Annotation
has been edited by James Strachan
(Jan 27, 2009).
 

 
 (View changes)
 

Content:
@RecipientList Annotation

As of 1.5.0 we now support the use of @RecipientList on a bean method to easily create a dynamic Recipient List using a Java method.

Simple Example using @Consume


public class RouterBean {

@Consume(uri = "activemq:foo")
@RecipientList
public String[] route(String body) {
return new String[]{"activemq:bar", "activemq:whatnot"};
}
}


For example if the above bean is configured in Spring when using a  element as follows


"1.0" encoding="UTF-8"?>
"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.5.xsd
   http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
">

  "http://activemq.apache.org/camel/schema/spring"/>

  "myRecipientList" class="com.acme.foo.RoutingBean"/>




then a route will be created consuming from the foo queue on the ActiveMQ component which when a message is received the message will be forwarded to the endpoints defined by the result of this method call - namely the bar and whatnot queues.

How it works

The return value of the @RecipientList method is  converted to either a java.util.Collection / java.util.Iterator or array of objects where each element is converted to an Endpoint or a String, or if you are only going to route to a single endpoint then just return either an Endpoint object or an object that can be converted to a String. So the following methods are all valid 


@RecipientList 
public String[] route(String body) { ... }

@RecipientList 
public List route(String body) { ... }

@RecipientList 
public Endpoint route(String body) { ... }

@RecipientList 
public Endpoint[] route(String body) { ... }

@RecipientList 
public Collection route(String body) { ... }

@RecipientList 
public URI route(String body) { ... }

@RecipientList 
public URI[] route(String body) { ... }


Then for each endpoint or URI the message is forwarded a separate copy to that endpoint. 

You can then use whatever Java code you wish to figure out what endpoints to route to; for example you can use the Bean Binding annotations to inject parts of the message body or headers or use _expression_ values on the message.

More Complex Example Using DSL

In this example we will use more complex Bean Binding, plus we will use a separate route to invoke the Recipient List


public class RouterBean2 {

@RecipientList
public String route(@Header("customerID") String custID String body) {
	if (custID == null)  return null;
return "activemq:Customers.Orders." + custID;
}
}

public class MyRouteBuilder extends RouteBuilder {
protected void configure() {
from("activemq:Orders.Incoming").beanRef("myRouterBean", "route");
}
}



Notice how we are injecting some headers or expressions and using them to determine the recipients. See the Bean Integration for more details.












Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request

Unsubscribe or edit your notifications preferences








[CONF] Apache Camel: Enterprise Integration Patterns (page edited)

2009-01-27 Thread confluence










Page Edited :
CAMEL :
Enterprise Integration Patterns



 
Enterprise Integration Patterns
has been edited by Claus Ibsen
(Jan 27, 2009).
 

 
 (View changes)
 

Content:
Enterprise Integration Patterns

Camel supports most of the Enterprise Integration Patterns from the excellent book by Gregor Hohpe and Bobby Woolf. 

If you are new to Camel you might want to try the Getting Started in the User Guide before attempting to implement these patterns.


Messaging Systems



  
 Message Channel 
 How does one application communicate with another using messaging? 


  
 Message 
 How can two applications connected by a message channel exchange a piece of information? 


  
 Pipes and Filters 
 How can we perform complex processing on a message while maintaining independence and flexibility? 


  
 Message Router 
 How can you decouple individual processing steps so that messages can be passed to different filters depending on a set of conditions? 


  
 Message Translator 
 How can systems using different data formats communicate with each other using messaging? 


  
 Message Endpoint 
 How does an application connect to a messaging channel to send and receive messages? 



Messaging Channels



  
 Point to Point Channel 
 How can the caller be sure that exactly one receiver will receive the document or perform the call? 


  
 Publish Subscribe Channel 
 How can the sender broadcast an event to all interested receivers? 


  
 Dead Letter Channel 
 What will the messaging system do with a message it cannot deliver?  


  
 Guaranteed Delivery 
 How can the sender make sure that a message will be delivered, even if the messaging system fails? 


  
 Message Bus 
 What is an architecture that enables separate applications to work together, but in a de-coupled fashion such that applications can be easily added or removed without affecting the others? 



Message Construction



  
 Event Message 
 How can messaging be used to transmit events from one application to another? 


  
 Request Reply 
 When an application sends a message, how can it get a response from the receiver? 


  
 Correlation Identifier 
 How does a requestor that has received a reply know which request this is the reply for? 



Message Routing



  
 Content Based Router 
 How do we handle a situation where the implementation of a single logical function (e.g., inventory check) is spread across multiple physical systems? 


  
 Message Filter 
 How can a component avoid receiving uninteresting messages? 


  
 Dynamic Router 
 How can you avoid the dependency of the router on all possible destinations while maintaining its efficiency? 


  
 Recipient List 
 How do we route a message to a list of (static or dynamically) specified recipients? 


  
 Splitter 
 How can we process a message if it contains multiple elements, each of which may have to be processed in a different way? 


  
 Aggregator 
 How do we combine the results of individual, but related messages so that they can be processed as a whole? 


  
 Resequencer 
 How can we get a stream of related but out-of-sequence messages back into the correct order? 


  
 Routing Slip 
 How do we route a message consecutively through a series of processing steps when the sequence of steps is not known at design-time and may vary for each message? 


  
 Throttler 
 How can I throttle messages to ensure that a specific endpoint does not get overloaded, or we don't exceed an agreed SLA with some external service? 


  
 Delayer 
 How can I delay the sending of a message? 


  
 Load Balancer 
 How can I balance load across a number of endpoints? 


  
 Multicast 
 How can I route a message to a number of endpoints at the same time? 


  
 Loop 
 How can I repeat processing a message in a loop? 



Message Transformation



  
 Content Enricher 
 How do we communicate with another system if the message originator does not have all the required data items available? 


  
 Content Filter 
 How do you simplify dealing with a large message, when you are interested only in a few data items? 


  
 Normalizer 
 How do you process messages that are semantically equivalent, but arrive in a different format? 



Messaging Endpoints



  
 Messaging Mapper 
 How do you move data between domain objects and the messaging infrastructure while keeping the two independent of each other? 


  
 Event Driven Consumer 
 How can an application automatically consume messages as they become available? 


  
 Polling Consumer 
 How can an application consume a message when the application is ready? 


  
 Competing Consumers 
 How can a messaging client process multiple messages concurrently? 


  
 Message Dispatcher 
 How can multiple consumers on a single channel coordinate their message processing? 


  
 Selective Consumer 
 How can a message consumer sele

[CONF] Apache Camel: Recipient List (page edited)

2009-01-27 Thread confluence










Page Edited :
CAMEL :
Recipient List



 
Recipient List
has been edited by Claus Ibsen
(Jan 27, 2009).
 

  Change summary:
  fixed repo link

 
 (View changes)
 

Content:
Recipient List

The Recipient List from the EIP patterns allows you to route messages to a number of dynamically specified recipients.



Static Recipient List

The following example shows how to route a request from an input queue:a endpoint to a static list of destinations

Using Annotations
You can use the RecipientList Annotation on a POJO to create a Dynamic Recipient List. For more details see the Bean Integration.

Using the Fluent Builders

RouteBuilder builder = new RouteBuilder() {
public void configure() {
from("seda:a").multicast().to("seda:b", "seda:c", "seda:d");
}
};


Using the Spring XML Extensions

"camel" xmlns="http://activemq.apache.org/camel/schema/spring">
  
"seda:a"/>

  "seda:b"/>
  "seda:c"/>
  "seda:d"/>

  



Dynamic Recipient List

Usually one of the main reasons for using the Recipient List pattern is that the list of recipients is dynamic and calculated at runtime. The following example demonstrates how to create a dynamic recipient list using an _expression_ (which in this case it extracts a named header value dynamically) to calculate the list of endpoints which are either of type Endpoint or are converted to a String and then resolved using the endpoint URIs.

Using the Fluent Builders

RouteBuilder builder = new RouteBuilder() {
public void configure() {
from("seda:a").recipientList(header("foo"));
}
};


The above assumes that the header contains a list of endpoint URIs. The following takes a single string header and tokenizes it

from("direct:a").recipientList(
header("recipientListHeader").tokenize(","));


Iterateable value
The dynamic list of recipients that are defined in the header must be iterateable such as:

	java.util.Collection
	java.util.Iterator
	arrays
	org.w3c.dom.NodeList
	Camel 1.5.1: a single String with values separated with comma
	any other type will be regarded as a single value



Using the Spring XML Extensions

"camel" xmlns="http://activemq.apache.org/camel/schema/spring">
  
"seda:a"/>

  $foo

  



For further examples of this pattern in use you could look at one of the junit test case

Using delimiter in Spring XML
Available as of Camel 1.5.1
In Spring DSL you can set the delimiter attribute for setting a delimiter to be used if the header value is a single String with multiple separated endpoints.


"camel" xmlns="http://activemq.apache.org/camel/schema/spring">

"direct:a"/>

",">
myHeader





So if myHeader contains a String with the value "activemq:queue:foo, activemq:topic:hello , log:bar" then Camel will split the String using the delimiter given in the XML that was comma, resulting into 3 endpoints to send to. You can use spaces between the endpoints as Camel will trim the value when it lookup the endpoint to send to. 

Note: In Java DSL you use the tokenizer to archive the same. The route above in Java DSL:

from("direct:a").recipientList(header("myHeader").tokenize(","));


Using This Pattern

If you would like to use this EIP Pattern then please read the Getting Started, you may also find the Architecture useful particularly the description of Endpoint and URIs. Then you could try out some of the Examples first before trying this pattern out.











Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request

Unsubscribe or edit your notifications preferences