This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB Runtime Configuration

 
Dan Fow
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a newbie to JEE and I'm using an EJB to start a bean that calls a URL, I need some way of configuring that url at runtime.

If I was using spring I would just make the URL a constructor argument and initialize the bean in xml. However, I am using JEE.

Can someone tell me the proper way to make a bean have a configurable value in JEE 6?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could read the value from somewhere.
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You can use environment entries.
They can be declared using <env-entry> element in ejb-jar.xml.

With EJB 3.0 you can inject them in the bean as you do in the Spring.



regds,
Amit

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic