Or, if you use WebLogic, you can put global properties into the
weblogic.properties file.
>From: Jean-Baptiste Nizet <[EMAIL PROTECTED]>
>Reply-To: A mailing list for Enterprise JavaBeans development
><[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: XML Deployment descriptor. Global properties
>Date: Wed, 26 Jul 2000 15:56:36 +0200
>
>Kaj Bjurman wrote:
>
> > Hi all,
> >
> > Is there a way to put a global property in a deployment descriptor? (So
>it
> > can be used from JNDI by several EJBs).
> >
>
>If your properties are read-only, you could just write a stateless session
>bean
>which holds these shared properties in its environment. This bean could
>have
>these methods (where map is a HashMap):
>
>public Object getProperty(String name, Object defaultValue) {
> Object o = null;
> o = map.get(name);
> if (o == null) {
> try {
> o = env.lookup(name);
> if (o == null) {
> o = defaultValue;
> }
> else {
> map.put(name, o);
> }
> }
> catch (NamingException e) {
> o = defaultValue;
> }
> }
>
> return o;
> }
>
> public Object getProperty(String name) {
> return getProperty(name, null);
> }
>
>In your other beans, instead of getting the property from the java:comp/env
>context, you would call this session bean.
>
>JB.
>
><snipped>
>
>--
>Jean-Baptiste Nizet
>[EMAIL PROTECTED]
>
>R&D Engineer, S1 Belgium
>Kleine Kloosterstraat, 23
>B-1932 Sint-Stevens Woluwe
>+32 2 200 45 42
>
>===========================================================================
>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 Private, Free E-mail from MSN Hotmail at http://www.hotmail.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".