In EJB 1.1, the environment naming context (ENC) allows you to specify some
primitive wrappers in addition to String values for JNDI entries (replacing
the Environment properties in EJB 1.0).

It might be useful if the Properties type were included in the list of valid
environment entry types..  A lot of services (i.e. JNDI and JDBC) take
properties. Being able to specify and fetch an entire properties object
would ensure portability; String-value pairs wouldn't need to be requested
specifically.  I think adding a Properties type to the values available in
the ENC wouldn't complicate the DD significantly since the Properties object
is limited to name-String pairs.

As an example, consider connecting to a JNDI service provider.  To connect
to a JNDI SPI you need to specify properties of that connection when
creating an initial context.  These properties, the name and value pairs,
change with each SPI.  If you decide to change from LDAP to NIS for example,
to access a specific non-EJB resource, you would need to change the type of
properties used to initialize the JNDI context.  If however, you can get a
Properties object from the ENC, you don't need to know the specifics about a
particular JNDI SPI. Below is an example:

InitialContext iCtx = InitalContext( );
Context enviormentCtx = (Context)iCtx.lookup("java:comp/env");
Properties corpDirProps  =
(Properties)environmentCtx.lookup("corporate_JNDI_props");

IntialContext iCtx2 = InitailContext(corpDirProps);

Perhaps the above is not the best example, but it demonstrates how the
Properties object would simplify access. I guess you have to imagine
resources that are not JNDI or JDBC, which are available through the ENC
already.  Of course, other String and primitive wrapper types would still be
available as JNDI entries.

===========================================================================
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