Hi!
Sacha Labourey wrote:
> OK but my problem is not only in the bean location. It is also in the JNDI
> naming location. If the JNDI graph is located on a server, it is no more
> possible to reach it for local query (when disconnected).
Exactly, but you will simply get NamingExceptions when you're
disconnected. As soon as you can connect the lookups will start working.
> Some times ago, I've managed this (I was using CORBA and Java, no EJB, ...)
> by having a Naming service hosted centraly AND on each station. So each
> station had stored locally its own stuff and when it wanted to reach server
> information it was transparently linked to another naming service through a
> distant NamingContext CORBA object (mesh of naming services or federation of
> naming services, depending...) So this was a good start. The problem was
> that I was unable to have access to distant object information when
> disconnected which could help sometimes.
>
> In this federation of NS possible with JNDI with distant namingContext
> possible?
Yes. Simply point your ejb-ref's to external JNDI-names which includes
the hostname, and you'll be fine.
I.e. in your ejb-jar.xml:
<ejb-ref>
<description>Reference to bean in other, central, possible
disconnected, server</description>
<ejb-ref-name>ejb/MyBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>somecompany.MyBeanHome</home>
<remote>somecompany.MyBean</remote>
</ejb-ref>
And then in jboss.xml:
<ejb-ref>
<ejb-ref-name>ejb/MyBean</ejb-ref-name>
<jndi-name>jnp://somehost/myapp/MyBean</jndi-name>
</ejb-ref>
When you look up "java:comp/env/ejb/MyBean" the real bean will be looked
up. When disconnected you will get a NamingException, and when connected
you will get the beans home. The dereference is done on each lookup so
the "reconnect" is automatic.
Try it out to get some feel for it.
/Rickard
--
Rickard �berg
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]