You can do this by using Ant to build/deploy - there
is an "Ant" target called <REPLACE> with can read a
value from a central properties file and then replace
that value in the deployment descriptor file (or in a
Java file for that matter).

Since this is really a deployment issue why not
incorporate it into the build/deployment process?

Here's the process:

- Create a properties file containing the values for
deployment on a particular machine.
- Use an Ant script to read the properties file and
perform <REPLACE>'s on the deployment descriptors to
populate them with the appropriate values for the
particular deployment you are building.
- Compile and build jar files (using Ant as well).
- Deploy the EJB's (another use for Ant!)

You now have jar files containing appropriate
descriptors for the target deployment platform. No
need to deploy any properties files.

That is - the properties file you create is used only
at build time, not at run time. At run time the values
are supplied via the deployment descriptors.

To do this right you should create these centralized
properties files for each target deployment platform.
Then maintain these different files in source control.

We set up the default properties file to be the one
that described our developer's desktop environments.
Since the developers do builds frequently it made
sense to have that be the default.

If you're not familiar with Ant - it's a build tool
similar to "make" that has been released a part of the
apache project. More info is at
http://jakarta.apache.org/ant/index.html


Anyone having more questions on this can contact me
directly or respond to the list...

Thanks!

Kevin


Kevin Bedell
http://www.kbedell.com





--- Charles Chan <[EMAIL PROTECTED]> wrote:
> I have a similar concern... My properties need to be
> modified by non-technical users and I don't want
> them
> to mess up my XML files.
>
> The option I choose is to violates the EJB rules and
> load the properties file manually.
>
> I hope there is a better way to do it. Maybe
> XInclude
> (an XML-related spec in development at W3C) would
> help
> us in the future.
>
> (actually, if you're using WebLogic, you can also
> add
> your properties to the weblogic.properties as java
> system properties. this way, you don't need to read
> a
> file in your ejb)
>
> hope it helps,
> Charles
>
> --- Andreetto Angelo <[EMAIL PROTECTED]>
> wrote:
> > .... why not to describe these propertyes in the
> > XMLDescriptor? So each time
> > this EJB rises up it loads them.
> >
> > -----Original Message-----
> > From: Wenhui Bai at YSD
> [mailto:[EMAIL PROTECTED]]
> > Sent: marted�, 24. luglio 2001 06:38
> > To: [EMAIL PROTECTED]
> > Subject: About property files
> >
> >
> > Hi all,
> >
> > Could anybody kindly give me a light?:-)
> >
> > May I bundle some property files with my ejbs, so
> I
> > can use them in my ejbs?
> > I know that it's not allowed to operate on file in
> > ejbs according EJB's
> > specification.
> >
> > Thanks in advance.
> > Wenhui
> >
> >
>
===========================================================================
> > 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".
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute
> with Yahoo! Messenger
> http://phonecard.yahoo.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".
>


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.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