This is my interpretation also.
I have a more general question:
It seems environment entries are an alternative ("the" intended
alternative?) to property files. When are environment entries the most
appropriate way to specify parameters, and when are property files the most
appropriate way?
Off the top of my head:
** Environment entries might be more appropriate foe bean-specific
parameters.
** Property files might be more appropriate for global parameters. (Are
there scenarios where there is a legitimate need for global parameters???
Seems to violate the principle of encapsulation.)
** Property files might be necessary if you are using a legacy class library
that uses property files.
A possible downfall of property files/using the classloader is that the case
where two independently developed beans each use a property file, and the
two property files have the same name. The one that is loaded in each case
depends on how classloading is implemented in the app server. (For example,
in WebSphere 4.0, you can choose to have one classloader for each module,
one classloader for each application, or one classloader for all
applications. There would be no problem with the first option, but there
could be problems with the second and third options.)
Anyway, I am interested in finding out when others use environment entries
versus property files.
Laurel
-----Original Message-----
From: Johan Eltes [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 28, 2001 3:42 AM
To: [EMAIL PROTECTED]
Subject: Using classloader to load files from EJB jar (was: "Environment
Variables")
I should be ok to load files in the EJB Jar through the class loader,
shouldn't it?
Otherwise it would be hard to do localization and other tasks that are
supported by property-files and other representations of localized
resources?
My interpretation of the file io restriction stated in the spec, is that you
shouldn't do file io by referencing the file system.
This has been on the agenda in many threads....
/Johan
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Rajan
Sent: den 28 september 2001 06:47
To: [EMAIL PROTECTED]
Subject: Re: Environment Variables
I have been doing the same thing using startup classes.
Load the properties file in startup class and keep in memory.
As almost every server supports startup classes so there will be no issues
while porting.
-----Original Message-----
From: John Harby [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 27, 2001 10:04 PM
To: [EMAIL PROTECTED]
Subject: Re: Environment Variables
The danger of doing this sort of thing though is that although
your container may allow you to do it today, it may (and probably
should) not allow you to do it tommorow. Thus, you risk having to
rewrite your code when your container vendor puts out a new release.
>From: "Peter J. Braswell" <[EMAIL PROTECTED]>
>Reply-To: "Peter J. Braswell" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: Environment Variables
>Date: Thu, 27 Sep 2001 10:39:52 -0400
>
>Steve,
>I usually use a property file to set runtime parameters and the
>loadAsResource method call to read the file. People will yell as soon as
>they read this post and point to not doing file i/o in ejbs as per the
>spec,
>but I've done it on numerous containers with no problem. I usually use a
>property factory to ensure the file is read and properties initialized only
>once... It works well, clean, simple, etc....
>
>If you want code, let me know. I'll send it to you off line.
>
>cheers,
>peter
>
>-----Original Message-----
>From: A mailing list for Enterprise JavaBeans development
>[mailto:[EMAIL PROTECTED]]On Behalf Of Steve Brown
>Sent: Thursday, September 27, 2001 8:10 AM
>To: [EMAIL PROTECTED]
>Subject: Environment Variables
>
>
>Hi,
>
>I would like to set an environment variable for my EJB container that all
>EJBs can access. I can see how you set <env-entry>'s for individual beans,
>but how do you set an environment variable that ALL server side components
>within the EJB container can read? We are using Weblogic 6.0.
>
>Thanks,
>
>Steve.
>
>===========================================================================
>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".
>
>===========================================================================
>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".
>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
===========================================================================
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".
===========================================================================
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".
===========================================================================
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".
===========================================================================
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".