Support to add @DependsOn automatically
---------------------------------------

                 Key: OPENEJB-910
                 URL: https://issues.apache.org/jira/browse/OPENEJB-910
             Project: OpenEJB
          Issue Type: New Feature
          Components: eclipse
            Reporter: Jonathan Gallimore
            Assignee: Jonathan Gallimore


Along those lines what would be really cool is if the tool could add the 
@DependsOn automatically for a user.

A singleton needs a @DependsOn declaration only when referring to (invoking) 
another singleton in either its @PostConstruct or @PreDestroy method.  I don't 
know if it's possible, but if there was some way spot that and add the 
@DependsOn for them, that'd be really cool.

As an example, the bean has this:

@Singleton
@Startup
public class RedBean {

  @EJB(beanName="BlueBean")
  private BlueLocal blue

  @PostConstruct
  public void startup() {

  }
}

and all is fine, but when they add this to the @PostConstruct method...

  @PostConstruct
  public void startup() {
      blue.doSomeWork();
  }

At that point you need to add the @DependsOn like so:

@Singleton
@Startup
@DependsOn("BlueBean")
public class RedBean {
   ...
}



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

Reply via email to