<My first post after a month of lurking>
Vlada,
Are you sure? I don't think you are correct. Can't you access variables set
in the DD through the entity/sessionContext?
I use a method (below) to retrieve the home object for other beans in my
system named in the deployment descriptor like this:
protected Object getHome(String name) throws RemoteException {
Object ret;
try {
String jndiName = ejbContext.getEnvironment().getProperty(name);
System.out.println("Looking up:"+jndiName);
ret = getJndiContext().lookup(jndiName);
} catch(javax.naming.NamingException ne) {
throw new RemoteException("Could not lookup "+name,ne);
}
return ret;
}
Similarly to get a named table (for sequences in this case) I use
protected String getSequenceName() {
if (verbose)
System.out.println("--->getSequenceName()");
return (String) ejbProperties.get("sequenceName");
}
Where ejbProperties is defined like this:
public void setEntityContext(EntityContext ctx)
throws RemoteException {
if (verbose)
System.out.println("setEntityContext (" + id() + ")");
this.ejbContext = ctx;
this.ejbProperties = ctx.getEnvironment();
}
In all of my entity beans (using an adapter as outlined in Richard M-H's
excellent book) :-)
Hope that helps.
Rick
At 10:21 AM 10/13/99 -0700, Vlada Matena wrote:
>The DD properties are not intended to be available to the enterprise bean
>code at runtime.
>
>Vlada
>
>----- Original Message -----
>From: Thomas Cox <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, October 13, 1999 9:47 AM
>Subject: Accessing DD properties from EJBean
>
>
> > What is the syntax for accessing properties set in the Deployment
> Descriptor
> > from within an EJB?
> >
> > I hope its not different based on Vendor implementation ; )
> >
> > Thanks.
> > _________________________________________________________
> >
> > Tom Cox
> > Solution Center of the Americas Phone: +1.612.397.4226
> > 400 One Financial Plaza Fax: +1.612.692.4226
> > 120 South Sixth Street Alt Fax: +1.612.397.4370
> > Minneapolis, MN 55402 e-mail: [EMAIL PROTECTED]
> > _________________________________________________________
> >
> >
> > I'd imagine you should add
> > these JNDI properties in your deployment descriptor as environment entries
> > <env-entry>. The only problem I see with that approach is the fact
> you'd be
> > duplicating the same entries in a number of different deployment
> > descriptors.
> >
> > Jeff Bailey ([EMAIL PROTECTED])
> > Sr. Software Engineer
> > NetGenics, Inc.
> >
> > ===========================================================================
> > 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".
_______________________________________________________________
Rick Mangi Tel: (212) 972-2030
Thaumaturgix, Inc. Fax: (212) 972-2003
317 Madison Avenue, Suite 1615 [EMAIL PROTECTED]
New York, NY 10017 http://www.tgix.com
thau'ma-tur-gy, n. the working of miracles
"You can only see what you thought you knew" - j. wilson
_______________________________________________________________
===========================================================================
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".