You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2009/04/03 12:30:34 UTC

[jira] Resolved: (CAMEL-1515) Add isStratingFinished() method to the ServiceSupport class

     [ https://issues.apache.org/activemq/browse/CAMEL-1515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CAMEL-1515.
---------------------------------

    Resolution: Fixed

trunk
http://svn.apache.org/viewvc?rev=761583&view=rev
camel 1.x
http://svn.apache.org/viewvc?rev=761590&view=rev

> Add isStratingFinished() method to the ServiceSupport class
> -----------------------------------------------------------
>
>                 Key: CAMEL-1515
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1515
>             Project: Apache Camel
>          Issue Type: Improvement
>            Reporter: Willem Jiang
>            Assignee: Willem Jiang
>             Fix For: 2.0.0, 1.6.1
>
>
> Just found the the isStarted() is used for starting the components in CamelContext  when the CamelContext is starting,  
> The change of isStarted() recently  will broke below code.
> {code}
>  public boolean isStarted() {
>         return started.get()&&!starting.get();
>   }
> {code}
> {code}
> public Component getComponent(String name) {
>         // synchronize the look up and auto create so that 2 threads can't
>         // concurrently auto create the same component.
>         synchronized (components) {
>             Component component = components.get(name);
>             if (component == null && autoCreateComponents) {
>                 try {
>                     component = getComponentResolver().resolveComponent(name, this);
>                     if (component != null) {
>                         addComponent(name, component);
>                         if (isStarted()) {                            
>                             // If the component is looked up after the context is started,
>                             // lets start it up.
>                             startServices(component);
>                         }
>                     }
>                 } catch (Exception e) {
>                     throw new RuntimeCamelException("Could not auto create component: " + name, e);
>                 }
>             }
>             return component;
>         }
>     }
> {code}
> so I want to add isStratingFinished() method to check if the starting process is finished.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.