svn commit: r1069338 - /camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxNotificationEventNotifierTest.java

2011-02-10 Thread davsclaus
Author: davsclaus
Date: Thu Feb 10 10:56:12 2011
New Revision: 1069338

URL: http://svn.apache.org/viewvc?rev=1069338view=rev
Log:
Fixed snippet for docu

Modified:

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

Modified: 
camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxNotificationEventNotifierTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxNotificationEventNotifierTest.java?rev=1069338r1=1069337r2=1069338view=diff
==
--- 
camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxNotificationEventNotifierTest.java
 (original)
+++ 
camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxNotificationEventNotifierTest.java
 Thu Feb 10 10:56:12 2011
@@ -55,7 +55,7 @@ public class JmxNotificationEventNotifie
 DefaultManagementNamingStrategy naming = 
(DefaultManagementNamingStrategy) 
context.getManagementStrategy().getManagementNamingStrategy();
 naming.setHostName(localhost);
 naming.setDomainName(org.apache.camel);
-// END SNIPPET: e2
+// END SNIPPET: e1
 return context;
 }
 




svn commit: r1069440 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java

2011-02-10 Thread jstrachan
Author: jstrachan
Date: Thu Feb 10 16:00:30 2011
New Revision: 1069440

URL: http://svn.apache.org/viewvc?rev=1069440view=rev
Log:
allow the same Camel Type Conversion we support for Endpoints to also work for 
Components when resolving a component in the registry for CAMEL-3651 and 
CAMEL-3563

Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java?rev=1069440r1=1069439r2=1069440view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentResolver.java
 Thu Feb 10 16:00:30 2011
@@ -23,6 +23,7 @@ import org.apache.camel.Component;
 import org.apache.camel.NoFactoryAvailableException;
 import org.apache.camel.spi.ComponentResolver;
 import org.apache.camel.spi.FactoryFinder;
+import org.apache.camel.util.CamelContextHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -55,6 +56,13 @@ public class DefaultComponentResolver im
 if (bean != null) {
 if (bean instanceof Component) {
 return (Component) bean;
+} else {
+// lets use Camel's type conversion mechanism to convert 
things like CamelContext
+// and other types into a valid Component
+Component component = CamelContextHelper.convertTo(context, 
Component.class, bean);
+if (component != null) {
+return component;
+}
 }
 // we do not throw the exception here and try to auto create a 
component
 }




[CONF] Apache Camel Component List

2011-02-10 Thread confluence







Component List
Page edited by James Strachan


 Changes (1)
 




...
cometd://host:port/channelname {code} | Used to deliver messages using the [jetty cometd implementation|http://docs.codehaus.org/display/JETTY/Cometd+(aka+Bayeux)] of the [bayeux protocol|http://svn.xantus.org/shortbus/trunk/bayeux/bayeux.html] | 
| [Context] / camel-context {code:xml} context:camelContextId:localEndpointName {code} | Used to refer to endpoints within a separate CamelContext to provide a simple [black box composition|Context] approach so that routes can be combined into a CamelContext and then used as a black box component inside other routes in other CamelContexts | 
| [Crypto (Digital Signatures)] / camel-crypto {code:xml} 
...


Full Content




 Component / ArtifactId / URI 
 Description 


 ActiveMQ / activemq-camel


activemq:[topic:]destinationName

 
 For JMS Messaging with Apache ActiveMQ 


 ActiveMQ Journal / activemq-core


activemq.journal:directory-on-filesystem

 
 Uses ActiveMQ's fast disk journaling implementation to store message bodies in a rolling log file 


 AMQP / camel-amqp


amqp:[topic:]destinationName

 
 For Messaging with AMQP protocol 


 Atom / camel-atom


atom:uri

 
 Working with Apache Abdera for atom integration, such as consuming an atom feed. 


 AWS-SQS / camel-aws


aws-sqs://queuename[?options]

 
 For Messaging with Amazon's Simple Queue Service (SQS). 


 Bean / camel-core


bean:beanName[?method=someMethod]

 
 Uses the Bean Binding to bind message exchanges to beans in the Registry. Is also used for exposing and invoking POJO (Plain Old Java Objects). 


 Bean Validation / camel-bean-validator


bean-validator:something

 
 Validates the payload of a message using the Java Validation API (JSR 303 and JAXP Validation) and its reference implementation Hibernate Validator 


 Browse / camel-core


browse:someName

 
 Provides a simple BrowsableEndpoint which can be useful for testing, visualisation tools or debugging. The exchanges sent to the endpoint are all available to be browsed. 


 Cache / camel-cache


cache://cachename[?options]

 
 The cache component facilitates creation of caching endpoints and processors using EHCache as the cache implementation. 


 Class / camel-core


class:className[?method=someMethod]

 
 Uses the Bean Binding to bind message exchanges to beans in the Registry. Is also used for exposing and invoking POJO (Plain Old Java Objects). 


 Cometd / camel-cometd


cometd://host:port/channelname

 
 Used to deliver messages using the jetty cometd implementation of the bayeux protocol 


 Context / camel-context


context:camelContextId:localEndpointName

 
 Used to refer to endpoints within a separate CamelContext to provide a simple black box composition approach so that routes can be combined into a CamelContext and then used as a black box component inside other routes in other CamelContexts 


 Crypto Digital Signatures / camel-crypto


crypto:sign:name[?options]
crypto:verify:name[?options]

 
 Used to sign and verify exchanges using the Signature Service of the Java Cryptographic Extension.


 CXF / camel-cxf


cxf:address[?serviceClass=...]

 
 Working with Apache CXF for web services integration 


 CXF Bean  / camel-cxf


cxf:bean name

 
 Proceess the exchange using a JAX WS or JAX RS annotated bean from the registry. Requires less configuration than the above CXF Component 


 CXFRS / camel-cxf


cxfrs:address[?resourcesClasses=...]

 
 Working with Apache CXF for REST services integration 


 DataSet / camel-core


dataset:name

 
 For load  soak testing the DataSet provides a way to create huge numbers of messages for sending to Components or asserting that they are consumed correctly 


 Db4o / camel-db4o in camel-extra


db4o://className

 
 For using a db4o datastore as a queue via the db4o library 


 Direct / camel-core


direct:name

 
 Synchronous call to another endpoint 


 EJB / camel-ejb


ejb:ejbName[?method=someMethod]

 
 Uses the Bean Binding to bind message exchanges to EJBs. It works like the Bean component but just for accessing EJBs. Supports EJB 3.0 onwards. 


 Esper / camel-esper in camel-extra


esper:name

 
 Working with the Esper Library for Event Stream Processing 


 Event / camel-spring


event://default
spring-event://default

 
 Working with Spring ApplicationEvents 


 EventAdmin / camel-eventadmin


eventadmin:topic

 
 Receiving OSGi EventAdmin events 


 Exec / camel-exec


exec://executable[?options]

 
 For executing system commands 


 File / camel-core


file://nameOfFileOrDirectory

 
 Sending messages to a file or polling a file or directory. Camel 1.x use this link File. 


 Flatpack / camel-flatpack


flatpack:[fixed|delim]:configFile

 
 

[CONF] Apache Camel Routebox

2011-02-10 Thread confluence







Routebox
Page edited by James Strachan


 Changes (45)
 




h2. Routebox Context Component 
 
*Available as of Camel 2.67* 
 
The *routebox* component enables the creation of specialized endpoints that offer encapsulation and a strategy based indirection service to a collection of camel routes hosted in an automatically created or user injected camel context. 
The *context* component allows you to create a CamelContext with a number of routes inside then treat it as a black box and refer to the local endpoints within the black box from other CamelContexts. 
 
Routebox endpoints are camel endpoints that may be invoked directly on camel routes. The routebox endpoint performs the following key functions * encapsulation - acts as a blackbox, hosting a collection of camel routes stored in an inner camel context. The inner context is fully under the control of the routebox component and is *JVM bound*.  * strategy based indirection - direct payloads sent to the routebox endpoint along a camel route to specific inner routes based on a user defined internal routing strategy or a dispatch map. * exchange propagation - forward exchanges modified by the routebox endpoint to the next segment of the camel route.  
It is similar to the [Routebox] component, though the Context component tries to be really simple for end users; just a simple convention over configuration approach to refer to local endpoints inside a black box (CamelContext). 
 
The routebox component supports both consumer and producer endpoints.   Producer endpoints are of two flavors * Producers that send or dispatch incoming requests to a external routebox consumer endpoint  * Producers that directly invoke routes in an internal embedded camel context thereby not sending requests to an external consumer.
Maven users will need to add the following dependency to their {{pom.xml}} for this component: {code:xml} dependency groupIdorg.apache.camel/groupId 
artifactIdcamel-routebox/artifactId artifactIdcamel-context/artifactId 
versionx.x.x/version !-- use the same version as your Camel core version -- /dependency {code} 
 h3. The need for a Camel Routebox endpoint 
 
The routebox component is designed to ease integration in complex environments needing   * a large collection of routes and   * involving a wide set of endpoint technologies needing integration in different ways In such environments, it is often necessary to craft an integration solution by creating a sense of layering among camel routes effectively organizing them into* Coarse grained or higher level routes - aggregated collection of inner or lower level routes exposed as Routebox endpoints that represent an integration focus area. For example   ||Focus Area||Coarse grained Route Examples|||Department Focus|HR routes, Sales routes etc|   |Supply chain  B2B Focus|Shipping routes, Fulfillment routes, 3rd party services etc|   |Technology Focus|Database routes, JMS routes, Scheduled batch routes etc|   * Fine grained routes - routes that execute a singular and specific business and/or integration pattern.  Requests sent to Routebox endpoints on coarse grained routes can then delegate requests to inner fine grained routes to achieve a specific integration objective, collect the final inner result, and continue to progress to the next step along the coarse-grained route.  
h3. URI format  {code} 
routebox:routeboxname[?options] context:camelContextId:localEndpointName[?options] 
{code}  
You can append query options to the URI in the following format, {{?option=valueoption=value...}} 
Or you can omit the context: prefix. 
 
h3. Options {warning:title=Routebox options subject to change} The Routebox component will be revisited in upcoming releases to see if it can be further simplified, be more intuitive and user friendly. Watch this space!!!  {warning}  {div:class=confluenceTableSmall} || Name || Default Value || Description || | {{dispatchStrategy}} | {{null}} | A string representing a key in the Camel Registry matching an object value implementing the interface _org.apache.camel.component.routebox.strategy.RouteboxDispatchStrategy_ | | {{dispatchMap}} | {{null}} | A string representing a key in the Camel Registry matching an object value of the type HashMapString, String. The HashMap key should contain strings that can be matched against the value set for the exchange header *ROUTE_DISPATCH_KEY*. The HashMap value should contain inner route consumer URIs to which requests should be directed. | | {{innerContext}} | {{auto 

[CONF] Apache Camel Context

2011-02-10 Thread confluence







Context
Page  added by James Strachan

 

 Context Component

Available as of Camel 2.7

The context component allows you to create a CamelContext with a number of routes inside then treat it as a black box and refer to the local endpoints within the black box from other CamelContexts.

It is similar to the Routebox component, though the Context component tries to be really simple for end users; just a simple convention over configuration approach to refer to local endpoints inside a black box (CamelContext).

Maven users will need to add the following dependency to their pom.xml for this component:


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-context/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format



context:camelContextId:localEndpointName[?options]



Or you can omit the "context:" prefix.



camelContextId:localEndpointName[?options]



The localEndpoint name can be a valid Camel URI evaluated within the black box CamelContext. Or it can be a logical name which is mapped to any local endpoints. For example if you locally have endpoints like direct:invoices* and *seda:purchaseOrders* inside a CamelContext of id *supplyChain, then you can just use the URIs **supplyChain:invoices* or *supplyChain:purchaseOrders* to omit the physical endpoint kind and use pure logical URIs.

You can append query options to the URI in the following format, ?option=valueoption=value...

Example

First you need to create a CamelContext, add some routes in it, start it and then register the CamelContext into the Registry (JNDI, Spring, Guice or OSGi etc).

This can be done in the usual Camel way from this test case; this example shows Java and JNDI being used...



// lets create our black box as a camel context and a set of routes
DefaultCamelContext blackBox = new DefaultCamelContext(registry);
blackBox.setName("blackBox");
blackBox.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
// receive purchase orders, lets process it in some way then send an invoice
// to our invoice endpoint
from("direct:purchaseOrder").
  setHeader("received").constant("true").
  to("direct:invoice");
}
});
blackBox.start();

registry.bind("accounts", blackBox);



Notice in the above route we are using pure local endpoints (*direct* and *seda). Also note we expose this CamelContext using the **accounts* ID. We can do the same thing in Spring via



camelContext id="accounts"
  route 
from uri="direct:purchaseOrder"/
...
to uri="direct:invoice"/
  /route
/camelContext



Then in another CamelContext we can then refer to this "accounts black box" by just sending to *accounts:purchaseOrder* and consuming from *accounts:invoice*.

If you prefer to be more verbose and explicit you could use *context:accounts:purchaseOrder* or even *context:accounts:direct://purchaseOrder* if you prefer. But using logical endpoint URIs is preferred as it hides the implementation detail and provides a simple logical naming scheme.


   
Change Notification Preferences
   
   View Online
  |
   Add Comment
   








[CONF] Apache Camel Routebox

2011-02-10 Thread confluence







Routebox
Page edited by James Strachan


 Changes (45)
 




h2. Routebox Context Component 
 
*Available as of Camel 2.67* 
 
The *routebox* component enables the creation of specialized endpoints that offer encapsulation and a strategy based indirection service to a collection of camel routes hosted in an automatically created or user injected camel context. 
The *context* component allows you to create a CamelContext with a number of routes inside then treat it as a black box and refer to the local endpoints within the black box from other CamelContexts. 
 
Routebox endpoints are camel endpoints that may be invoked directly on camel routes. The routebox endpoint performs the following key functions * encapsulation - acts as a blackbox, hosting a collection of camel routes stored in an inner camel context. The inner context is fully under the control of the routebox component and is *JVM bound*.  * strategy based indirection - direct payloads sent to the routebox endpoint along a camel route to specific inner routes based on a user defined internal routing strategy or a dispatch map. * exchange propagation - forward exchanges modified by the routebox endpoint to the next segment of the camel route.  
It is similar to the [Routebox] component, though the Context component tries to be really simple for end users; just a simple convention over configuration approach to refer to local endpoints inside a black box (CamelContext). 
 
The routebox component supports both consumer and producer endpoints.   Producer endpoints are of two flavors * Producers that send or dispatch incoming requests to a external routebox consumer endpoint  * Producers that directly invoke routes in an internal embedded camel context thereby not sending requests to an external consumer.
Maven users will need to add the following dependency to their {{pom.xml}} for this component: {code:xml} dependency groupIdorg.apache.camel/groupId 
artifactIdcamel-routebox/artifactId artifactIdcamel-context/artifactId 
versionx.x.x/version !-- use the same version as your Camel core version -- /dependency {code} 
 h3. The need for a Camel Routebox endpoint 
 
The routebox component is designed to ease integration in complex environments needing   * a large collection of routes and   * involving a wide set of endpoint technologies needing integration in different ways In such environments, it is often necessary to craft an integration solution by creating a sense of layering among camel routes effectively organizing them into* Coarse grained or higher level routes - aggregated collection of inner or lower level routes exposed as Routebox endpoints that represent an integration focus area. For example   ||Focus Area||Coarse grained Route Examples|||Department Focus|HR routes, Sales routes etc|   |Supply chain  B2B Focus|Shipping routes, Fulfillment routes, 3rd party services etc|   |Technology Focus|Database routes, JMS routes, Scheduled batch routes etc|   * Fine grained routes - routes that execute a singular and specific business and/or integration pattern.  Requests sent to Routebox endpoints on coarse grained routes can then delegate requests to inner fine grained routes to achieve a specific integration objective, collect the final inner result, and continue to progress to the next step along the coarse-grained route.  
h3. URI format  {code} 
routebox:routeboxname[?options] context:camelContextId:localEndpointName[?options] 
{code}  
You can append query options to the URI in the following format, {{?option=valueoption=value...}} 
Or you can omit the context: prefix. 
 
h3. Options {warning:title=Routebox options subject to change} The Routebox component will be revisited in upcoming releases to see if it can be further simplified, be more intuitive and user friendly. Watch this space!!!  {warning}  {div:class=confluenceTableSmall} || Name || Default Value || Description || | {{dispatchStrategy}} | {{null}} | A string representing a key in the Camel Registry matching an object value implementing the interface _org.apache.camel.component.routebox.strategy.RouteboxDispatchStrategy_ | | {{dispatchMap}} | {{null}} | A string representing a key in the Camel Registry matching an object value of the type HashMapString, String. The HashMap key should contain strings that can be matched against the value set for the exchange header *ROUTE_DISPATCH_KEY*. The HashMap value should contain inner route consumer URIs to which requests should be directed. | | {{innerContext}} | {{auto 

[CONF] Apache Camel Context

2011-02-10 Thread confluence







Context
Page edited by James Strachan


 Changes (2)
 




...
{code}  
* *camelContextId* is the ID you used to register the CamelContext into the [Registry]. 
The localEndpoint name * *localEndpointName* can be a valid Camel URI evaluated within the black box CamelContext. Or it can be a logical name which is mapped to any local endpoints. For example if you locally have endpoints like *direct:invoices** and **seda:purchaseOrders** inside a CamelContext of id **supplyChain**, then you can just use the URIs **supplyChain:invoices** or **supplyChain:purchaseOrders** to omit the physical endpoint kind and use pure logical URIs. 
 You can append query options to the URI in the following format, {{?option=valueoption=value...}} 
...


Full Content

Context Component

Available as of Camel 2.7

The context component allows you to create a CamelContext with a number of routes inside then treat it as a black box and refer to the local endpoints within the black box from other CamelContexts.

It is similar to the Routebox component, though the Context component tries to be really simple for end users; just a simple convention over configuration approach to refer to local endpoints inside a black box (CamelContext).

Maven users will need to add the following dependency to their pom.xml for this component:


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-context/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format



context:camelContextId:localEndpointName[?options]



Or you can omit the "context:" prefix.



camelContextId:localEndpointName[?options]




	camelContextId is the ID you used to register the CamelContext into the Registry.
	localEndpointName can be a valid Camel URI evaluated within the black box CamelContext. Or it can be a logical name which is mapped to any local endpoints. For example if you locally have endpoints like direct:invoices* and *seda:purchaseOrders* inside a CamelContext of id *supplyChain, then you can just use the URIs **supplyChain:invoices* or *supplyChain:purchaseOrders* to omit the physical endpoint kind and use pure logical URIs.



You can append query options to the URI in the following format, ?option=valueoption=value...

Example

First you need to create a CamelContext, add some routes in it, start it and then register the CamelContext into the Registry (JNDI, Spring, Guice or OSGi etc).

This can be done in the usual Camel way from this test case; this example shows Java and JNDI being used...



// lets create our black box as a camel context and a set of routes
DefaultCamelContext blackBox = new DefaultCamelContext(registry);
blackBox.setName("blackBox");
blackBox.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
// receive purchase orders, lets process it in some way then send an invoice
// to our invoice endpoint
from("direct:purchaseOrder").
  setHeader("received").constant("true").
  to("direct:invoice");
}
});
blackBox.start();

registry.bind("accounts", blackBox);



Notice in the above route we are using pure local endpoints (*direct* and *seda). Also note we expose this CamelContext using the **accounts* ID. We can do the same thing in Spring via



camelContext id="accounts"
  route 
from uri="direct:purchaseOrder"/
...
to uri="direct:invoice"/
  /route
/camelContext



Then in another CamelContext we can then refer to this "accounts black box" by just sending to *accounts:purchaseOrder* and consuming from *accounts:invoice*.

If you prefer to be more verbose and explicit you could use *context:accounts:purchaseOrder* or even *context:accounts:direct://purchaseOrder* if you prefer. But using logical endpoint URIs is preferred as it hides the implementation detail and provides a simple logical naming scheme.



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Camel Context

2011-02-10 Thread confluence







Context
Page edited by James Strachan


 Changes (1)
 




...
 * *camelContextId* is the ID you used to register the CamelContext into the [Registry]. 
* *localEndpointName* can be a valid Camel URI evaluated within the black box CamelContext. Or it can be a logical name which is mapped to any local endpoints. For example if you locally have endpoints like *direct:invoices** and **seda:purchaseOrders** *seda:purchaseOrders* inside a CamelContext of id **supplyChain**, *supplyChain*, then you can just use the URIs **supplyChain:invoices** *supplyChain:invoices* or **supplyChain:purchaseOrders** *supplyChain:purchaseOrders* to omit the physical endpoint kind and use pure logical URIs. 
 You can append query options to the URI in the following format, {{?option=valueoption=value...}} 
...


Full Content

Context Component

Available as of Camel 2.7

The context component allows you to create a CamelContext with a number of routes inside then treat it as a black box and refer to the local endpoints within the black box from other CamelContexts.

It is similar to the Routebox component, though the Context component tries to be really simple for end users; just a simple convention over configuration approach to refer to local endpoints inside a black box (CamelContext).

Maven users will need to add the following dependency to their pom.xml for this component:


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-context/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format



context:camelContextId:localEndpointName[?options]



Or you can omit the "context:" prefix.



camelContextId:localEndpointName[?options]




	camelContextId is the ID you used to register the CamelContext into the Registry.
	localEndpointName can be a valid Camel URI evaluated within the black box CamelContext. Or it can be a logical name which is mapped to any local endpoints. For example if you locally have endpoints like direct:invoices and seda:purchaseOrders inside a CamelContext of id supplyChain, then you can just use the URIs supplyChain:invoices or supplyChain:purchaseOrders to omit the physical endpoint kind and use pure logical URIs.



You can append query options to the URI in the following format, ?option=valueoption=value...

Example

First you need to create a CamelContext, add some routes in it, start it and then register the CamelContext into the Registry (JNDI, Spring, Guice or OSGi etc).

This can be done in the usual Camel way from this test case; this example shows Java and JNDI being used...



// lets create our black box as a camel context and a set of routes
DefaultCamelContext blackBox = new DefaultCamelContext(registry);
blackBox.setName("blackBox");
blackBox.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
// receive purchase orders, lets process it in some way then send an invoice
// to our invoice endpoint
from("direct:purchaseOrder").
  setHeader("received").constant("true").
  to("direct:invoice");
}
});
blackBox.start();

registry.bind("accounts", blackBox);



Notice in the above route we are using pure local endpoints (*direct* and *seda). Also note we expose this CamelContext using the **accounts* ID. We can do the same thing in Spring via



camelContext id="accounts"
  route 
from uri="direct:purchaseOrder"/
...
to uri="direct:invoice"/
  /route
/camelContext



Then in another CamelContext we can then refer to this "accounts black box" by just sending to *accounts:purchaseOrder* and consuming from *accounts:invoice*.

If you prefer to be more verbose and explicit you could use *context:accounts:purchaseOrder* or even *context:accounts:direct://purchaseOrder* if you prefer. But using logical endpoint URIs is preferred as it hides the implementation detail and provides a simple logical naming scheme.



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Camel Context

2011-02-10 Thread confluence







Context
Page edited by James Strachan


 Changes (4)
 




...
First you need to create a CamelContext, add some routes in it, start it and then register the CamelContext into the [Registry] (JNDI, Spring, Guice or OSGi etc).  
This can be done in the usual Camel way from this [test case|http://svn.apache.org/viewvc/camel/trunk/components/camel-context/src/test/java/org/apache/camel/component/context/JavaDslBlackBoxTest.java?revision=1069442view=markup] (see the createRegistry() method); this example shows Java and JNDI being used... 
 {code} 
...
{code}  
Notice in the above route we are using pure local endpoints (**direct** (*direct* and **seda**). *seda*). Also note we expose this CamelContext using the **accounts** *accounts* ID. We can do the same thing in Spring via 
 {code} 
...
{code}  
Then in another CamelContext we can then refer to this accounts black box by just sending to **accounts:purchaseOrder** *accounts:purchaseOrder* and consuming from **accounts:invoice**. *accounts:invoice*. 
 
If you prefer to be more verbose and explicit you could use **context:accounts:purchaseOrder** *context:accounts:purchaseOrder* or even **context:accounts:direct://purchaseOrder** *context:accounts:direct://purchaseOrder* if you prefer. But using logical endpoint URIs is preferred as it hides the implementation detail and provides a simple logical naming scheme. 


Full Content

Context Component

Available as of Camel 2.7

The context component allows you to create a CamelContext with a number of routes inside then treat it as a black box and refer to the local endpoints within the black box from other CamelContexts.

It is similar to the Routebox component, though the Context component tries to be really simple for end users; just a simple convention over configuration approach to refer to local endpoints inside a black box (CamelContext).

Maven users will need to add the following dependency to their pom.xml for this component:


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-context/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format



context:camelContextId:localEndpointName[?options]



Or you can omit the "context:" prefix.



camelContextId:localEndpointName[?options]




	camelContextId is the ID you used to register the CamelContext into the Registry.
	localEndpointName can be a valid Camel URI evaluated within the black box CamelContext. Or it can be a logical name which is mapped to any local endpoints. For example if you locally have endpoints like direct:invoices and seda:purchaseOrders inside a CamelContext of id supplyChain, then you can just use the URIs supplyChain:invoices or supplyChain:purchaseOrders to omit the physical endpoint kind and use pure logical URIs.



You can append query options to the URI in the following format, ?option=valueoption=value...

Example

First you need to create a CamelContext, add some routes in it, start it and then register the CamelContext into the Registry (JNDI, Spring, Guice or OSGi etc).

This can be done in the usual Camel way from this test case (see the createRegistry() method); this example shows Java and JNDI being used...



// lets create our black box as a camel context and a set of routes
DefaultCamelContext blackBox = new DefaultCamelContext(registry);
blackBox.setName("blackBox");
blackBox.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
// receive purchase orders, lets process it in some way then send an invoice
// to our invoice endpoint
from("direct:purchaseOrder").
  setHeader("received").constant("true").
  to("direct:invoice");
}
});
blackBox.start();

registry.bind("accounts", blackBox);



Notice in the above route we are using pure local endpoints (direct and seda). Also note we expose this CamelContext using the accounts ID. We can do the same thing in Spring via



camelContext id="accounts"
  route 
from uri="direct:purchaseOrder"/
...
to uri="direct:invoice"/
  /route
/camelContext



Then in another CamelContext we can then refer to this "accounts black box" by just sending to accounts:purchaseOrder and consuming from accounts:invoice.

If you prefer to be more verbose and explicit you could use context:accounts:purchaseOrder or even context:accounts:direct://purchaseOrder if you prefer. But using logical endpoint URIs is preferred as it hides the implementation detail and provides a simple logical naming scheme.



Change Notification Preferences

  

[CONF] Apache Camel Context

2011-02-10 Thread confluence







Context
Page edited by James Strachan


 Changes (2)
 




...
Notice in the above route we are using pure local endpoints (*direct* and *seda*). Also note we expose this CamelContext using the *accounts* ID. We can do the same thing in Spring via  
{code} camelContext id=accounts 
{code|xml} camelContext id=accounts xmlns=http://camel.apache.org/schema/spring 
  route  from uri=direct:purchaseOrder/ 
...


Full Content

Context Component

Available as of Camel 2.7

The context component allows you to create a CamelContext with a number of routes inside then treat it as a black box and refer to the local endpoints within the black box from other CamelContexts.

It is similar to the Routebox component, though the Context component tries to be really simple for end users; just a simple convention over configuration approach to refer to local endpoints inside a black box (CamelContext).

Maven users will need to add the following dependency to their pom.xml for this component:


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-context/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format



context:camelContextId:localEndpointName[?options]



Or you can omit the "context:" prefix.



camelContextId:localEndpointName[?options]




	camelContextId is the ID you used to register the CamelContext into the Registry.
	localEndpointName can be a valid Camel URI evaluated within the black box CamelContext. Or it can be a logical name which is mapped to any local endpoints. For example if you locally have endpoints like direct:invoices and seda:purchaseOrders inside a CamelContext of id supplyChain, then you can just use the URIs supplyChain:invoices or supplyChain:purchaseOrders to omit the physical endpoint kind and use pure logical URIs.



You can append query options to the URI in the following format, ?option=valueoption=value...

Example

First you need to create a CamelContext, add some routes in it, start it and then register the CamelContext into the Registry (JNDI, Spring, Guice or OSGi etc).

This can be done in the usual Camel way from this test case (see the createRegistry() method); this example shows Java and JNDI being used...



// lets create our black box as a camel context and a set of routes
DefaultCamelContext blackBox = new DefaultCamelContext(registry);
blackBox.setName("blackBox");
blackBox.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
// receive purchase orders, lets process it in some way then send an invoice
// to our invoice endpoint
from("direct:purchaseOrder").
  setHeader("received").constant("true").
  to("direct:invoice");
}
});
blackBox.start();

registry.bind("accounts", blackBox);



Notice in the above route we are using pure local endpoints (direct and seda). Also note we expose this CamelContext using the accounts ID. We can do the same thing in Spring via

Unknown macro: {code|xml} 
camelContext id="accounts" xmlns="http://camel.apache.org/schema/spring"
  route 
from uri="direct:purchaseOrder"/
...
to uri="direct:invoice"/
  /route
/camelContext




Then in another CamelContext we can then refer to this "accounts black box" by just sending to accounts:purchaseOrder and consuming from accounts:invoice.

If you prefer to be more verbose and explicit you could use context:accounts:purchaseOrder or even context:accounts:direct://purchaseOrder if you prefer. But using logical endpoint URIs is preferred as it hides the implementation detail and provides a simple logical naming scheme.



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Camel Context

2011-02-10 Thread confluence







Context
Page edited by James Strachan


 Changes (2)
 




...
Notice in the above route we are using pure local endpoints (*direct* and *seda*). Also note we expose this CamelContext using the *accounts* ID. We can do the same thing in Spring via  
{code|xml} 
{code:xml} 
camelContext id=accounts xmlns=http://camel.apache.org/schema/spring   route  
...


Full Content

Context Component

Available as of Camel 2.7

The context component allows you to create a CamelContext with a number of routes inside then treat it as a black box and refer to the local endpoints within the black box from other CamelContexts.

It is similar to the Routebox component, though the Context component tries to be really simple for end users; just a simple convention over configuration approach to refer to local endpoints inside a black box (CamelContext).

Maven users will need to add the following dependency to their pom.xml for this component:


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-context/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format



context:camelContextId:localEndpointName[?options]



Or you can omit the "context:" prefix.



camelContextId:localEndpointName[?options]




	camelContextId is the ID you used to register the CamelContext into the Registry.
	localEndpointName can be a valid Camel URI evaluated within the black box CamelContext. Or it can be a logical name which is mapped to any local endpoints. For example if you locally have endpoints like direct:invoices and seda:purchaseOrders inside a CamelContext of id supplyChain, then you can just use the URIs supplyChain:invoices or supplyChain:purchaseOrders to omit the physical endpoint kind and use pure logical URIs.



You can append query options to the URI in the following format, ?option=valueoption=value...

Example

First you need to create a CamelContext, add some routes in it, start it and then register the CamelContext into the Registry (JNDI, Spring, Guice or OSGi etc).

This can be done in the usual Camel way from this test case (see the createRegistry() method); this example shows Java and JNDI being used...



// lets create our black box as a camel context and a set of routes
DefaultCamelContext blackBox = new DefaultCamelContext(registry);
blackBox.setName("blackBox");
blackBox.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
// receive purchase orders, lets process it in some way then send an invoice
// to our invoice endpoint
from("direct:purchaseOrder").
  setHeader("received").constant("true").
  to("direct:invoice");
}
});
blackBox.start();

registry.bind("accounts", blackBox);



Notice in the above route we are using pure local endpoints (direct and seda). Also note we expose this CamelContext using the accounts ID. We can do the same thing in Spring via



camelContext id="accounts" xmlns="http://camel.apache.org/schema/spring"
  route 
from uri="direct:purchaseOrder"/
...
to uri="direct:invoice"/
  /route
/camelContext



Then in another CamelContext we can then refer to this "accounts black box" by just sending to accounts:purchaseOrder and consuming from accounts:invoice.

If you prefer to be more verbose and explicit you could use context:accounts:purchaseOrder or even context:accounts:direct://purchaseOrder if you prefer. But using logical endpoint URIs is preferred as it hides the implementation detail and provides a simple logical naming scheme.



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Camel Context

2011-02-10 Thread confluence







Context
Page edited by James Strachan


 Changes (1)
 




...
 If you prefer to be more verbose and explicit you could use *context:accounts:purchaseOrder* or even *context:accounts:direct://purchaseOrder* if you prefer. But using logical endpoint URIs is preferred as it hides the implementation detail and provides a simple logical naming scheme. 
 For example if we wish to then expose this accounts black box on some middleware (outside of the black box) we can do things like...   {code:xml} camelContext id=bindAccountsToActiveMQ xmlns=http://camel.apache.org/schema/spring   route  !-- Send messages on ActiveMQ into the purchase order black box -- from uri=activemq:Accounts.PurchaseOrders/ to uri=accounts:purchaseOrders/   /route   route  !-- lets send accounts to an ActiveMQ Queue -- from uri=accounts:invoice/ to uri=activemq:UK.Accounts.Invoices/   /route /camelContext {code} 


Full Content

Context Component

Available as of Camel 2.7

The context component allows you to create a CamelContext with a number of routes inside then treat it as a black box and refer to the local endpoints within the black box from other CamelContexts.

It is similar to the Routebox component, though the Context component tries to be really simple for end users; just a simple convention over configuration approach to refer to local endpoints inside a black box (CamelContext).

Maven users will need to add the following dependency to their pom.xml for this component:


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-context/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format



context:camelContextId:localEndpointName[?options]



Or you can omit the "context:" prefix.



camelContextId:localEndpointName[?options]




	camelContextId is the ID you used to register the CamelContext into the Registry.
	localEndpointName can be a valid Camel URI evaluated within the black box CamelContext. Or it can be a logical name which is mapped to any local endpoints. For example if you locally have endpoints like direct:invoices and seda:purchaseOrders inside a CamelContext of id supplyChain, then you can just use the URIs supplyChain:invoices or supplyChain:purchaseOrders to omit the physical endpoint kind and use pure logical URIs.



You can append query options to the URI in the following format, ?option=valueoption=value...

Example

First you need to create a CamelContext, add some routes in it, start it and then register the CamelContext into the Registry (JNDI, Spring, Guice or OSGi etc).

This can be done in the usual Camel way from this test case (see the createRegistry() method); this example shows Java and JNDI being used...



// lets create our black box as a camel context and a set of routes
DefaultCamelContext blackBox = new DefaultCamelContext(registry);
blackBox.setName("blackBox");
blackBox.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
// receive purchase orders, lets process it in some way then send an invoice
// to our invoice endpoint
from("direct:purchaseOrder").
  setHeader("received").constant("true").
  to("direct:invoice");
}
});
blackBox.start();

registry.bind("accounts", blackBox);



Notice in the above route we are using pure local endpoints (direct and seda). Also note we expose this CamelContext using the accounts ID. We can do the same thing in Spring via



camelContext id="accounts" xmlns="http://camel.apache.org/schema/spring"
  route 
from uri="direct:purchaseOrder"/
...
to uri="direct:invoice"/
  /route
/camelContext



Then in another CamelContext we can then refer to this "accounts black box" by just sending to accounts:purchaseOrder and consuming from accounts:invoice.

If you prefer to be more verbose and explicit you could use context:accounts:purchaseOrder or even context:accounts:direct://purchaseOrder if you prefer. But using logical endpoint URIs is preferred as it hides the implementation detail and provides a simple logical naming scheme.

For example if we wish to then expose this accounts black box on some middleware (outside of the black box) we can do things like...




camelContext id="bindAccountsToActiveMQ" xmlns="http://camel.apache.org/schema/spring"
  route 
!-- Send messages on ActiveMQ into the purchase order black box --
from uri="activemq:Accounts.PurchaseOrders"/
to uri="accounts:purchaseOrders"/
  /route
  route 
!-- lets send accounts to an ActiveMQ Queue --
from uri="accounts:invoice"/
to uri="activemq:UK.Accounts.Invoices"/
  /route
/camelContext





Change Notification 

[CONF] Apache Camel Context

2011-02-10 Thread confluence







Context
Page edited by James Strachan


 Changes (7)
 




...
h3. Example  
In this example well create a black box context, then well use it from another CamelContext.  h4. Defining the black box context  
First you need to create a CamelContext, add some routes in it, start it and then register the CamelContext into the [Registry] (JNDI, Spring, Guice or OSGi etc).  
...
{code}  
h4. Using the black box context  
Then in another CamelContext we can then refer to this accounts black box by just sending to *accounts:purchaseOrder* and consuming from *accounts:invoice*.  
...
For example if we wish to then expose this accounts black box on some middleware (outside of the black box) we can do things like...  
{code:xml} 
camelContext id=bindAccountsToActiveMQ xmlns=http://camel.apache.org/schema/spring 
  route  
!-- Send messages on ActiveMQ into the purchase order black box -- 
!-- consume from an ActiveMQ into the black box -- 
from uri=activemq:Accounts.PurchaseOrders/ to uri=accounts:purchaseOrders/   /route   route  
!-- lets send accounts to an ActiveMQ Queue -- 
!-- lets send invoices from the black box to a different ActiveMQ Queue -- 
from uri=accounts:invoice/ to uri=activemq:UK.Accounts.Invoices/ 
...


Full Content

Context Component

Available as of Camel 2.7

The context component allows you to create a CamelContext with a number of routes inside then treat it as a black box and refer to the local endpoints within the black box from other CamelContexts.

It is similar to the Routebox component, though the Context component tries to be really simple for end users; just a simple convention over configuration approach to refer to local endpoints inside a black box (CamelContext).

Maven users will need to add the following dependency to their pom.xml for this component:


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-context/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format



context:camelContextId:localEndpointName[?options]



Or you can omit the "context:" prefix.



camelContextId:localEndpointName[?options]




	camelContextId is the ID you used to register the CamelContext into the Registry.
	localEndpointName can be a valid Camel URI evaluated within the black box CamelContext. Or it can be a logical name which is mapped to any local endpoints. For example if you locally have endpoints like direct:invoices and seda:purchaseOrders inside a CamelContext of id supplyChain, then you can just use the URIs supplyChain:invoices or supplyChain:purchaseOrders to omit the physical endpoint kind and use pure logical URIs.



You can append query options to the URI in the following format, ?option=valueoption=value...

Example

In this example we'll create a black box context, then we'll use it from another CamelContext.

Defining the black box context

First you need to create a CamelContext, add some routes in it, start it and then register the CamelContext into the Registry (JNDI, Spring, Guice or OSGi etc).

This can be done in the usual Camel way from this test case (see the createRegistry() method); this example shows Java and JNDI being used...



// lets create our black box as a camel context and a set of routes
DefaultCamelContext blackBox = new DefaultCamelContext(registry);
blackBox.setName("blackBox");
blackBox.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
// receive purchase orders, lets process it in some way then send an invoice
// to our invoice endpoint
from("direct:purchaseOrder").
  setHeader("received").constant("true").
  to("direct:invoice");
}
});
blackBox.start();

registry.bind("accounts", blackBox);



Notice in the above route we are using pure local endpoints (direct and seda). Also note we expose this CamelContext using the accounts ID. We can do the same thing in Spring via



camelContext id="accounts" xmlns="http://camel.apache.org/schema/spring"
  route 
from uri="direct:purchaseOrder"/
...
to uri="direct:invoice"/
  /route
/camelContext



Using the black box context

Then in another CamelContext we can then refer to this "accounts black box" by just sending to accounts:purchaseOrder and consuming from accounts:invoice.

If you prefer to be more verbose and explicit you could use context:accounts:purchaseOrder or even context:accounts:direct://purchaseOrder if you prefer. But using logical endpoint URIs is 

[CONF] Apache Camel Context

2011-02-10 Thread confluence







Context
Page edited by James Strachan


 Changes (8)
 




...
*Available as of Camel 2.7*  
The *context* component allows you to create a CamelContext with a number of routes inside then treat it as a black box and refer to the local endpoints within the black box from other CamelContexts. 
The *context* component allows you to create new Camel Components from a CamelContext with a number of routes which is then treated as a black box, allowing you to refer to the local endpoints within the component from other CamelContexts. 
 
It is similar to the [Routebox] component in idea, though the Context component tries to be really simple for end users; just a simple convention over configuration approach to refer to local endpoints inside a black box (CamelContext). the CamelContext Component. 
 Maven users will need to add the following dependency to their {{pom.xml}} for this component: 
...
In this example well create a black box context, then well use it from another CamelContext.  
h4. Defining the black box context 
h4. Defining the context component 
 First you need to create a CamelContext, add some routes in it, start it and then register the CamelContext into the [Registry] (JNDI, Spring, Guice or OSGi etc). 
...
{code}  
h4. Using the black box context 
h4. Using the context component 
 Then in another CamelContext we can then refer to this accounts black box by just sending to *accounts:purchaseOrder* and consuming from *accounts:invoice*. 
...
/camelContext {code} 
  h4. Naming endpoints  A context component instance can have many public input and output endpoints that can be accessed from outside its CamelContext. When there are many it is recommended that you use logical names for them to hide the middleware as shown above.  However when there is only one input, output or error/dead letter endpoint in a component we recommend using the common posix shell names *in*, *out* and *err* 


Full Content

Context Component

Available as of Camel 2.7

The context component allows you to create new Camel Components from a CamelContext with a number of routes which is then treated as a black box, allowing you to refer to the local endpoints within the component from other CamelContexts.

It is similar to the Routebox component in idea, though the Context component tries to be really simple for end users; just a simple convention over configuration approach to refer to local endpoints inside the CamelContext Component.

Maven users will need to add the following dependency to their pom.xml for this component:


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-context/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format



context:camelContextId:localEndpointName[?options]



Or you can omit the "context:" prefix.



camelContextId:localEndpointName[?options]




	camelContextId is the ID you used to register the CamelContext into the Registry.
	localEndpointName can be a valid Camel URI evaluated within the black box CamelContext. Or it can be a logical name which is mapped to any local endpoints. For example if you locally have endpoints like direct:invoices and seda:purchaseOrders inside a CamelContext of id supplyChain, then you can just use the URIs supplyChain:invoices or supplyChain:purchaseOrders to omit the physical endpoint kind and use pure logical URIs.



You can append query options to the URI in the following format, ?option=valueoption=value...

Example

In this example we'll create a black box context, then we'll use it from another CamelContext.

Defining the context component

First you need to create a CamelContext, add some routes in it, start it and then register the CamelContext into the Registry (JNDI, Spring, Guice or OSGi etc).

This can be done in the usual Camel way from this test case (see the createRegistry() method); this example shows Java and JNDI being used...



// lets create our black box as a camel context and a set of routes
DefaultCamelContext blackBox = new DefaultCamelContext(registry);
blackBox.setName("blackBox");
blackBox.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
// receive purchase orders, lets process it in some way then send an invoice
// to our invoice endpoint
from("direct:purchaseOrder").
  setHeader("received").constant("true").
  to("direct:invoice");
}
});
blackBox.start();

registry.bind("accounts", blackBox);



Notice in the above route we 

svn commit: r1069564 - /camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java

2011-02-10 Thread cmueller
Author: cmueller
Date: Thu Feb 10 20:51:39 2011
New Revision: 1069564

URL: http://svn.apache.org/viewvc?rev=1069564view=rev
Log:
CAMEL-3650: SMSC initiated unbind spawns exponential amounts of reconnect 
threads

Modified:

camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java

Modified: 
camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java?rev=1069564r1=1069563r2=1069564view=diff
==
--- 
camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java
 (original)
+++ 
camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java
 Thu Feb 10 20:51:39 2011
@@ -17,6 +17,7 @@
 package org.apache.camel.component.smpp;
 
 import java.io.IOException;
+import java.util.concurrent.locks.ReentrantLock;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
@@ -59,6 +60,7 @@ public class SmppConsumer extends Defaul
 private SMPPSession session;
 private MessageReceiverListener messageReceiverListener;
 private SessionStateListener sessionStateListener;
+private final ReentrantLock reconnectLock = new ReentrantLock();
 
 /**
  * The constructor which gets a smpp endpoint, a smpp configuration and a
@@ -198,32 +200,44 @@ public class SmppConsumer extends Defaul
 }
 
 private void reconnect(final long initialReconnectDelay) {
-new Thread() {
-@Override
-public void run() {
-LOG.info(Schedule reconnect after  + initialReconnectDelay + 
 millis);
-try {
-Thread.sleep(initialReconnectDelay);
-} catch (InterruptedException e) {
-}
-
-int attempt = 0;
-while (!(isStopping() || isStopped())  (session == null || 
session.getSessionState().equals(SessionState.CLOSED))) {
+if (reconnectLock.tryLock()) {
+new Thread() {
+@Override
+public void run() {
 try {
-LOG.info(Trying to reconnect to  + 
getEndpoint().getConnectionString() +  - attempt # + (++attempt) + ...);
-session = createSession();
-} catch (IOException e) {
-LOG.info(Failed to reconnect to  + 
getEndpoint().getConnectionString());
-closeSession(session);
+boolean reconnected = false;
+
+LOG.info(Schedule reconnect after  + 
initialReconnectDelay +  millis);
 try {
-Thread.sleep(configuration.getReconnectDelay());
-} catch (InterruptedException ee) {
+Thread.sleep(initialReconnectDelay);
+} catch (InterruptedException e) {
+}
+
+int attempt = 0;
+while (!(isStopping() || isStopped())  (session == 
null || session.getSessionState().equals(SessionState.CLOSED))) {
+try {
+LOG.info(Trying to reconnect to  + 
getEndpoint().getConnectionString() +  - attempt # + (++attempt) + ...);
+session = createSession();
+reconnected = true;
+} catch (IOException e) {
+LOG.info(Failed to reconnect to  + 
getEndpoint().getConnectionString());
+closeSession(session);
+try {
+
Thread.sleep(configuration.getReconnectDelay());
+} catch (InterruptedException ee) {
+}
+}
+}
+
+if (reconnected) {
+LOG.info(Reconnected to  + 
getEndpoint().getConnectionString());
 }
+} finally {
+reconnectLock.unlock();
 }
 }
-LOG.info(Reconnected to  + 
getEndpoint().getConnectionString());
-}
-}.start();
+}.start();
+}
 }
 
 @Override




svn commit: r1069596 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/model/dataformat/ components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/ components/camel-blueprint/s

2011-02-10 Thread cmueller
Author: cmueller
Date: Thu Feb 10 22:38:15 2011
New Revision: 1069596

URL: http://svn.apache.org/viewvc?rev=1069596view=rev
Log:
CAMEL-3652: Fix the Sonar Critical issue: Performance - Inefficient use of 
keySet iterator instead of entrySet iterator

Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XStreamDataFormat.java

camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java

camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyFixedLengthFactory.java

camel/trunk/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/ContextScanRouteBuilderFinder.java

camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java

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

camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminProducer.java

camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackDataFormat.java

camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java

camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessageHelper.java

camel/trunk/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java

camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailComponent.java

camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ContextScanRouteBuilderFinder.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XStreamDataFormat.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XStreamDataFormat.java?rev=1069596r1=1069595r2=1069596view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XStreamDataFormat.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XStreamDataFormat.java
 Thu Feb 10 22:38:15 2011
@@ -21,6 +21,7 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -230,8 +231,8 @@ public class XStreamDataFormat extends D
 @Override
 public ImplicitCollectionList marshal(MapString, String[] v) throws 
Exception {
 ListImplicitCollectionEntry list = new 
ArrayListImplicitCollectionEntry();
-for (String clsName : v.keySet()) {
-ImplicitCollectionEntry entry = new 
ImplicitCollectionEntry(clsName, v.get(clsName));
+for (EntryString, String[] e : v.entrySet()) {
+ImplicitCollectionEntry entry = new 
ImplicitCollectionEntry(e.getKey(), e.getValue());
 list.add(entry);
 }
 
@@ -392,8 +393,8 @@ public class XStreamDataFormat extends D
 @Override
 public OmitFieldList marshal(MapString, String[] v) throws Exception 
{
 ListOmitFieldEntry list = new ArrayListOmitFieldEntry();
-for (String clsName : v.keySet()) {
-OmitFieldEntry entry = new OmitFieldEntry(clsName, 
v.get(clsName));
+for (EntryString, String[] e : v.entrySet()) {
+OmitFieldEntry entry = new OmitFieldEntry(e.getKey(), 
e.getValue());
 list.add(entry);
 }
 

Modified: 
camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java?rev=1069596r1=1069595r2=1069596view=diff
==
--- 
camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
 (original)
+++ 
camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
 Thu Feb 10 22:38:15 2011
@@ -24,6 +24,7 @@ import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.TreeMap;
 
 import org.apache.camel.dataformat.bindy.annotation.CsvRecord;
@@ -269,10 +270,10 @@ public class BindyCsvFactory extends Bin
 TreeMapInteger, List sortValues = new TreeMapInteger, 
List(results);
 ListString temp = new ArrayListString();
 
-for (Integer key : sortValues.keySet()) {
+for (EntryInteger, List entry : sortValues.entrySet()) {
 
 // Get list of values
-

svn commit: r1069674 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java

2011-02-10 Thread davsclaus
Author: davsclaus
Date: Fri Feb 11 05:25:25 2011
New Revision: 1069674

URL: http://svn.apache.org/viewvc?rev=1069674view=rev
Log:
CAMEL-3639: Fixed sonortype reported issue. Thanks to Tracy Snell for the patch.

Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=1069674r1=1069673r2=1069674view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
 Fri Feb 11 05:25:25 2011
@@ -1748,13 +1748,10 @@ public class DefaultCamelContext extends
 for (RouteService routeService : routeServices) {
 DefaultRouteStartupOrder order = 
doPrepareRouteToBeStarted(routeService);
 // check for clash before we add it as input
-if (order != null) {
-if (checkClash  doCheckStartupOrderClash(order, inputs)) {
-inputs.put(order.getStartupOrder(), order);
-} else {
-inputs.put(order.getStartupOrder(), order);
-}
+if (checkClash) {
+doCheckStartupOrderClash(order, inputs);
 }
+inputs.put(order.getStartupOrder(), order);
 }
 
 // warm up routes before we start them




svn commit: r1069675 - in /camel/trunk: components/camel-sip/src/main/java/org/apache/camel/component/sip/listener/ components/camel-smpp/src/main/java/org/apache/camel/component/smpp/ examples/camel-

2011-02-10 Thread davsclaus
Author: davsclaus
Date: Fri Feb 11 05:28:55 2011
New Revision: 1069675

URL: http://svn.apache.org/viewvc?rev=1069675view=rev
Log:
CAMEL-3653: Fixed sonartype issues. Thanks to Tracy for patch.

Modified:

camel/trunk/components/camel-sip/src/main/java/org/apache/camel/component/sip/listener/SipMessageCodes.java

camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConfiguration.java

camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/jaxrs/resources/BookStoreImpl.java

camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/CreditAgency.java

Modified: 
camel/trunk/components/camel-sip/src/main/java/org/apache/camel/component/sip/listener/SipMessageCodes.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-sip/src/main/java/org/apache/camel/component/sip/listener/SipMessageCodes.java?rev=1069675r1=1069674r2=1069675view=diff
==
--- 
camel/trunk/components/camel-sip/src/main/java/org/apache/camel/component/sip/listener/SipMessageCodes.java
 (original)
+++ 
camel/trunk/components/camel-sip/src/main/java/org/apache/camel/component/sip/listener/SipMessageCodes.java
 Fri Feb 11 05:28:55 2011
@@ -24,59 +24,59 @@ public interface SipMessageCodes {
 new HashMapInteger, String() 
 {
 {
-put(new Integer(100), Trying);
-put(new Integer(180), Ringing);
-put(new Integer(181), Call Being Forwarded);
-put(new Integer(182), Call Queued);
-put(new Integer(183), Session Progress);
-put(new Integer(200), OK);
-put(new Integer(202), Accepted);
-put(new Integer(300), Multiple Choices);
-put(new Integer(301), Moved Permanently);
-put(new Integer(302), Moved Temporarily);
-put(new Integer(305), Use Proxy);
-put(new Integer(380), Alternative Service);
-put(new Integer(400), Bad Request);
-put(new Integer(401), Unauthorized);
-put(new Integer(402), Payment Required);
-put(new Integer(403), Forbidden);
-put(new Integer(404), Not Found);
-put(new Integer(405), Method Not Allowed);
-put(new Integer(406), Not Acceptable);
-put(new Integer(407), Proxy Authentication Required);
-put(new Integer(408), Request Timeout);
-put(new Integer(409), Conflict);
-put(new Integer(410), Gone);
-put(new Integer(411), Length Required);
-put(new Integer(413), Request Entity Too Large);
-put(new Integer(414), Request URI Too Long);
-put(new Integer(415), Unsupported Media Type);
-put(new Integer(416), Unsupported URI Scheme);
-put(new Integer(420), Bad Extension);
-put(new Integer(421), Extension Required);
-put(new Integer(423), Interval Too Brief);
-put(new Integer(480), Temporarily Unavailable);
-put(new Integer(481), Call/Transaction Does Not Exist);
-put(new Integer(482), Loop Detected);
-put(new Integer(483), Too Many Hops);
-put(new Integer(484), Address Incomplete);
-put(new Integer(485), Ambiguous);
-put(new Integer(486), Busy Here);
-put(new Integer(487), Request Terminated);
-put(new Integer(488), Not Acceptable Here);
-put(new Integer(491), Request Pending);
-put(new Integer(493), Undecipherable);
-put(new Integer(500), Server Internal Error);
-put(new Integer(501), Not Implemented);
-put(new Integer(502), Bad Gateway);
-put(new Integer(503), Service Unavailable);
-put(new Integer(504), Server Time-Out);
-put(new Integer(505), Version Not Supported);
-put(new Integer(513), Message Too Large);
-put(new Integer(600), Busy Everywhere);
-put(new Integer(603), Declined);
-put(new Integer(604), Does Not Exist Anywhere);
-put(new Integer(605), Not Acceptable);
+put(100, Trying);
+put(180, Ringing);
+put(181, Call Being Forwarded);
+put(182, Call Queued);
+put(183, Session Progress);
+put(200, OK);
+put(202, Accepted);
+put(300, Multiple Choices);
+put(301, Moved Permanently);
+put(302, Moved Temporarily);
+put(305, Use Proxy);
+put(380, Alternative Service);
+put(400, Bad 

svn commit: r1069678 - in /camel/trunk/components/camel-context: ./ src/main/java/org/apache/camel/component/context/ src/test/java/org/apache/camel/component/context/ src/test/resources/

2011-02-10 Thread davsclaus
Author: davsclaus
Date: Fri Feb 11 06:00:51 2011
New Revision: 1069678

URL: http://svn.apache.org/viewvc?rev=1069678view=rev
Log:
Fixed CS. Polished.

Modified:
camel/trunk/components/camel-context/   (props changed)
camel/trunk/components/camel-context/pom.xml

camel/trunk/components/camel-context/src/main/java/org/apache/camel/component/context/ContextConverters.java

camel/trunk/components/camel-context/src/main/java/org/apache/camel/component/context/LocalContextComponent.java

camel/trunk/components/camel-context/src/main/java/org/apache/camel/component/context/QualifiedContextComponent.java

camel/trunk/components/camel-context/src/test/java/org/apache/camel/component/context/JavaDslBlackBoxTest.java

camel/trunk/components/camel-context/src/test/java/org/apache/camel/component/context/JavaDslBlackBoxWithVerboseUriTest.java
camel/trunk/components/camel-context/src/test/resources/log4j.properties

Propchange: camel/trunk/components/camel-context/
--
--- svn:ignore (added)
+++ svn:ignore Fri Feb 11 06:00:51 2011
@@ -0,0 +1,9 @@
+.project
+.checkstyle
+.pmd
+.classpath
+target
+.settings
+eclipse-classes
+*.i??
+

Modified: camel/trunk/components/camel-context/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-context/pom.xml?rev=1069678r1=1069677r2=1069678view=diff
==
--- camel/trunk/components/camel-context/pom.xml (original)
+++ camel/trunk/components/camel-context/pom.xml Fri Feb 11 06:00:51 2011
@@ -15,72 +15,68 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 --
-project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;
+project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;
 
-   modelVersion4.0.0/modelVersion
+modelVersion4.0.0/modelVersion
 
-   parent
-   artifactIdcamel-parent/artifactId
-   groupIdorg.apache.camel/groupId
-   version2.7-SNAPSHOT/version
-   relativePath../../parent/relativePath
-   /parent
-
-   artifactIdcamel-context/artifactId
-   nameCamel :: Context /name
-   descriptionCamel Context component to expose CamelContext objects as 
a black box Component for use in other routes/description
-   packagingbundle/packaging
-
-   properties
-   camel.osgi.export.pkg
- org.apache.camel.component.context.*,
-   /camel.osgi.export.pkg
-   /properties
-
-   dependencies
-   dependency
-   groupIdorg.apache.camel/groupId
-   artifactIdcamel-core/artifactId
-   /dependency
-
-   !-- testing --
-dependency
-  groupIdorg.apache.camel/groupId
-  artifactIdcamel-core-xml/artifactId
-  scopetest/scope
-/dependency
-dependency
-  groupIdorg.apache.camel/groupId
-  artifactIdcamel-spring/artifactId
-  scopetest/scope
-/dependency
-   dependency
-   groupIdorg.apache.camel/groupId
-   artifactIdcamel-test/artifactId
-   scopetest/scope
-   /dependency
-   dependency
-   groupIdjunit/groupId
-   artifactIdjunit/artifactId
-   scopetest/scope
-   /dependency
-dependency
-  groupIdorg.springframework/groupId
-  artifactIdspring-test/artifactId
-  scopetest/scope
-/dependency
-
-   !-- logging --
-   dependency
-   groupIdorg.slf4j/groupId
-   artifactIdslf4j-log4j12/artifactId
-   scopetest/scope
-   /dependency
-   dependency
-   groupIdlog4j/groupId
-   artifactIdlog4j/artifactId
-   scopetest/scope
-   /dependency
-   /dependencies
+parent
+artifactIdcamel-parent/artifactId
+groupIdorg.apache.camel/groupId
+version2.7-SNAPSHOT/version
+relativePath../../parent/relativePath
+/parent
+
+artifactIdcamel-context/artifactId
+nameCamel :: Context/name
+descriptionCamel Context component to expose CamelContext objects as a 
black box Component for use in other routes/description
+packagingbundle/packaging
+
+properties
+
camel.osgi.export.pkgorg.apache.camel.component.context.*/camel.osgi.export.pkg
+/properties
+
+dependencies
+
+dependency
+

svn commit: r1069679 - in /camel/trunk/components: camel-core-xml/src/main/java/org/apache/camel/core/xml/ camel-core-xml/src/main/java/org/apache/camel/core/xml/scan/ camel-spring/src/main/java/org/a

2011-02-10 Thread davsclaus
Author: davsclaus
Date: Fri Feb 11 06:03:06 2011
New Revision: 1069679

URL: http://svn.apache.org/viewvc?rev=1069679view=rev
Log:
CAMEL-3644: Added getter for endpoints in the abstract XML CamelContext 
FactoryBean so its avail in camel-spring and camel-blueprint. Polished.

Modified:

camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelConsumerTemplateFactoryBean.java

camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java

camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelEndpointFactoryBean.java

camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelProducerTemplateFactoryBean.java

camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelThreadPoolFactoryBean.java

camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/scan/AntPathMatcher.java

camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/scan/PatternBasedPackageScanFilter.java

camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java

Modified: 
camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelConsumerTemplateFactoryBean.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelConsumerTemplateFactoryBean.java?rev=1069679r1=1069678r2=1069679view=diff
==
--- 
camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelConsumerTemplateFactoryBean.java
 (original)
+++ 
camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelConsumerTemplateFactoryBean.java
 Fri Feb 11 06:03:06 2011
@@ -19,15 +19,10 @@ package org.apache.camel.core.xml;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
 
-import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
 import org.apache.camel.ConsumerTemplate;
 import org.apache.camel.impl.DefaultConsumerTemplate;
-import org.apache.camel.model.IdentifiedType;
 import org.apache.camel.util.ServiceHelper;
 
 /**
@@ -38,6 +33,7 @@ import org.apache.camel.util.ServiceHelp
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 public abstract class AbstractCamelConsumerTemplateFactoryBean extends 
AbstractCamelFactoryBeanConsumerTemplate {
+
 @XmlTransient
 private ConsumerTemplate template;
 @XmlAttribute

Modified: 
camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java?rev=1069679r1=1069678r2=1069679view=diff
==
--- 
camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
 (original)
+++ 
camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
 Fri Feb 11 06:03:06 2011
@@ -411,6 +411,8 @@ public abstract class AbstractCamelConte
 
 public abstract ListRouteDefinition getRoutes();
 
+public abstract List? extends AbstractCamelEndpointFactoryBean 
getEndpoints();
+
 public abstract ListInterceptDefinition getIntercepts();
 
 public abstract ListInterceptFromDefinition getInterceptFroms();

Modified: 
camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelEndpointFactoryBean.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelEndpointFactoryBean.java?rev=1069679r1=1069678r2=1069679view=diff
==
--- 
camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelEndpointFactoryBean.java
 (original)
+++ 
camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelEndpointFactoryBean.java
 Fri Feb 11 06:03:06 2011
@@ -20,17 +20,12 @@ import javax.xml.bind.annotation.XmlAcce
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
 
-import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
 import org.apache.camel.Endpoint;
 import org.apache.camel.NoSuchEndpointException;

svn commit: r1069680 - /camel/trunk/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java

2011-02-10 Thread davsclaus
Author: davsclaus
Date: Fri Feb 11 06:09:11 2011
New Revision: 1069680

URL: http://svn.apache.org/viewvc?rev=1069680view=rev
Log:
CAMEL-3640: Lucene should type convert to String for headers and not type cast.

Modified:

camel/trunk/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java

Modified: 
camel/trunk/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java?rev=1069680r1=1069679r2=1069680view=diff
==
--- 
camel/trunk/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
 (original)
+++ 
camel/trunk/components/camel-lucene/src/main/java/org/apache/camel/component/lucene/LuceneIndexer.java
 Fri Feb 11 06:09:11 2011
@@ -18,7 +18,6 @@ package org.apache.camel.component.lucen
 
 import java.io.File;
 import java.io.IOException;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
 
@@ -69,7 +68,7 @@ public class LuceneIndexer {
 add(exchangeId, exchange.getExchangeId(), true);
 for (EntryString, Object entry : headers.entrySet()) {
 String field = entry.getKey();
-String value = (String) entry.getValue();
+String value = 
exchange.getContext().getTypeConverter().convertTo(String.class, 
entry.getValue());
 add(field, value, true);
 }