If you want to be super-tricky with env-entries, and <vendor>if your server
supports automatic hot redeployment (such as jBoss)</vendor>, you can have
some other code write to that deployment descriptor's env-entry elements,
changing the values based upon some other computation (for example, a legacy
C application fired off by some legacy ftp app that rewrites the values in
the decriptor), causing the values read by the ejb to be dynamic instead of
static.
Of course, if your values are changing frequently you should simply use some
datastore, even if that datastore is merely a file, since EJB's have such
clean datastore and resource factory access semantics.
psn
on 1/3/01 10:17 AM, Peter Braswell at [EMAIL PROTECTED] wrote:
> Max,
>
> The usual way to accomplish this is to use <env-entry> in the deployment
> descriptor and do a lookup in the initial context. Here is an example:
>
> Your descriptor would contain:
> <env-entry>
> <env-entry-name>myApp.myProperty</env-entry-name>
> <env-entry-type>java.lang.String</env-entry-type>
> <env-entry-value>SomeValue</env-entry-value>
> </env-entry>
>
> Your bean would include the following code:
> String prop = ( String ) new InitialContext().lookup(
> "java:comp/env/myApp.myProperty");
>
> At this point the variable 'prop' would be equal to the value 'SomeValue'.
>
> Hope this helps
> Cheers,
> peter
>
> At Wed, 3 Jan 2001 16:49:01 +0200 , Mikko Laanti <[EMAIL PROTECTED]> wrote:
>
>> Hi,
>>
>> In EJB Spec. there was mentioned that using direct file io from Ejb is
>> not a "good idea". People also talked about this in this newsletter.
>>
>> How about using Properties class? I know it's based on file IO but does
>> Ejb container support it?
>>
>> Anyone know?
>>
>> Br
>>
>> - Max
>>
>>
>> email: [EMAIL PROTECTED]
>>
>> ===========================================================================
>> 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".