Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 11335 invoked from network); 2 Apr 2009 07:26:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Apr 2009 07:26:39 -0000 Received: (qmail 89561 invoked by uid 500); 2 Apr 2009 07:26:24 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 89229 invoked by uid 500); 2 Apr 2009 07:26:23 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 88551 invoked by uid 500); 2 Apr 2009 07:26:21 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 88230 invoked by uid 99); 2 Apr 2009 07:21:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 07:21:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 07:21:55 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id ED7CF234C051 for ; Thu, 2 Apr 2009 00:21:34 -0700 (PDT) Message-ID: <1734710132.1238656894971.JavaMail.jira@brutus> Date: Thu, 2 Apr 2009 00:21:34 -0700 (PDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-1509) DefaultCamelContext.isStarting returns incorrect status In-Reply-To: <1169541449.1238606014684.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-1509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50987#action_50987 ] Claus Ibsen commented on CAMEL-1509: ------------------------------------ Yeah the logic is a bit special I guess it needs to be set as Started before starting all its child services. I am just guessing here. James S. might remember. However it could be that the isStarting method could be changed to: public boolean isStarted() { return started.get() && !starting.get(); } Then it will only return true when the starting is complete. > DefaultCamelContext.isStarting returns incorrect status > ------------------------------------------------------- > > Key: CAMEL-1509 > URL: https://issues.apache.org/activemq/browse/CAMEL-1509 > Project: Apache Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 1.6.0, 2.0-M1 > Reporter: Alexander Kleymenov > Assignee: Willem Jiang > > DefaultCamelContext.isStarting returns true while it actually not started. > So the following groovy test case fails: > {code:title=test.groovy} > import org.apache.camel.impl.DefaultCamelContext; > import org.apache.camel.language.groovy.GroovyRouteBuilder; > class Foo { > def name > def data > void run(data) { > println "[${name}] got ${data}" > this.data = data > } > } > public class MyRoute extends GroovyRouteBuilder { > def bean = new Foo(name: "bean") > protected void configure() { > from("direct:start").bean(bean, "run") > } > } > camelCtx = new DefaultCamelContext() > route = new MyRoute() > camelCtx.addRoutes(route); > Thread.start { > camelCtx.start(); > } > while (camelCtx.isStarting()) { > Thread.sleep(1000) > } > camelCtx.createProducerTemplate().sendBody("direct:start", "data") > if (!route.bean.data) { > println "FAILED: no data has been received!" > } else { > println "PASSED" > } > camelCtx.stop(); > {code} > Note, after moving of > {code} > camelCtx.addRoutes(route) > {code} > after > {code} > Thread.start { > camelCtx.start(); > } > {code} > the test passes. > Also the program does not finish after camelCtx.stop(); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.