On Sun, 1 Sep 2002 23:11, Leo Sutic wrote:
> 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).
I would LOVE to see this. I have actually implemented this twice in past (for
jboss, weblogic and jonas) but never been able to release it.
Another component I would love to see in this space is
interface AppServerStartup
{
void onStartup( JNDIPublisher pub ) throws Exception;
}
And this would be able to tie into whatever appserver specific mechanisms
exist for triggering things on startup. Each use different mechanisms - most
are easy to use (ie jboss/weblogic) but some are PITA!
--
Cheers,
Peter Donald
*-----------------------------------------------------*
* "Faced with the choice between changing one's mind, *
* and proving that there is no need to do so - almost *
* everyone gets busy on the proof." *
* - John Kenneth Galbraith *
*-----------------------------------------------------*
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>