On Wed, 6 Sep 2000 13:08:24 +0530, Shiv Kumar <[EMAIL PROTECTED]>
wrote:
>I have considered using property resource bundles for storing
>configuration information, messages (for internationalization) etc for
>by EJB based application. I am aware that EJB spec restricts direct file
>I/O. But I assume ResourceBundle.getBundle() can be used from within an
>EJB. (But, the ResourceBundle class or one of its subclass will do file
>I/O).

If you look in the archives you will find a thread saying that using
ResourceBundle to access properties file from an EJB works. And it does.
The thread also explains *why* it works. (HINT: ResourceBundle is not a
part of the EJB, and it uses doPrivileged appropriately).

>I have already seen discussions about this topic on this list. I think
>the discussion ended by saying, "Yes. EJBs can use ResourceBundle to
>access properties file". But this article from JavaWorld specifically
>mentions that EJBs should not use file system based property files
>(Restrictions on EJB components, point 4) -
>http://www.javaworld.com/javaworld/jw-08-2000/jw-0825-ejbrestrict.html.
>
>What do you think the author is trying to convey?

That beans are not allowed to do certain things. If a bean uses code
that is considered system code, the system code may of course do
whatever it wants.

>Let me for now assume that property resource bundles are allowed from within
>EJBs. If the EJBs are deployed on different machines,
>care should be taken to appropriately duplicate the property files
>on all the machines.

Correct.

> If a particular value should be changed, the property
>files on all the machines, where the EJB is deployed, should also be changed.
>I think it is going to be a deployment nightmare. Instead if we can have
>the configurable properties in a database table would that make sense? Or
>how about having custom properties in JNDI tree? (I dont know which Service
>Provider should be used in this case)

The easiest way to solve this (IMHO) is to set up a mini-webserver that
you can load the properties file from, and then add that webserver root
to the classpath of the application server. So, if you change the
properties file on the server it will be "automatically" updated on all
nodes, since they all get it from the same place.

You can use my mini-webserver if you want to:
http://www.dreambean.com/dynaserver.html

/Rickard

--
Rickard �berg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to