Hi!
pranab wrote:
> From a long discussion on the JNDI Namespace on JBOSS I came to
> understand
> there are two faces of it.
> 1) The view within the jboss server.
One/bean, yes.
> 2) the view from outside.
The global namespace, yes, which is also visible to the beans.
> The view within:-
> This view is only for the objects/EJBS deployed on the server to find
> information
> about other EJB's ,environment variables and references.So you can
> use
> "java:comp/env" prefix or context to get a listing of other
> beans,env. vars. and refs.
> Another way of putting it is it is available to clients of a deployed
> EJB which
> itself is a deployed EJB.
It is available to all EJB components, yes.
> The view from outside:
> This view id for all clients which run separately from the jboss
> server.Here one will
> see listed in the default root context the database jndi refs,EJBHome
> refs,JMX ref,Transaction Manager ref.,data base connection pool ref and
> any sub contexts
> which is totally decided by the by virtue of their naming style.e.g.
> (Context) [root]-+
> |
> +- (Context) jdbc -+
> | |
> | +- OracleDB
> +- (Object Ref) Transaction Manager
Correct.
> Sample list
> ------------
> Object:Hypersonic: org.jboss.jdbc.DataSourceImpl
> Object:jmx: org.jboss.jmx.server.JMXAdaptorImpl
> Object:TravelAgentBean: $Proxy0
> Object:Cabin: $Proxy1
> Object:jdbc: org.jnp.interfaces.NamingContext
> Object:xa.postgresqlPool: org.jboss.minerva.datasource.XAPoolDataSource
> Object:InstantDB: org.jboss.jdbc.DataSourceImpl
> Object:TransactionManager: class org.jboss.tm.TxManager
> initial context :javax.naming.InitialContext@b66cc
> Object:jdbc/postgresql: org.jboss.jdbc.DataSourceImpl
>
> The only difference being that you dont have to user the
> "java:comp/env" prefix to
> do the lookup.Somehow I feel that this is what the designers of jnp had
> in mind.
This is incorrect. On the surface the difference might seem small, but
when you drill down to why it works the way it does it is much more than
that. If this was the only difference, then why add the java:-namespace?
It wouldn't add much, would it?
The idea is to make it easy to do reusable components that can be used
in a variety of contexts in different applications. Without a layer of
indirection that you can use to glue together loosely coupled
components, this would not be possible, or at least significantly
harder.
> As per EJB1.1 spec. you tend to think that using "java:comp/env" will
> work for
> external EJB clients.
And as of J2EE 1.2 this should indeed work. We need to add this
capability.
/Rickard
--
Rickard �berg
@home: +46 13 177937
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]