svn commit: r1467569 - /camel/trunk/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProcessor.java

2013-04-13 Thread davsclaus
Author: davsclaus
Date: Sat Apr 13 07:35:36 2013
New Revision: 1467569

URL: http://svn.apache.org/r1467569
Log:
CAMEL-6265: direct-vm component - The processor should support async routing 
engine

Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProcessor.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProcessor.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProcessor.java?rev=1467569r1=1467568r2=1467569view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProcessor.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProcessor.java
 Sat Apr 13 07:35:36 2013
@@ -16,9 +16,10 @@
  */
 package org.apache.camel.component.directvm;
 
+import org.apache.camel.AsyncCallback;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
-import org.apache.camel.processor.DelegateProcessor;
+import org.apache.camel.processor.DelegateAsyncProcessor;
 import org.apache.camel.util.ExchangeHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -26,7 +27,7 @@ import org.slf4j.LoggerFactory;
 /**
 *
 */
-public final class DirectVmProcessor extends DelegateProcessor {
+public final class DirectVmProcessor extends DelegateAsyncProcessor {
 
 private static final transient Logger LOG = 
LoggerFactory.getLogger(DirectVmProcessor.class);
 private final DirectVmEndpoint endpoint;
@@ -37,9 +38,9 @@ public final class DirectVmProcessor ext
 }
 
 @Override
-public void process(Exchange exchange) throws Exception {
+public boolean process(final Exchange exchange, final AsyncCallback 
callback) {
 // need to use a copy of the incoming exchange, so we route using this 
camel context
-Exchange copy = prepareExchange(exchange);
+final Exchange copy = prepareExchange(exchange);
 
 ClassLoader current = Thread.currentThread().getContextClassLoader();
 boolean changed = false;
@@ -51,10 +52,19 @@ public final class DirectVmProcessor ext
 Thread.currentThread().setContextClassLoader(appClassLoader);
 changed = true;
 }
-getProcessor().process(copy);
+return getProcessor().process(copy, new AsyncCallback() {
+@Override
+public void done(boolean done) {
+try {
+// make sure to copy results back
+ExchangeHelper.copyResults(exchange, copy);
+} finally {
+// must call callback when we are done
+callback.done(done);
+}
+}
+});
 } finally {
-// make sure to copy results back
-ExchangeHelper.copyResults(exchange, copy);
 // restore TCCL if it was changed during processing
 if (changed) {
 LOG.trace(Restoring Thread ContextClassLoader to {}, 
current);




svn commit: r1467570 - in /camel/branches/camel-2.10.x: ./ camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProcessor.java

2013-04-13 Thread davsclaus
Author: davsclaus
Date: Sat Apr 13 07:36:31 2013
New Revision: 1467570

URL: http://svn.apache.org/r1467570
Log:
CAMEL-6265: direct-vm component - The processor should support async routing 
engine

Modified:
camel/branches/camel-2.10.x/   (props changed)

camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProcessor.java

Propchange: camel/branches/camel-2.10.x/
--
  Merged /camel/trunk:r1467569

Propchange: camel/branches/camel-2.10.x/
--
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProcessor.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProcessor.java?rev=1467570r1=1467569r2=1467570view=diff
==
--- 
camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProcessor.java
 (original)
+++ 
camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProcessor.java
 Sat Apr 13 07:36:31 2013
@@ -16,9 +16,10 @@
  */
 package org.apache.camel.component.directvm;
 
+import org.apache.camel.AsyncCallback;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
-import org.apache.camel.processor.DelegateProcessor;
+import org.apache.camel.processor.DelegateAsyncProcessor;
 import org.apache.camel.util.ExchangeHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -26,7 +27,7 @@ import org.slf4j.LoggerFactory;
 /**
 *
 */
-public final class DirectVmProcessor extends DelegateProcessor {
+public final class DirectVmProcessor extends DelegateAsyncProcessor {
 
 private static final transient Logger LOG = 
LoggerFactory.getLogger(DirectVmProcessor.class);
 private final DirectVmEndpoint endpoint;
@@ -37,9 +38,9 @@ public final class DirectVmProcessor ext
 }
 
 @Override
-public void process(Exchange exchange) throws Exception {
+public boolean process(final Exchange exchange, final AsyncCallback 
callback) {
 // need to use a copy of the incoming exchange, so we route using this 
camel context
-Exchange copy = prepareExchange(exchange);
+final Exchange copy = prepareExchange(exchange);
 
 ClassLoader current = Thread.currentThread().getContextClassLoader();
 boolean changed = false;
@@ -51,10 +52,19 @@ public final class DirectVmProcessor ext
 Thread.currentThread().setContextClassLoader(appClassLoader);
 changed = true;
 }
-getProcessor().process(copy);
+return getProcessor().process(copy, new AsyncCallback() {
+@Override
+public void done(boolean done) {
+try {
+// make sure to copy results back
+ExchangeHelper.copyResults(exchange, copy);
+} finally {
+// must call callback when we are done
+callback.done(done);
+}
+}
+});
 } finally {
-// make sure to copy results back
-ExchangeHelper.copyResults(exchange, copy);
 // restore TCCL if it was changed during processing
 if (changed) {
 LOG.trace(Restoring Thread ContextClassLoader to {}, 
current);




svn commit: r1467573 - /camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java

2013-04-13 Thread davsclaus
Author: davsclaus
Date: Sat Apr 13 08:22:08 2013
New Revision: 1467573

URL: http://svn.apache.org/r1467573
Log:
CAMEL-6268: camel-stream - Shutdown thread pool on consumer should happen faster

Modified:

camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java

Modified: 
camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java?rev=1467573r1=1467572r2=1467573view=diff
==
--- 
camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
 (original)
+++ 
camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
 Sat Apr 13 08:22:08 2013
@@ -82,10 +82,8 @@ public class StreamConsumer extends Defa
 
 @Override
 public void doStop() throws Exception {
-// important: do not close the stream as it will close the standard
-// system.in etc.
 if (executor != null) {
-
endpoint.getCamelContext().getExecutorServiceManager().shutdownGraceful(executor);
+
endpoint.getCamelContext().getExecutorServiceManager().shutdownNow(executor);
 executor = null;
 }
 lines.clear();
@@ -98,6 +96,8 @@ public class StreamConsumer extends Defa
 public void run() {
 try {
 readFromStream();
+} catch (InterruptedException e) {
+// we are closing down so ignore
 } catch (Exception e) {
 getExceptionHandler().handleException(e);
 }




svn commit: r1467574 - in /camel/branches/camel-2.10.x: ./ components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java

2013-04-13 Thread davsclaus
Author: davsclaus
Date: Sat Apr 13 08:22:55 2013
New Revision: 1467574

URL: http://svn.apache.org/r1467574
Log:
CAMEL-6268: camel-stream - Shutdown thread pool on consumer should happen faster

Modified:
camel/branches/camel-2.10.x/   (props changed)

camel/branches/camel-2.10.x/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java

Propchange: camel/branches/camel-2.10.x/
--
  Merged /camel/trunk:r1467573

Propchange: camel/branches/camel-2.10.x/
--
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
camel/branches/camel-2.10.x/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java?rev=1467574r1=1467573r2=1467574view=diff
==
--- 
camel/branches/camel-2.10.x/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
 (original)
+++ 
camel/branches/camel-2.10.x/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
 Sat Apr 13 08:22:55 2013
@@ -82,8 +82,6 @@ public class StreamConsumer extends Defa
 
 @Override
 public void doStop() throws Exception {
-// important: do not close the stream as it will close the standard
-// system.in etc.
 if (executor != null) {
 
endpoint.getCamelContext().getExecutorServiceManager().shutdownNow(executor);
 executor = null;
@@ -98,6 +96,8 @@ public class StreamConsumer extends Defa
 public void run() {
 try {
 readFromStream();
+} catch (InterruptedException e) {
+// we are closing down so ignore
 } catch (Exception e) {
 getExceptionHandler().handleException(e);
 }




svn commit: r1467578 - /camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java

2013-04-13 Thread davsclaus
Author: davsclaus
Date: Sat Apr 13 09:27:20 2013
New Revision: 1467578

URL: http://svn.apache.org/r1467578
Log:
CAMEL-6260: Setting options on endpoint now set accessible with reflection to 
allow setting on package visibile classes. Thanks to Jury Matveentsev for the 
patch.

Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java?rev=1467578r1=1467577r2=1467578view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
 Sat Apr 13 09:27:20 2013
@@ -225,11 +225,15 @@ public final class IntrospectionSupport 
 if (info.isGetter  info.hasGetterAndSetter) {
 String name = info.getterOrSetterShorthandName;
 try {
+// we may want to set options on classes that has package 
view visibility, so override the accessible
+method.setAccessible(true);
 Object value = method.invoke(target);
 properties.put(optionPrefix + name, value);
 rc = true;
 } catch (Exception e) {
-// ignore
+if (LOG.isTraceEnabled()) {
+LOG.trace(Error invoking getter method  + method + 
. This exception is ignored., e);
+}
 }
 }
 }
@@ -483,6 +487,8 @@ public final class IntrospectionSupport 
 try {
 // If the type is null or it matches the needed type, just 
use the value directly
 if (value == null || 
parameterType.isAssignableFrom(ref.getClass())) {
+// we may want to set options on classes that has 
package view visibility, so override the accessible
+setter.setAccessible(true);
 setter.invoke(target, ref);
 if (LOG.isDebugEnabled()) {
 LOG.debug(Configured property: {} on bean: {} 
with value: {}, new Object[]{name, target, ref});
@@ -491,6 +497,8 @@ public final class IntrospectionSupport 
 } else {
 // We need to convert it
 Object convertedValue = convert(typeConverter, 
parameterType, ref);
+// we may want to set options on classes that has 
package view visibility, so override the accessible
+setter.setAccessible(true);
 setter.invoke(target, convertedValue);
 if (LOG.isDebugEnabled()) {
 LOG.debug(Configured property: {} on bean: {} 
with value: {}, new Object[]{name, target, ref});
@@ -509,6 +517,8 @@ public final class IntrospectionSupport 
 }
 }
 // ignore exceptions as there could be another setter method where 
we could type convert successfully
+} catch (SecurityException e) {
+typeConversionFailed = e;
 } catch (NoTypeConversionAvailableException e) {
 typeConversionFailed = e;
 } catch (IllegalArgumentException e) {




svn commit: r1467580 - in /camel/branches/camel-2.10.x: ./ camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java

2013-04-13 Thread davsclaus
Author: davsclaus
Date: Sat Apr 13 09:31:49 2013
New Revision: 1467580

URL: http://svn.apache.org/r1467580
Log:
CAMEL-6260: Setting options on endpoint now set accessible with reflection to 
allow setting on package visibile classes. Thanks to Jury Matveentsev for the 
patch.

Modified:
camel/branches/camel-2.10.x/   (props changed)

camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java

Propchange: camel/branches/camel-2.10.x/
--
  Merged /camel/trunk:r1467578

Propchange: camel/branches/camel-2.10.x/
--
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java?rev=1467580r1=1467579r2=1467580view=diff
==
--- 
camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
 (original)
+++ 
camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
 Sat Apr 13 09:31:49 2013
@@ -179,13 +179,17 @@ public final class IntrospectionSupport 
 try {
 // must be properties which have setters
 if (isGetter(method)  hasSetter(target, method)) {
+// we may want to set options on classes that has package 
view visibility, so override the accessible
+method.setAccessible(true);
 Object value = method.invoke(target);
 String name = getGetterShorthandName(method);
 properties.put(optionPrefix + name, value);
 rc = true;
 }
 } catch (Exception e) {
-// ignore
+if (LOG.isTraceEnabled()) {
+LOG.trace(Error invoking getter method  + method + . 
This exception is ignored., e);
+}
 }
 }
 
@@ -376,6 +380,8 @@ public final class IntrospectionSupport 
 try {
 // If the type is null or it matches the needed type, just 
use the value directly
 if (value == null || 
parameterType.isAssignableFrom(ref.getClass())) {
+// we may want to set options on classes that has 
package view visibility, so override the accessible
+setter.setAccessible(true);
 setter.invoke(target, ref);
 if (LOG.isDebugEnabled()) {
 LOG.debug(Configured property: {} on bean: {} 
with value: {}, new Object[]{name, target, ref});
@@ -384,6 +390,8 @@ public final class IntrospectionSupport 
 } else {
 // We need to convert it
 Object convertedValue = convert(typeConverter, 
parameterType, ref);
+// we may want to set options on classes that has 
package view visibility, so override the accessible
+setter.setAccessible(true);
 setter.invoke(target, convertedValue);
 if (LOG.isDebugEnabled()) {
 LOG.debug(Configured property: {} on bean: {} 
with value: {}, new Object[]{name, target, ref});
@@ -402,6 +410,8 @@ public final class IntrospectionSupport 
 }
 }
 // ignore exceptions as there could be another setter method where 
we could type convert successfully
+} catch (SecurityException e) {
+typeConversionFailed = e;
 } catch (NoTypeConversionAvailableException e) {
 typeConversionFailed = e;
 } catch (IllegalArgumentException e) {




svn commit: r1467582 - in /camel/trunk: components/camel-jclouds/pom.xml parent/pom.xml

2013-04-13 Thread davsclaus
Author: davsclaus
Date: Sat Apr 13 10:03:23 2013
New Revision: 1467582

URL: http://svn.apache.org/r1467582
Log:
CAMEL-6261: Fixed install camel-jclouds in Karaf

Modified:
camel/trunk/components/camel-jclouds/pom.xml
camel/trunk/parent/pom.xml

Modified: camel/trunk/components/camel-jclouds/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-jclouds/pom.xml?rev=1467582r1=1467581r2=1467582view=diff
==
--- camel/trunk/components/camel-jclouds/pom.xml (original)
+++ camel/trunk/components/camel-jclouds/pom.xml Sat Apr 13 10:03:23 2013
@@ -34,6 +34,7 @@
 properties
 
camel.osgi.export.pkgorg.apache.camel.component.jclouds.*/camel.osgi.export.pkg
 
camel.osgi.export.serviceorg.apache.camel.spi.ComponentResolver;component=jclouds/camel.osgi.export.service
+
google-guava-version${jclouds-google-guava-version}/google-guava-version
 /properties
 
 dependencies

Modified: camel/trunk/parent/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=1467582r1=1467581r2=1467582view=diff
==
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Sat Apr 13 10:03:23 2013
@@ -197,6 +197,8 @@
 jaxen-version1.1.4/jaxen-version
 jboss-javaee-6-version1.0.0.Final/jboss-javaee-6-version
 jclouds-version1.5.7/jclouds-version
+!-- jclouds must use this guava version --
+jclouds-google-guava-version13.0.1/jclouds-google-guava-version
 jcr-version2.0/jcr-version
 jdom-bundle-version1.1_4/jdom-bundle-version
 jdom-version1.1.3/jdom-version




svn commit: r1467653 - /camel/trunk/etc/pom.xml

2013-04-13 Thread cmueller
Author: cmueller
Date: Sat Apr 13 16:14:11 2013
New Revision: 1467653

URL: http://svn.apache.org/r1467653
Log:
Manually updating version numbers which are not updated by the 
maven-release-plugin

Modified:
camel/trunk/etc/pom.xml

Modified: camel/trunk/etc/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/etc/pom.xml?rev=1467653r1=1467652r2=1467653view=diff
==
--- camel/trunk/etc/pom.xml (original)
+++ camel/trunk/etc/pom.xml Sat Apr 13 16:14:11 2013
@@ -23,8 +23,7 @@
   parent
 groupIdorg.apache.camel/groupId
 artifactIdcamel-parent/artifactId
-version2.11-SNAPSHOT/version
-relativePath../parent/relativePath
+version2.12-SNAPSHOT/version
   /parent
 
   artifactIdcamel-etc/artifactId




svn commit: r1467657 - /camel/trunk/examples/camel-example-cxf-proxy/README.txt

2013-04-13 Thread cmueller
Author: cmueller
Date: Sat Apr 13 16:51:22 2013
New Revision: 1467657

URL: http://svn.apache.org/r1467657
Log:
Fixed the README file for camel-example-cxf-proxy because we use dynamic port 
numbers

Modified:
camel/trunk/examples/camel-example-cxf-proxy/README.txt

Modified: camel/trunk/examples/camel-example-cxf-proxy/README.txt
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf-proxy/README.txt?rev=1467657r1=1467656r2=1467657view=diff
==
--- camel/trunk/examples/camel-example-cxf-proxy/README.txt (original)
+++ camel/trunk/examples/camel-example-cxf-proxy/README.txt Sat Apr 13 16:51:22 
2013
@@ -10,18 +10,19 @@ To run the example type:
   mvn camel:run
 
 The proxied webservice is located at
-  http://localhost:9080/camel-example-cxf-proxy/webservices/incident
+  http://localhost:port 1/camel-example-cxf-proxy/webservices/incident
 
 The real webservice is located at
-  http://localhost:9081/real-webservice
+  http://localhost:port 2/real-webservice
 
 The webservice WSDL is exposed at:
-  http://localhost:9080/camel-example-cxf-proxy/webservices/incident?wsdl
+  http://localhost:port 1/camel-example-cxf-proxy/webservices/incident?wsdl
 
+Because we use dynamic port numbers, you have to check the console to get the 
used one.
 To stop the example hit ctrl + c
 
 To make a SOAP call open soapUI or another SOAP query tool and create a new
-project w/WSDL of 
http://localhost:9080/camel-example-cxf-proxy/webservices/incident?wsdl.
+project w/WSDL of http://localhost:port 
1/camel-example-cxf-proxy/webservices/incident?wsdl.
 Then make SOAP requests of this format:
 
 soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;