Just one final note:
the JNDI binding/lookup must be pluggable in the container. For example,
if you use JBoss, then JNDI *requires* all objects bound to it to be
Serializable / Referenceable / etc. So if the container just takes a
component
and tries to bind it (or creates a proxy for it) then the bind()
operation
will most likely fail.
The solution (JBoss specific) is to use a NonSerializableFactory class.
The point is that other JNDI implementations may work differently. I'd
say that
while the lookup () operation on JNDI is well-defined across all
containers (that
I've seen), the bind() operation is not neccesarily so.
One possibility is to define an interface:
interface JNDIPublisher /* implements Component */ {
void bind (String name, Object obj);
Object lookup (String name);
void unbind (String name);
}
and plug the JNDI publisher in as any other component (taking care
not to make it visible to the other components in the container).
/LS
> From: Berin Loritsch [mailto:[EMAIL PROTECTED]]
>
> > From: Leo Sutic [mailto:[EMAIL PROTECTED]]
> >
> >
> > > If you want to access a globally accessible service, you get an
> > > InitialContext()
> >
> > Nitpick: The container gets an InitialContext. The whole point is
> > to be able to access globally accessible services published
> via JNDI
> > via the ServiceManager interface. The Serviceable component
> > should not need to care whether the service comes in via JNDI
> > or whether it is a peer in the container.
>
>
> Fair enough.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>