This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What order will multiple @Startup beans be started in?

 
Michael Remijan
Author
Ranch Hand
Posts: 128
5
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using GlassFish 3.1.1 and EE 6. This seems like a common question but I haven't found a great answer yet. If my EJB JAR file contains multiple beans annotated as @Startup, is it possible to configure the order in which they are started? My guess is that if order is important, then I should just have 1 @Startup bean and make sure it does things in the order I want? Optionally, I know about <initialize-in-order> for the application.xml so I suppose I could create multiple JAR files and make sure the JAR files are configured in application.xml in order. Is there any other option? For example, is there another annotation which can be used in conbination with @Startup which will affect the order in which the container creates the beans?
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you ordering of @Startup @Singleton beans to be controlled then you have you use the @DependsOn annotation which takes the names of the other singleton beans on which this bean depends (in terms of ordering).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic