svn commit: r1033828 - /camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/seda/SedaTest.java

2010-11-10 Thread davsclaus
Author: davsclaus
Date: Thu Nov 11 07:35:47 2010
New Revision: 1033828

URL: http://svn.apache.org/viewvc?rev=1033828&view=rev
Log:
Fixed test

Modified:

camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/seda/SedaTest.java

Modified: 
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/seda/SedaTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/seda/SedaTest.java?rev=1033828&r1=1033827&r2=1033828&view=diff
==
--- 
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/seda/SedaTest.java
 (original)
+++ 
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/seda/SedaTest.java
 Thu Nov 11 07:35:47 2010
@@ -51,12 +51,16 @@ public class SedaTest extends OSGiIntegr
 @Test
 public void testCamelContextName() throws Exception {
 // should get the context name with osgi bundle id
-assertTrue("Get the wrong camel context name.", 
context.getName().indexOf("-1") > 0);
-assertTrue("Get the wrong camel context name.", 
context.getName().indexOf("camel-1") < 0);
-
+String name1 = context.getName();
+
 CamelContext context2 = createCamelContext();
-assertTrue("Get the wrong camel context name.", 
context2.getName().indexOf("-2") > 0);
-assertTrue("Get the wrong camel context name.", 
context2.getName().indexOf("camel-2") < 0);
+String name2 = context2.getName();
+
+assertNotSame(name1, name2);
+
+String id = "" + bundleContext.getBundle().getBundleId();
+assertTrue(name1.startsWith(id));
+assertTrue(name2.startsWith(id));
 }

 }
\ No newline at end of file




[CONF] Apache Camel > Quartz

2010-11-10 Thread confluence







Quartz
Page edited by Richard Kettelerij


Comment:
fixed package names, thanks to IRC user 'ubba' for reporting.


 Changes (2)
 



...
 {code:xml} 
class="org.apache.camel.component.quartz.QuartzComponent"> 
  
...
 {code:xml} 
class="org.apache.camel.component.quartz.QuartzComponent"> 
  
...

Full 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).

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



org.apache.camel
camel-quartz
x.x.x






Using cron expressionsConfiguring the cron _expression_ in Camel 1.x is based on path separators. We changed this to an URI option in Camel 2.0, allowing a more elegant configuration.
Also it is not possible to use the / cron special character (for increments) in Camel 1.x, which Camel 2.0 also fixes.

URI format



quartz://timerName?options
quartz://groupName/timerName?options
quartz://groupName/timerName/cronExpression   (@deprecated)
quartz://groupName/timerName/?cron=_expression_ (Camel 2.0)
quartz://timerName?cron=_expression_(Camel 2.0)



The component uses either a CronTrigger or a SimpleTrigger. If no cron _expression_ is provided, the component uses a simple trigger. If no groupName is provided, the quartz component uses the Camel group name.

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

Options



 Parameter 
 Default 
 Description 


 cron 
 None 
 Specifies a cron _expression_ (not compatible with the trigger.* or job.* options). 


 trigger.repeatCount 
 0 
 SimpleTrigger: How many times should the timer repeat? 


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


 job.name 
 null 
 Sets the job name. 


 job.XXX 
 null 
 Sets the job option with the XXX setter name. 


 trigger.XXX 
 null 
 Sets the trigger option with the XXX setter name. 


 stateful 
 false 
 Uses a Quartz StatefulJob instead of the default job. 


 fireNow 
 false 
 New to Camel 2.2.0, if it is true will fire the trigger when the route is start when using SimpleTrigger.





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


from("quartz://myGroup/myTimerName?trigger.repeatInterval=2&trigger.repeatCount=1").routeId("myRoute").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.


Configuring quartz.properties file

By default Quartz will look for a quartz.properties file in the root of the classpath. If you are using WAR deployments this means just drop the quartz.properties in WEB-INF/classes.

However the Camel Quartz component also allows you to configure properties:



 Parameter 
 Default 
 Type 
 Description 


 properties 
 null 
 Properties 
 Camel 2.4: You can configure a java.util.Propoperties instance. 


 propertiesFile 
 null 
 String 
 Camel 2.4: File name of the properties to load from the classpath 





To do this you can configure this in Spring XML as follows



"quartz" class="org.apache.camel.component.quartz.QuartzComponent">
"propertiesFile" value="com/mycompany/myquartz.properties"/>





Starting the Quartz scheduler
Available as of Camel 2.4

The Quartz component offers an option to let the Quartz scheduler be started delayed, or not auto started at all.



 Parameter 
 Default 
 Type 
 Description 


 startDelayedSeconds 
 0 
 int 
 Camel 2.4: Seconds to wait before starting the quartz scheduler. 


 autoStartScheduler 
 true 
 boolean 
 Camel 2.4: Whether or not the scheduler should be auto started. 





To do this you can configure this in Spring XML as follows



"quartz" class="org.apache.camel.component.quartz.QuartzComponent">
"startDelayedSeconds" value="5"/>





Clustering
Available as of Camel 2.4

If you use Quartz in clustered mode, e.g. the JobStore is clustered. Then from Camel 2.4 onwards the Quartz component will not pause/remove triggers when a node is being stopped/shutdown. This allows the trigger to keep running on the other nodes in the cluster.


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

The fireTime header contains the java.util.Date of when 

svn commit: r1033501 - in /camel/trunk/components: camel-core-osgi/src/main/java/org/apache/camel/core/osgi/ camel-spring/src/main/java/org/apache/camel/osgi/

2010-11-10 Thread davsclaus
Author: davsclaus
Date: Wed Nov 10 14:51:00 2010
New Revision: 1033501

URL: http://svn.apache.org/viewvc?rev=1033501&view=rev
Log:
CAMEL-3324: OSGi will prepend the bundle id in the JMX name so they are nicely 
sorted by bundle id in the JMX consoles.

Modified:

camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextNameStrategy.java

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

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

Modified: 
camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextNameStrategy.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextNameStrategy.java?rev=1033501&r1=1033500&r2=1033501&view=diff
==
--- 
camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextNameStrategy.java
 (original)
+++ 
camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextNameStrategy.java
 Wed Nov 10 14:51:00 2010
@@ -22,8 +22,9 @@ import org.osgi.framework.BundleContext;
 public class OsgiCamelContextNameStrategy extends 
DefaultCamelContextNameStrategy {
 
 public OsgiCamelContextNameStrategy(BundleContext context) {
-// use bundle id in auto assigned names to make it unique
-super("camel-" + context.getBundle().getBundleId() + "-");
+// use bundle id in auto assigned names to make it unique and have the 
bundle id as prefix
+// which makes the ordering of the camel apps in JMX nicely sorted
+super(context.getBundle().getBundleId()+ "-camel");
 }
 
 }

Modified: 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelContextFactoryBean.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelContextFactoryBean.java?rev=1033501&r1=1033500&r2=1033501&view=diff
==
--- 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelContextFactoryBean.java
 (original)
+++ 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/osgi/CamelContextFactoryBean.java
 Wed Nov 10 14:51:00 2010
@@ -48,7 +48,7 @@ public class CamelContextFactoryBean ext
 
 protected SpringCamelContext createContext() {
 SpringCamelContext ctx = newCamelContext();
-// we don't the the ImplicitId as it will override the 
OsgiCamelContextNameStrategy
+// only set the name if its explicit (Camel will auto assign name if 
none explicit set)
 if (!isImplicitId()) {
 ctx.setName(getId());
 }

Modified: 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/osgi/OsgiSpringCamelContext.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/osgi/OsgiSpringCamelContext.java?rev=1033501&r1=1033500&r2=1033501&view=diff
==
--- 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/osgi/OsgiSpringCamelContext.java
 (original)
+++ 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/osgi/OsgiSpringCamelContext.java
 Wed Nov 10 14:51:00 2010
@@ -47,8 +47,9 @@ public class OsgiSpringCamelContext exte
 @Override
 public void setName(String name) {
 super.setName(name);
-// in OSGi append the bundle id to the management name so it will be 
unique in the JVM
-super.setManagementName(name + "-" + 
bundleContext.getBundle().getBundleId());
+// in OSGi prefix the bundle id to the management name so it will be 
unique in the JVM
+// and also nicely sorted based on bundle id
+super.setManagementName(bundleContext.getBundle().getBundleId() + "-" 
+ name);
 }
 
 }




svn commit: r1033410 - in /camel/trunk/components/camel-web/src/main/webapp/WEB-INF/org/apache/camel/web/resources: EndpointResource.index.ssp ExchangeResource.index.ssp

2010-11-10 Thread jstrachan
Author: jstrachan
Date: Wed Nov 10 10:35:14 2010
New Revision: 1033410

URL: http://svn.apache.org/viewvc?rev=1033410&view=rev
Log:
fixed up some bad markup, fixing the title of links

Modified:

camel/trunk/components/camel-web/src/main/webapp/WEB-INF/org/apache/camel/web/resources/EndpointResource.index.ssp

camel/trunk/components/camel-web/src/main/webapp/WEB-INF/org/apache/camel/web/resources/ExchangeResource.index.ssp

Modified: 
camel/trunk/components/camel-web/src/main/webapp/WEB-INF/org/apache/camel/web/resources/EndpointResource.index.ssp
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/main/webapp/WEB-INF/org/apache/camel/web/resources/EndpointResource.index.ssp?rev=1033410&r1=1033409&r2=1033410&view=diff
==
--- 
camel/trunk/components/camel-web/src/main/webapp/WEB-INF/org/apache/camel/web/resources/EndpointResource.index.ssp
 (original)
+++ 
camel/trunk/components/camel-web/src/main/webapp/WEB-INF/org/apache/camel/web/resources/EndpointResource.index.ssp
 Wed Nov 10 10:35:14 2010
@@ -13,7 +13,7 @@
 
   #for(exchange <- it.getBrowsableEndpoint.getExchanges)
 
-  ${exchange.getExchangeId}
+  ${exchange.getExchangeId}
 
   #end
   

Modified: 
camel/trunk/components/camel-web/src/main/webapp/WEB-INF/org/apache/camel/web/resources/ExchangeResource.index.ssp
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/main/webapp/WEB-INF/org/apache/camel/web/resources/ExchangeResource.index.ssp?rev=1033410&r1=1033409&r2=1033410&view=diff
==
--- 
camel/trunk/components/camel-web/src/main/webapp/WEB-INF/org/apache/camel/web/resources/ExchangeResource.index.ssp
 (original)
+++ 
camel/trunk/components/camel-web/src/main/webapp/WEB-INF/org/apache/camel/web/resources/ExchangeResource.index.ssp
 Wed Nov 10 10:35:14 2010
@@ -20,7 +20,7 @@
 #for(entry <- it.getProperties)
   
 ${entry.getKey}
-${entry.getValue}
+${entry.getValue}
   
 #end
   
@@ -37,7 +37,7 @@
 #for(entry <- it.getHeaders)
   
 ${entry.getKey}
-${entry.getValue}
+${entry.getValue}
   
 #end
   




[CONF] Apache Camel > Camel 2.6.0 Release

2010-11-10 Thread confluence







Camel 2.6.0 Release
Page edited by Claus Ibsen


 Changes (2)
 



...
* [Thread names|Threading Model] now outputs [CamelContext] name which makes it easier to differentiate when running multiple Camel applications in the same JVM. * Introduced {{contentCache}} option to [XSLT] component to allow easy reloading of stylesheets during development. 
* Improved [Camel JMX] to always find next free name when registering in JMX and existing name exists (to remedy name clash). This makes it easier when deploying muliple WARs in the same JVM where the Camel applications may have same [CamelContext] id. In OSGi the name in JMX now has the bundle id as prefix. 
 h3. New [Enterprise Integration Patterns] 
...
h3. New [Data Formats|Data Format]  
* [SysLog]  
h3. New [Languages]  
...

Full Content

Camel 2.6.0 release (currently in progress)




New and Noteworthy

Welcome to the 2.6.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)


	Fixed issue in OSGi with refreshing Camel bundles causing a race condition when discovering type converters
	Introduced ScheduledRoutePolicy with the Quartz component
	Java DSL RouteBuilder now fails if onException and the likes are not configured before routes, which they must.
	Easier to debug routes from camel-test using the Debugger
	Fixed problem installing camel-cxf feature on Apache Karaf.
	The EIP now supports property placeholders in the String based options (a few spots in Java DSL where its not possible). For example: 

"String" charset="{{foo.myCharset}}"/>

	Introduced ScheduledRoutePolicy to allow you to schedule when routes should be active.
	Introduced stepwise option to FTP component to allow end users to control how to traverse directories of the FTP servers. This allows you to set stepwise=false to return back to the behavior from Camel 2.0 - 2.4. See more at the FTP documentation.
	Thread names now outputs CamelContext name which makes it easier to differentiate when running multiple Camel applications in the same JVM.
	Introduced contentCache option to XSLT component to allow easy reloading of stylesheets during development.
	Improved Camel JMX to always find next free name when registering in JMX and existing name exists (to remedy name clash). This makes it easier when deploying muliple WARs in the same JVM where the Camel applications may have same CamelContext id. In OSGi the name in JMX now has the bundle id as prefix.



New Enterprise Integration Patterns

New Components


	Spring Web Services
	JMX



New DSL

New Annotations

New Data Formats


	Syslog



New Languages

New Examples

New Tutorials

API breaking

Known Issues


	The Tracer may not output all details for some situations such as when using onCompletion or intercept etc.
	Not all Examples have ANT build.xml files to run the example using ANT.
	Project cannot be fully build using Maven 3.0
	One may encounter build errors in camel-ftp with java versions older than "1.5.0_24"
	Dozer does not work in OSGi
	camel-blueprint is not fully feature complete (such as @Producer, @Consume is not supported)
	camel-blueprint using  scan does not work



Important changes to consider when upgrading


	Upgraded to Spring 3.0.5
	Upgraded to Apache CXF 2.3.0 (although CXF 2.2.11 is still supported)
	The Java DSL now enforces onException and the likes to be defined before routes, if not Camel will fail starting the route.



Getting the Distributions

Binary Distributions




 Description 
 Download Link 
 PGP Signature file of download 


 Windows Distribution 
 apache-camel-2.6.0.zip 
 apache-camel-2.6.0.zip.asc 


 Unix/Linux/Cygwin Distribution 
 apache-camel-2.6.0.tar.gz 
 apache-camel-2.6.0.tar.gz.asc 




The above URLs use redirectionThe above URLs use the Apache Mirror system to redirect you to a suitable mirror for your download. Some users have experienced issues with some versions of browsers (e.g. some Safari browsers). If the download doesn't seem to work for you from the above URL then try using FireFox

Source Distributions




 Description 
 Download Link 
 PGP Signature file of download 


 Source for Windows 
 apache-camel-2.6.0-src.zip 
 apache-camel-2.6.0-src.zip.asc 








 Source for Unix/Linux/Cygwin 
 apache-camel-2.6.0-src.tar.gz 
 apache-camel-2.6.0-src.tar.gz.asc 





Getting the Binaries using Maven 2

To use this release in your maven project, the proper dependency configuration that you should use in your Maven POM is:



  org.apache.camel
  camel-core
  2.6.0




SVN Tag Checkout



svn co http://svn.apache.org/repos/asf/camel/tags/camel-2.6.0



Changelog

For a more detailed view of new features and bug fixes, see the:

	release notes for 2.6.0




svn commit: r1033440 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/management/ camel-core/src/

2010-11-10 Thread davsclaus
Author: davsclaus
Date: Wed Nov 10 12:52:22 2010
New Revision: 1033440

URL: http://svn.apache.org/viewvc?rev=1033440&view=rev
Log:
CAMEL-3324: Camel will not automatic find next free name when registering in 
JMX to remedy duplicate CamelContext id clashes. For exampling deploying 
multiple WARs where camel apps may have same camel context id. OSGi will 
enforces using bundle id in the JMX name as well. 

Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java

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

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

camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java

camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementNamingStrategy.java

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

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

camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextHelper.java

camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextNameStrategy.java

camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiDefaultCamelContext.java

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

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

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

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java?rev=1033440&r1=1033439&r2=1033440&view=diff
==
--- camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java 
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java Wed 
Nov 10 12:52:22 2010
@@ -96,6 +96,24 @@ public interface CamelContext extends Su
 void setNameStrategy(CamelContextNameStrategy nameStrategy);
 
 /**
+ * Gets the name this {...@link CamelContext} was registered in JMX.
+ * 
+ * The reason that a {...@link CamelContext} can have a different name in 
JMX is the fact to remedy for name clash
+ * in JMX when having multiple {...@link CamelContext}s in the same JVM. 
Camel will automatic reassign and use
+ * a free name to avoid failing to start.
+ *
+ * @return the management name
+ */
+String getManagementName();
+
+/**
+ * Sets the name this {...@link CamelContext} was registered in JMX.
+ *
+ * @param name  the actual name used when registering this {...@link 
CamelContext} in JMX
+ */
+void setManagementName(String name);
+
+/**
  * Gets the version of the this context.
  *
  * @return the version

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=1033440&r1=1033439&r2=1033440&view=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
 Wed Nov 10 12:52:22 2010
@@ -125,6 +125,7 @@ import org.apache.commons.logging.LogFac
 public class DefaultCamelContext extends ServiceSupport implements 
CamelContext, SuspendableService {
 private static final transient Log LOG = 
LogFactory.getLog(DefaultCamelContext.class);
 private CamelContextNameStrategy nameStrategy = new 
DefaultCamelContextNameStrategy();
+private String managementName;
 private ClassLoader applicationContextClassLoader;
 private final Map endpoints = new EndpointRegistry();
 private final AtomicInteger endpointKeyCounter = new AtomicInteger();
@@ -241,6 +242,14 @@ public class DefaultCamelContext extends
 this.nameStrategy = nameStrategy;
 }
 
+public String getManagementName() {
+return managementName;
+}
+
+public void setManagementName(String managementName) {
+this.managementName = managementName;
+}
+
 public Component hasComponent(String componentName) {
 return components.get(componentName);
 }

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContextNameStrategy.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamel