Skip to main content

[ejb-spec issues] [JIRA] Commented: (EJB_SPEC-19) Decoupling the @Startup/@DependsOn annotations from the EJB component model

  • From: "reza_rahman (JIRA)" <jira-no-reply@...>
  • To: issues@...
  • Subject: [ejb-spec issues] [JIRA] Commented: (EJB_SPEC-19) Decoupling the @Startup/@DependsOn annotations from the EJB component model
  • Date: Sun, 6 Oct 2013 18:08:17 +0000 (UTC)
  • Auto-submitted: auto-generated


    [ 
https://java.net/jira/browse/EJB_SPEC-19?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=369345#action_369345
 ] 

reza_rahman commented on EJB_SPEC-19:
-------------------------------------

One logical place for decoupled @Startup/@DependsOn annotations could be the 
common annotations JSR.

> Decoupling the @Startup/@DependsOn annotations from the EJB component model
> ---------------------------------------------------------------------------
>
>                 Key: EJB_SPEC-19
>                 URL: https://java.net/jira/browse/EJB_SPEC-19
>             Project: ejb-spec
>          Issue Type: New Feature
>    Affects Versions: 3.2
>            Reporter: reza_rahman
>            Assignee: marina vatkina
>             Fix For: Future version
>
>
> Currently the EJB @Startup/@DependsOn annotations can only be used with 
> @Singleton beans. The @Startup/@DependsOn annotations are actually a very 
> useful and elegant way of declaratively listening to the container 
> life-cycle and managing component inter-dependency. With the introduction 
> of managed beans and CDI, there are not many good technical reasons why the 
> @Startup/@DependsOn annotations should not be used in managed beans as 
> well. Decoupling useful EJB services such as @Startup/@DependsOn from the 
> component model moves towards removing one-off component models in Java EE 
> in favor of unifying around managed beans/CDI.
> We currently allow this capability in Resin. The code looks like this:
> @ApplicationScoped
> @Startup
> @DependsOn(...)
> public class MyStartupBean {
> ...
> @PostConstruct
> public void init() { ... }
> ...
> @PreDestroy
> public void destroy() { ... }
> ...
> }
> It should also be possible to use @Startup/@DependsOn in CDI stereotypes so 
> that developers can compose custom component types to meet the needs of 
> their individual applications. The code for this could look like the 
> following:
> @ApplicationScoped
> @Stereotype
> @Retention(RUNTIME)
> @Target(TYPE)
> @Startup
> @DependsOn(...)
> public @interface StartupComponent {}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[ejb-spec issues] [JIRA] Commented: (EJB_SPEC-19) Decoupling the @Startup/@DependsOn annotations from the EJB component model

reza_rahman (JIRA) 10/06/2013
 
 
Close
loading
Please Confirm
Close