Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

[jboss-user] [Clustering/JBoss] - ServiceLocator and caching home
 interfaces in a cluster. Ple

scott.stark@jboss.org

2007-07-18


I am relatively new to clustering so please do not send me to read documentation. I have read all I could find.
I also read JBoss documentation on clustering but yet I do not entirely understand. At the end of the message there is a quote from JBoss documentation but I still need explanation in plain language. Can anyone please answer????

I think about implementing ServiceLocator that caches home interfaces in a cluster. Yes, I know that it will be a one singleton per JVM. So I have 3 nodes, I will have 3 singletons. Is there a problem with that?

In a clustered environment (JBoss 4.0.5, a few nodes, sticky is off) are home interfaces bound to a specific node in the cluster or not? In other words can I or can I not...?

1. can I safely cache reference to a home interface (EJBHome) to a session bean in a ServiceLocator ?
2. can I safely cache reference to a home interface to a entity bean in a ServiceLocator ?
3. can I safely cache LOCAL home interface (EJBLocalHome) in a ServiceLocator ?

I use HA-JNDI (I think that I do since I put "localhost:1100" into Context.PROVIDER_URL). This means I DO use HA-JNDI. Correct?

I create InitialContext as:
   {
...........
   Hashtable environment = new Hashtable();
   environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
   environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
   environment.put(Context.PROVIDER_URL, "localhost:1100");    

   return new InitialContext(environment);
..........
and I use True in META-INF\jboss.xml for all my beans





Below is a quote from section 1.2.1 How it works from "The JBoss 4 Application Server Clustering Guide " On the server side, new InitialContext(), will be bound to a local-only, non-cluster-wide JNDI Context (this is actually basic JNDI). So, all EJB homes and such will not be bound to the cluster-wide JNDI Context, but rather, each home will be bound into the local JNDI. When a remote client does a lookup through HA-JNDI, HA-JNDI will delegate to the local JNDI Context when it cannot find the object within the global cluster-wide Context. The detailed lookup rule is as follows.

- If the binding is available in the cluster-wide JNDI tree and it returns it.
- If the binding is not in the cluster-wide tree, it delegates the lookup query to the local JNDI service and returns the received answer if available.
- If not available, the HA-JNDI services asks all other nodes in the cluster if their local JNDI service owns such a binding and returns the an answer from the set it receives.
- If no local JNDI service owns such a binding, a NameNotFoundException is finally raised."


Thanks to anyone who answers or just reads....

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065626#4065626

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065626
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.