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

Jonathan Gallimore moved OPENEJB-910 to OEP-15:
-----------------------------------------------

    Component/s:     (was: eclipse)
            Key: OEP-15  (was: OPENEJB-910)
        Project: OpenEJB Eclipse Plugin  (was: OpenEJB)

> Support to add @DependsOn automatically
> ---------------------------------------
>
>                 Key: OEP-15
>                 URL: https://issues.apache.org/jira/browse/OEP-15
>             Project: OpenEJB Eclipse Plugin
>          Issue Type: New Feature
>            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