Several ejbs in ears need to access an URL.
I do not want to hardcode the URL, nor do I want to write it into the ejb deployment descriptor. In practice ejb-jar.xml is as hard to change as source code, because you have to rebuild the ear. And, ejb-jar.xml is in source control, and I don't want to have concrete host names in source control.
Anyway, I don't want to change five ears because a URL changes.
First idea is to use a property file and put it in the server classpath. Not very elegant.
Second idea is to read it from JNDI. But how to get it there? From an XML file parsed by a server startup class? What if the option can be changed at server runtime?
Next idea is to get the option from JMX and put it from there into JNDI. But how? How is the data specified and read in?
Or is there a portable way to access JMX from the bean code?
Thanks,
Juergen
-
Global Options (1 messages)
- Posted by: Juergen Weber
- Posted on: August 14 2003 08:40 EDT
Threaded Messages (1)
- Global Options by Brian Tinnel on August 19 2003 17:18 EDT
-
Global Options[ Go to top ]
- Posted by: Brian Tinnel
- Posted on: August 19 2003 17:18 EDT
- in response to Juergen Weber
How about a Session Bean? The URL can be stored in a configration table in your database and you just access it like normal. If you need something that can be updated on the fly, the Session Bean could just be a facade for an Entity Bean.