svn commit: r952562 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/ components/camel-spring-security/src/main/java/org/apache/camel/component/spring/security/ components/camel-spring-sec
Author: ningjiang Date: Tue Jun 8 08:00:47 2010 New Revision: 952562 URL: http://svn.apache.org/viewvc?rev=952562view=rev Log: CAMEL-2796 provides policy referece id in CamelAuthorizationException Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/CamelAuthorizationException.java camel/trunk/components/camel-spring-security/src/main/java/org/apache/camel/component/spring/security/SpringSecurityAuthorizationPolicy.java camel/trunk/components/camel-spring-security/src/main/java/org/apache/camel/component/spring/security/config/SpringSecurityAuthorizationPolicyParser.java camel/trunk/examples/camel-example-spring-security/src/main/resources/org/apache/camel/example/spring/security/camel-context.xml Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/CamelAuthorizationException.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelAuthorizationException.java?rev=952562r1=952561r2=952562view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/CamelAuthorizationException.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/CamelAuthorizationException.java Tue Jun 8 08:00:47 2010 @@ -18,13 +18,20 @@ package org.apache.camel; public class CamelAuthorizationException extends CamelExchangeException { - +private final String policyId; + public CamelAuthorizationException(String message, Exchange exchange) { super(message, exchange); +policyId = exchange.getIn().getHeader(Exchange.AUTHENTICATION_FAILURE_POLICY_ID, String.class); } public CamelAuthorizationException(String message, Exchange exchange, Throwable cause) { super(message, exchange, cause); +policyId = exchange.getIn().getHeader(Exchange.AUTHENTICATION_FAILURE_POLICY_ID, String.class); +} + +public String getPolicyId() { +return policyId; } } Modified: camel/trunk/components/camel-spring-security/src/main/java/org/apache/camel/component/spring/security/SpringSecurityAuthorizationPolicy.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-security/src/main/java/org/apache/camel/component/spring/security/SpringSecurityAuthorizationPolicy.java?rev=952562r1=952561r2=952562view=diff == --- camel/trunk/components/camel-spring-security/src/main/java/org/apache/camel/component/spring/security/SpringSecurityAuthorizationPolicy.java (original) +++ camel/trunk/components/camel-spring-security/src/main/java/org/apache/camel/component/spring/security/SpringSecurityAuthorizationPolicy.java Tue Jun 8 08:00:47 2010 @@ -22,6 +22,7 @@ import org.apache.camel.CamelAuthorizati import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.Processor; +import org.apache.camel.model.IdentifiedType; import org.apache.camel.processor.DelegateProcessor; import org.apache.camel.spi.AuthorizationPolicy; import org.apache.camel.spi.RouteContext; @@ -42,7 +43,7 @@ import org.springframework.security.even import org.springframework.security.event.authorization.AuthorizedEvent; import org.springframework.util.Assert; -public class SpringSecurityAuthorizationPolicy implements AuthorizationPolicy, InitializingBean, ApplicationEventPublisherAware { +public class SpringSecurityAuthorizationPolicy extends IdentifiedType implements AuthorizationPolicy, InitializingBean, ApplicationEventPublisherAware { private static final transient Log LOG = LogFactory.getLog(SpringSecurityAuthorizationPolicy.class); private AccessDecisionManager accessDecisionManager; private AuthenticationManager authenticationManager; @@ -76,6 +77,7 @@ public class SpringSecurityAuthorization try { this.accessDecisionManager.decide(authenticated, exchange, attributes); } catch (AccessDeniedException accessDeniedException) { + exchange.getIn().setHeader(Exchange.AUTHENTICATION_FAILURE_POLICY_ID, getId()); AuthorizationFailureEvent event = new AuthorizationFailureEvent(exchange, attributes, authenticated, accessDeniedException); publishEvent(event); @@ -123,7 +125,6 @@ public class SpringSecurityAuthorization Assert.notNull(this.authenticationManager, An AuthenticationManager is required); Assert.notNull(this.accessDecisionManager, An AccessDecisionManager is required); Assert.notNull(this.accessPolicy, The accessPolicy is required); - } private Authentication authenticateIfRequired(Authentication authentication) { Modified: camel/trunk/components/camel-spring-security/src/main/java/org/apache/camel/component/spring/security/config/SpringSecurityAuthorizationPolicyParser.java URL:
svn commit: r952564 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/ main/java/org/apache/camel/builder/ main/java/org/apache/camel/language/simple/ test/java/org/apache/camel/language/
Author: ningjiang Date: Tue Jun 8 08:13:06 2010 New Revision: 952564 URL: http://svn.apache.org/viewvc?rev=952564view=rev Log: CAMEL-2797 Added exchange exception ognl expression supports to simple language Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguage.java camel/trunk/camel-core/src/test/java/org/apache/camel/language/SimpleTest.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java?rev=952564r1=952563r2=952564view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java Tue Jun 8 08:13:06 2010 @@ -31,7 +31,8 @@ import org.apache.camel.spi.UnitOfWork; */ public interface Exchange { -String AUTHENTICATION = CamelAuthentication; +String AUTHENTICATION = CamelAuthentication; +String AUTHENTICATION_FAILURE_POLICY_ID = CamelAuthenticationFailurePolicyId; String ACCEPT_CONTENT_TYPE= CamelAcceptContentType; @Deprecated String AGGREGATED_INDEX = CamelAggregatedIndex; Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java?rev=952564r1=952563r2=952564view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java Tue Jun 8 08:13:06 2010 @@ -253,6 +253,33 @@ public final class ExpressionBuilder { } }; } + +/** + * Returns the expression for the exchanges exception invoking methods defined + * in a simple OGNL notation + * + * @param ognl methods to invoke on the body in a simple OGNL syntax + */ +public static Expression exchangeExceptionOgnlExpression(final String ognl) { +return new ExpressionAdapter() { +public Object evaluate(Exchange exchange) { +Object exception = exchange.getException(); +if (exception == null) { +exception = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class); +} + +if (exception == null) { +return null; +} +return new MethodCallExpression(exception, ognl).evaluate(exchange); +} + +@Override +public String toString() { +return exchangeExceptionOgnl( + ognl + ); +} +}; +} /** * Returns an expression for the type converter Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguage.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguage.java?rev=952564r1=952563r2=952564view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguage.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguage.java Tue Jun 8 08:13:06 2010 @@ -91,8 +91,9 @@ public class SimpleLanguage extends Simp public static Expression simple(String expression) { return SIMPLE.createExpression(expression); } + +protected Expression createSimpleExpressionDirectly(String expression) { -protected Expression createSimpleExpression(String expression, boolean strict) { if (ObjectHelper.isEqualToAny(expression, body, in.body)) { return ExpressionBuilder.bodyExpression(); } else if (ObjectHelper.equal(expression, out.body)) { @@ -101,12 +102,25 @@ public class SimpleLanguage extends Simp return ExpressionBuilder.messageIdExpression(); } else if (ObjectHelper.equal(expression, exchangeId)) { return ExpressionBuilder.exchangeIdExpression(); +} else if (ObjectHelper.equal(expression, exception)) { +return ExpressionBuilder.exchangeExceptionExpression(); } else if (ObjectHelper.equal(expression, exception.message)) { return ExpressionBuilder.exchangeExceptionMessageExpression(); } else if (ObjectHelper.equal(expression, threadName)) { return ExpressionBuilder.threadNameExpression(); } +
svn commit: r952570 - in /camel/trunk: parent/ tests/camel-itest-osgi/ tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/ tests/camel-itest-osgi/src/test/resources/org/apache/
Author: gnodet Date: Tue Jun 8 08:45:08 2010 New Revision: 952570 URL: http://svn.apache.org/viewvc?rev=952570view=rev Log: Add some blueprint integration tests Added: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/ camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-1.xml camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-2.xml camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-3.xml Modified: camel/trunk/parent/pom.xml camel/trunk/tests/camel-itest-osgi/pom.xml Modified: camel/trunk/parent/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=952570r1=952569r2=952570view=diff == --- camel/trunk/parent/pom.xml (original) +++ camel/trunk/parent/pom.xml Tue Jun 8 08:45:08 2010 @@ -1306,6 +1306,14 @@ artifactIdorg.apache.aries.blueprint/artifactId version${aries-blueprint-version}/version /dependency + + !-- OSGi ConfigAdmin service -- + dependency + groupIdorg.apache.felix/groupId + artifactIdorg.apache.felix.configadmin/artifactId + version1.2.4/version + /dependency + /dependencies /dependencyManagement Modified: camel/trunk/tests/camel-itest-osgi/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/pom.xml?rev=952570r1=952569r2=952570view=diff == --- camel/trunk/tests/camel-itest-osgi/pom.xml (original) +++ camel/trunk/tests/camel-itest-osgi/pom.xml Tue Jun 8 08:45:08 2010 @@ -144,6 +144,14 @@ artifactIdjunit/artifactId scopetest/scope /dependency +dependency +groupIdorg.apache.aries.blueprint/groupId +artifactIdorg.apache.aries.blueprint/artifactId +/dependency +dependency +groupIdorg.apache.felix/groupId +artifactIdorg.apache.felix.configadmin/artifactId +/dependency /dependencies Added: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java?rev=952570view=auto == --- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java (added) +++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java Tue Jun 8 08:45:08 2010 @@ -0,0 +1,147 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.itest.osgi.blueprint; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Dictionary; +import java.util.Enumeration; + +import org.apache.camel.test.junit4.TestSupport; +import org.ops4j.pax.exam.CoreOptions; +import org.ops4j.pax.exam.Inject; +import org.ops4j.pax.exam.options.MavenArtifactProvisionOption; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.Constants; +import org.osgi.framework.Filter; +import org.osgi.framework.FrameworkUtil; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceReference; +import org.osgi.util.tracker.ServiceTracker; + +public abstract class AbstractIntegrationTest extends TestSupport { + +public static final long DEFAULT_TIMEOUT = 3; + +@Inject +protected BundleContext bundleContext; + +protected T T getOsgiService(ClassT type, long timeout) {
[CONF] Apache Camel Simple
Simple Page comment added by Tarjei Huse Minor nitpick: Most of the examples uses functions that need a static import, but the import is not very obvious. It would be nice to add the import to the first example like: # import operator import static org.apache.camel.language.simple.SimpleLanguage.simple; Change Notification Preferences View Online | Reply To This
svn commit: r952640 - in /camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi: OsgiComponentResolver.java OsgiFactoryFinder.java OsgiTypeConverter.java
Author: ningjiang Date: Tue Jun 8 12:47:41 2010 New Revision: 952640 URL: http://svn.apache.org/viewvc?rev=952640view=rev Log: Fixed the IDE warning of camel-core-osgi Modified: camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiComponentResolver.java camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiFactoryFinder.java camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiTypeConverter.java Modified: camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiComponentResolver.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiComponentResolver.java?rev=952640r1=952639r2=952640view=diff == --- camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiComponentResolver.java (original) +++ camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiComponentResolver.java Tue Jun 8 12:47:41 2010 @@ -36,8 +36,7 @@ public class OsgiComponentResolver imple public OsgiComponentResolver(BundleContext bundleContext) { this.bundleContext = bundleContext; } - -@SuppressWarnings(unchecked) + public Component resolveComponent(String name, CamelContext context) throws Exception { Object bean = null; try { Modified: camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiFactoryFinder.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiFactoryFinder.java?rev=952640r1=952639r2=952640view=diff == --- camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiFactoryFinder.java (original) +++ camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiFactoryFinder.java Tue Jun 8 12:47:41 2010 @@ -40,11 +40,6 @@ public class OsgiFactoryFinder extends D this.bundle = bundleContext.getBundle(); } -private class BundleEntry { -URL url; -Bundle bundle; -} - @Override public Class? findClass(String key, String propertyPrefix) throws ClassNotFoundException, IOException { if (propertyPrefix == null) { Modified: camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiTypeConverter.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiTypeConverter.java?rev=952640r1=952639r2=952640view=diff == --- camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiTypeConverter.java (original) +++ camel/trunk/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiTypeConverter.java Tue Jun 8 12:47:41 2010 @@ -96,7 +96,9 @@ public class OsgiTypeConverter extends S public DefaultTypeConverter getRegistry() { if (registry == null) { synchronized (this) { -if (registry == null) { +if (registry != null) { +return registry; +} else { registry = createRegistry(); } }
svn commit: r952644 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/ main/java/org/apache/camel/impl/ main/java/org/apache/camel/management/mbean/ main/java/org/apache/camel/util/ test/ja
Author: davsclaus Date: Tue Jun 8 13:16:05 2010 New Revision: 952644 URL: http://svn.apache.org/viewvc?rev=952644view=rev Log: CAMEL-2628: Uptime is now logged when stopping Camel and avail in JMX as well. Added: camel/trunk/camel-core/src/main/java/org/apache/camel/util/TimeUtils.java (with props) 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/management/mbean/ManagedCamelContext.java camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.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=952644r1=952643r2=952644view=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 Tue Jun 8 13:16:05 2010 @@ -74,6 +74,13 @@ public interface CamelContext extends Se */ ServiceStatus getStatus(); +/** + * Gets the uptime in a human readable format + * + * @return the uptime in days/hours/minutes + */ +String getUptime(); + // Service Methods //--- 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=952644r1=952643r2=952644view=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 Tue Jun 8 13:16:05 2010 @@ -19,13 +19,13 @@ package org.apache.camel.impl; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.TreeMap; -import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -97,6 +97,7 @@ import org.apache.camel.util.ObjectHelpe import org.apache.camel.util.ReflectionInjector; import org.apache.camel.util.ServiceHelper; import org.apache.camel.util.StopWatch; +import org.apache.camel.util.TimeUtils; import org.apache.camel.util.URISupport; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -163,6 +164,7 @@ public class DefaultCamelContext extends private ShutdownRunningTask shutdownRunningTask = ShutdownRunningTask.CompleteCurrentTaskOnly; private ExecutorServiceStrategy executorServiceStrategy = new DefaultExecutorServiceStrategy(this); private final StopWatch stopWatch = new StopWatch(false); +private Date startDate; public DefaultCamelContext() { super(); @@ -899,6 +901,15 @@ public class DefaultCamelContext extends return producerServicePool; } +public String getUptime() { +// compute and log uptime +if (startDate == null) { +return not started; +} +long delta = new Date().getTime() - startDate.getTime(); +return TimeUtils.printDuration(delta); +} + public void start() throws Exception { boolean doNotStart = !firstStartDone !isAutoStartup(); firstStartDone = true; @@ -1030,6 +1041,7 @@ public class DefaultCamelContext extends // --- protected synchronized void doStart() throws Exception { +startDate = new Date(); stopWatch.restart(); LOG.info(Apache Camel + getVersion() + (CamelContext: + getName() + ) is starting); @@ -1153,6 +1165,10 @@ public class DefaultCamelContext extends // shutdown management as the last one shutdownServices(managementStrategy); +LOG.info(Uptime: + getUptime()); +// and clear start date +startDate = null; + LOG.info(Apache Camel + getVersion() + (CamelContext: + getName() + ) is shutdown in + stopWatch.stop() + millis); } Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java?rev=952644r1=952643r2=952644view=diff
[CONF] Apache Camel Download
Download Page edited by Hadrian Zbarcea Changes (5) ... |Windows Distribution| [apache-camel-2.3.0.zip|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.3.0/apache-camel-2.3.0.zip]| [apache-camel-2.3.0.zip.asc|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.3.0/apache-camel-2.3.0.zip.asc]| |Unix/Linux/Cygwin Distribution| [apache-camel-2.3.0.tar.gz|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.3.0/apache-camel-2.3.0.tar.gz]| [apache-camel-2.3.0.tar.gz.asc|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.3.0/apache-camel-2.3.0.tar.gz.asc]| |Windows Distribution (1.x branch)| [apache-camel-1.6.2.zip|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/1.6.2/apache-camel-1.6.2.zip]| [apache-camel-1.6.2.zip.asc|http://www.apache.org/dist/camel/apache-camel/1.6.2/apache-camel-1.6.2.zip.asc]| |Unix/Linux/Cygwin Distribution (1.x branch)| [apache-camel-1.6.2.tar.gz|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/1.6.2/apache-camel-1.6.2.tar.gz]| [apache-camel-1.6.2.tar.gz.asc|http://www.apache.org/dist/camel/apache-camel/1.6.2/apache-camel-1.6.2.tar.gz.asc]| |Windows Distribution (1.x branch)| [apache-camel-1.6.3.zip|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/1.6.3/apache-camel-1.6.3.zip]| [apache-camel-1.6.3.zip.asc|http://www.apache.org/dist/camel/apache-camel/1.6.3/apache-camel-1.6.3.zip.asc]| |Unix/Linux/Cygwin Distribution (1.x branch)| [apache-camel-1.6.3.tar.gz|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/1.6.3/apache-camel-1.6.3.tar.gz]| [apache-camel-1.6.3.tar.gz.asc|http://www.apache.org/dist/camel/apache-camel/1.6.3/apache-camel-1.6.3.tar.gz.asc]| h3. Source Distribution ... |Source for Windows| [apache-camel-2.3.0-src.zip|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.3.0/apache-camel-2.3.0-src.zip]| [apache-camel-2.3.0-src.zip.asc|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.3.0/apache-camel-2.3.0-src.zip.asc]| |Source for Unix/Linux/Cygwin| [apache-camel-2.3.0-src.tar.gz|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.3.0/apache-camel-2.3.0-src.tar.gz]| [apache-camel-2.3.0-src.tar.gz.asc|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.3.0/apache-camel-2.3.0-src.tar.gz.asc]| |Source for Windows (1.x branch)| [apache-camel-1.6.2-src.zip|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/1.6.2/apache-camel-1.6.2-src.zip]| [apache-camel-1.6.2-src.zip.asc|http://www.apache.org/dist/camel/apache-camel/1.6.2/apache-camel-1.6.2-src.zip.asc]| |Source for Unix/Linux/Cygwin (1.x branch)| [apache-camel-1.6.2-src.tar.gz|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/1.6.2/apache-camel-1.6.2-src.tar.gz]| [apache-camel-1.6.2-src.tar.gz.asc|http://www.apache.org/dist/camel/apache-camel/1.6.2/apache-camel-1.6.2-src.tar.gz.asc]| |Source for Windows (1.x branch)| [apache-camel-1.6.3-src.zip|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/1.6.3/apache-camel-1.6.3-src.zip]| [apache-camel-1.6.3-src.zip.asc|http://www.apache.org/dist/camel/apache-camel/1.6.3/apache-camel-1.6.3-src.zip.asc]| |Source for Unix/Linux/Cygwin (1.x branch)| [apache-camel-1.6.3-src.tar.gz|http://www.apache.org/dyn/closer.cgi/camel/apache-camel/1.6.3/apache-camel-1.6.3-src.tar.gz]| [apache-camel-1.6.3-src.tar.gz.asc|http://www.apache.org/dist/camel/apache-camel/1.6.3/apache-camel-1.6.3-src.tar.gz.asc]| h3. Keys ... || Version || | [Download Apache Camel 1.6.3-SNAPSHOT|https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/1.6.3-SNAPSHOT/] 1.6.4-SNAPSHOT|https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/1.6.4-SNAPSHOT/] | | [Download Apache Camel 2.4-SNAPSHOT|https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/2.4-SNAPSHOT/] | ... Full Content Latest Releases Grab these releases while they are hot! The latest release is Camel 2.3.0 Release. Camel 2.3.0 ReleaseCamel 2.2.0 ReleaseCamel 1.6.2 ReleaseCamel 2.1.0 ReleaseCamel 2.0-M3 ReleaseCamel 2.0-M2 ReleaseCamel 1.6.1 ReleaseCamel 2.0-M1 ReleaseCamel 2.0.0 ReleaseCamel 1.6.0 ReleaseCamel 1.5.0 ReleaseCamel 1.4.0 ReleaseCamel 1.3.0 ReleaseCamel 1.2.0 ReleaseCamel 1.1.0 ReleaseCamel 1.0.0 Release Getting the latest distributions The URLs below 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 Mozilla Firefox Binary Distribution
[CONF] Apache Camel Scripting Languages Context
Scripting Languages Context Page edited by willem jiang Changes (1) ... || Attribute || Type || Value || | camelContext | {{org.apache.camel.CamelContext}} | The Camel Context | | exchange | {{org.apache.camel.Exchange}} | The current Exchange | | request | {{org.apache.camel.Message}} | The IN message | ... Full Content ScriptContext The JSR-223 scripting languages ScriptContext is pre configured with the following attributes all set at ENGINE_SCOPE: Attribute Type Value camelContext org.apache.camel.CamelContext The Camel Context exchange org.apache.camel.Exchange The current Exchange request org.apache.camel.Message The IN message response org.apache.camel.Message The OUT message Attributes You can add your own attributes with the attribute(name, value) DSL method, such as: In the sample below we add an attribute user that is an object we already have instantiated as myUser. This object has a getFirstName() method that we want to set as header on the message. We use the groovy language to concat the first and last name into a single string that is returned. from("direct:in").setHeader("name").groovy("'$user.firstName $user.lastName'").attribute("user", myUser").to("seda:users"); Any scripting language Camel can run any JSR-223 scripting languages using the script DSL method such as: from("direct:in").setHeader("firstName").script("jaskel", "user.firstName").attribute("user", myUser").to("seda:users"); This is a bit different using the Spring DSL where you use the _expression_ element that doesn't support setting attributes (yet): from uri="direct:in"/ setHeader headerName="firstName" _expression_ language="jaskel"user.firstName/_expression_ /setHeader to uri="seda:users"/ Dependencies To use scripting languages in your camel routes you need to add the a dependency on camel-script which integrates the JSR-223 scripting engine. If you use maven you could just add the following to your pom.xml, substituting the version number for the latest greatest release (see the download page for the latest versions). dependency groupIdorg.apache.camel/groupId artifactIdcamel-script/artifactId version1.4.0/version /dependency Change Notification Preferences View Online | View Changes | Add Comment
svn commit: r952896 - in /camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4: HttpNoConnectionTest.java HttpSOTimeoutTest.java HttpThrowExceptionOnFailureTest.java
Author: davsclaus Date: Wed Jun 9 04:09:18 2010 New Revision: 952896 URL: http://svn.apache.org/viewvc?rev=952896view=rev Log: CAMEL-2795: Fixed tests Modified: camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpNoConnectionTest.java camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpSOTimeoutTest.java camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpThrowExceptionOnFailureTest.java Modified: camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpNoConnectionTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpNoConnectionTest.java?rev=952896r1=952895r2=952896view=diff == --- camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpNoConnectionTest.java (original) +++ camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpNoConnectionTest.java Wed Jun 9 04:09:18 2010 @@ -20,7 +20,6 @@ import java.net.ConnectException; import org.apache.camel.Exchange; import org.apache.camel.Processor; -import org.apache.camel.RuntimeCamelException; import org.apache.camel.component.http4.handler.BasicValidationHandler; import org.apache.http.conn.HttpHostConnectException; import org.apache.http.localserver.LocalTestServer; @@ -47,13 +46,11 @@ public class HttpNoConnectionTest extend // stop server so there are no connection localServer.stop(); -try { -template.request(url, null); -fail(Should have thrown an exception); -} catch (RuntimeCamelException e) { -HttpHostConnectException cause = assertIsInstanceOf(HttpHostConnectException.class, e.getCause()); -assertIsInstanceOf(ConnectException.class, cause.getCause()); -} +Exchange reply = template.request(url, null); +Exception e = reply.getException(); +assertNotNull(Should have thrown an exception, e); +HttpHostConnectException cause = assertIsInstanceOf(HttpHostConnectException.class, e); +assertIsInstanceOf(ConnectException.class, cause.getCause()); } @Override Modified: camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpSOTimeoutTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpSOTimeoutTest.java?rev=952896r1=952895r2=952896view=diff == --- camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpSOTimeoutTest.java (original) +++ camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpSOTimeoutTest.java Wed Jun 9 04:09:18 2010 @@ -18,7 +18,6 @@ package org.apache.camel.component.http4 import org.apache.camel.Exchange; import org.apache.camel.Processor; -import org.apache.camel.RuntimeCamelException; import org.apache.camel.component.http4.handler.DelayValidationHandler; import org.apache.http.localserver.LocalTestServer; import org.junit.Test; @@ -41,15 +40,12 @@ public class HttpSOTimeoutTest extends B @Test public void httpGetShouldThrowASocketTimeoutException() throws Exception { -try { -template.request(http4:// + getHostName() + : + getPort() + ?httpClient.soTimeout=1000, new Processor() { -public void process(Exchange exchange) throws Exception { -} -}); -fail(Should throw a RuntimeCamelException); -} catch (RuntimeCamelException e) { -// expected -} +Exchange reply = template.request(http4:// + getHostName() + : + getPort() + ?httpClient.soTimeout=1000, new Processor() { +public void process(Exchange exchange) throws Exception { +} +}); +Exception e = reply.getException(); +assertNotNull(Should have thrown an exception, e); } @Override Modified: camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpThrowExceptionOnFailureTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpThrowExceptionOnFailureTest.java?rev=952896r1=952895r2=952896view=diff == --- camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpThrowExceptionOnFailureTest.java (original) +++ camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpThrowExceptionOnFailureTest.java Wed Jun 9 04:09:18 2010 @@ -21,7 +21,6 @@ import java.util.Map; import org.apache.camel.Exchange; import
[CONF] Apache Camel Articles
Articles Page edited by Claus Ibsen Changes (1) ... * [Camel + Smooks|http://blog.smooks.org/2010/02/22/apache-camel-smooks/] from the official Smooks blog about Smooks integration Camel out of the box. * [Hiding The Middleware from Your Domain Code With Camel|http://jnb.ociweb.com/jnb/jnbMar2010.html] by James Carr. Article which was Java Technical Insights of the Month. * [Using Apache Camel from Clojure|http://codeabout.blogspot.com/2010/06/using-apache-camel-from-clojure.html] by Jason Whitlark. A blog entry how to get Camel working with the [Clojure|http://clojure.org/] programming language. h2. Webinar or Video presentations on Camel ... Full Content See alsoSee also Camel User Stories. Articles on Apache Camel A bit more meat: Camel applied : JMS to File by Mike McLean Mathew Thomas posted his thoughts on Apache Camel including a sample project Matteo wrote a blog entry about using Camel with iBatis Knowledge Tree integration using Apache Camel Integrating Apache Camel with JBoss ESB by Edgar Ankiewsky Simple DSL OSGi bundle example by Andrej Koelewijn Realization of EAI Patterns with Apache Camel by Pascal Kolb at the Universität Stuttgart Using Camel with Maven to access web services and message queues by Glen Mazza Spring Remoting with JMS Example on Amin Abbaspour's Weblog Implementing Enterprise Integration Patterns with Apache Camel presentation by Eduard Hildebrandt. Very nice power point presentation. Implementing Fuji integration scenario using Camel SE by Louis Polycarpou on using Camel with Open ESB Using the Camel aggregator correctly by Torsten Mielke, a great blog entry how to use the Camel aggregator. Camel routes and HL7 by Roger Searjeant on using Camel and its HL7 support in the health care space. Combining ApacheCamel+BSF to make JBoss ESB polyglot by Edgard Ankiewsky Silva, a JBoss employeer. Groovy and Grape - easiest way to send gtalk message with Apache Camel by Andrej Koelewijn how easy it is to use Groovy and Grape to quickly try out new frameworks such as Apache Camel. Domain-Specific Languages (DSLs) in Apache Camel (Spanish) by Gema Perdiguero, Tecsisa. Apache Camel integration in ServiceMix (Spanish) by Sebastián Gómez, Tecsisa. Apache Camel: Integration Nirvana by Jonathan Anstey Great for learning what Camel is and what it can do Leverage EIP with Apache Camel and Twitter by Bruno Borges Apache Camel Reference Card at DZone (the first card out of two) by Claus Ibsen Using RSS with Apache Camel by Jeroen Reijn Using Groovy and Camel to pool Google Analyst email reports by Mr. Haki Using grails-camel plugin to work with Camel in Grails land by Mr. Haki Send mail with Apache Camel from Gails by Mr. Haki Navigating the Integration Landscape - Claus Ibsen on Apache Camel Claus Ibsen was interviewed at DZone discussing the integration landscape Apache Camel: Enterprise Integration met scripttalen en DSLs (Dutch) by Peter Maas, Finalist IT Group. Axis 2 ride with Camel how to use Axis 2 with the Camel report incident tutorial by Sagara Introduction to the Open eHealth Integration Platform (based on top of Apache Camel) Excellent DZone article by Martin Krasser An IRC alerter written using Apache Camel and Java how to easily integrate IRC with Camel to monitor and do alerts. Entreprise Integration Pattern with Apache Camel 2.0 by Julien Dechmann, how to use Camel to split and transform CSV files to POJO and XML and sending to a JMS destination A Camel based XML payload HTTP polling provider by Christopher Hunt to use Camel with AJAX. Interesting read. Camel vs. JBI by Adrian Trenaman. Things to consider when selecting between Apache Camel and Apache Servicemix by Ashwin Karpe Dead Simple Integration with Apache Camel presentation by Aaron Mulder from Chariot Solutions. Groovy and Camel for monitoring ActiveMQ by Eric Hauser how to monitor AMQ Advisory queues from a single groovy file. Camellos - Discovering Apache Camel by Gunnar Hillert. A very nice and short blog series about Camel showing its powers in a simple and intuitive way. Highly recommended for new users Apache Camel alternatives by Gunnar Hillert. He presents a brief overview of other projects in the integration space. First steps with Apache Camel on Google App Engine by Martin Krasser posts his findings to get Camel running on the GAE. A jira notification system for irc using Camel by Guillaume Nodet - all code is in a single XML hot deployed in Apache Karaf. Camel, CXF and JMS by Example by Silvester van der Bijl. Good blog entry how to use CXF and Camel together. A simple file monitoring console with camel, cometd and jquery by Andrej Koelewijn. Shows how to use Camel to monitor log files and push lines changed using
[CONF] Apache Camel Scripting Languages Context
Scripting Languages Context Page edited by willem jiang Changes (1) ... || Attribute || Type || Value || | camelContext | {{org.apache.camel.CamelContext}} | The Camel Context | | exchange | {{org.apache.camel.Exchange}} | The current Exchange | | request | {{org.apache.camel.Message}} | The IN message | ... Full Content ScriptContext The JSR-223 scripting languages ScriptContext is pre configured with the following attributes all set at ENGINE_SCOPE: Attribute Type Value context org.apache.camel.CamelContext The Camel Context exchange org.apache.camel.Exchange The current Exchange request org.apache.camel.Message The IN message response org.apache.camel.Message The OUT message Attributes You can add your own attributes with the attribute(name, value) DSL method, such as: In the sample below we add an attribute user that is an object we already have instantiated as myUser. This object has a getFirstName() method that we want to set as header on the message. We use the groovy language to concat the first and last name into a single string that is returned. from("direct:in").setHeader("name").groovy("'$user.firstName $user.lastName'").attribute("user", myUser).to("seda:users"); Any scripting language Camel can run any JSR-223 scripting languages using the script DSL method such as: from("direct:in").setHeader("firstName").script("jaskel", "user.firstName").attribute("user", myUser).to("seda:users"); This is a bit different using the Spring DSL where you use the _expression_ element that doesn't support setting attributes (yet): from uri="direct:in"/ setHeader headerName="firstName" _expression_ language="jaskel"user.firstName/_expression_ /setHeader to uri="seda:users"/ Dependencies To use scripting languages in your camel routes you need to add the a dependency on camel-script which integrates the JSR-223 scripting engine. If you use maven you could just add the following to your pom.xml, substituting the version number for the latest greatest release (see the download page for the latest versions). dependency groupIdorg.apache.camel/groupId artifactIdcamel-script/artifactId version1.4.0/version /dependency Change Notification Preferences View Online | View Changes | Add Comment
svn commit: r952904 - in /camel/trunk/camel-core/src/main/java/org/apache/camel/impl: DefaultCamelContext.java converter/DefaultTypeConverter.java
Author: davsclaus Date: Wed Jun 9 05:10:38 2010 New Revision: 952904 URL: http://svn.apache.org/viewvc?rev=952904view=rev Log: CAMEL-2628: Output duration in more human reable format for time taken to start/stop Camel. Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.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=952904r1=952903r2=952904view=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 Jun 9 05:10:38 2010 @@ -1031,9 +1031,11 @@ public class DefaultCamelContext extends } } -LOG.info(Started + getRoutes().size() + routes); - -LOG.info(Apache Camel + getVersion() + (CamelContext: + getName() + ) started in + stopWatch.stop() + millis); +stopWatch.stop(); +if (LOG.isInfoEnabled()) { +LOG.info(Started + getRoutes().size() + routes); +LOG.info(Apache Camel + getVersion() + (CamelContext: + getName() + ) started in + TimeUtils.printDuration(stopWatch.taken())); +} EventHelper.notifyCamelContextStarted(this); } @@ -1165,11 +1167,14 @@ public class DefaultCamelContext extends // shutdown management as the last one shutdownServices(managementStrategy); -LOG.info(Uptime: + getUptime()); +stopWatch.stop(); +if (LOG.isInfoEnabled()) { +LOG.info(Uptime: + getUptime()); +LOG.info(Apache Camel + getVersion() + (CamelContext: + getName() + ) is shutdown in + TimeUtils.printDuration(stopWatch.taken())); +} + // and clear start date startDate = null; - -LOG.info(Apache Camel + getVersion() + (CamelContext: + getName() + ) is shutdown in + stopWatch.stop() + millis); } private void shutdownServices(Object service) { Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java?rev=952904r1=952903r2=952904view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java Wed Jun 9 05:10:38 2010 @@ -39,6 +39,7 @@ import org.apache.camel.spi.TypeConverte import org.apache.camel.spi.TypeConverterRegistry; import org.apache.camel.util.ObjectHelper; import org.apache.camel.util.StopWatch; +import org.apache.camel.util.TimeUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -387,7 +388,9 @@ public class DefaultTypeConverter extend LOG.debug(Loading type converters done); // report how long time it took to load -LOG.info(Loaded + typeMappings.size() + type converters in + watch.stop() + millis); +if (LOG.isInfoEnabled()) { +LOG.info(Loaded + typeMappings.size() + type converters in + TimeUtils.printDuration(watch.stop())); +} } protected void loadFallbackTypeConverters() throws IOException, ClassNotFoundException {