Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-1515

Add isStratingFinished() method to the ServiceSupport class

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.6.1, 2.0-M2
    • None
    • None

    Description

      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.

       public boolean isStarted() {
              return started.get()&&!starting.get();
        }
      
      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;
              }
          }
      

      so I want to add isStratingFinished() method to check if the starting process is finished.

      Attachments

        Activity

          People

            njiang Willem Jiang
            njiang Willem Jiang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: