OK, everything turned out to be simple, as always...

Method bind(String name, Object object) of javax.naming.Context can accept 
objects of type javax.naming.Reference as well, so this API enables the 
following code for binding ObjectFactory implementation to JNDI names:

Reference ref = new Reference(myFactoryClassName, myFactoryClassName, null);
  | 
  | Context context = new InitialContext();
  | 
  | context.bind("services/serviceName1", ref);
  | context.bind("services/serviceName2", ref);
  | context.bind("services/serviceName3", ref);

And every time the client code will lookup any of the above example JNDI names 
via context.lookup(...) our ObjectFactory will return the necessary proxy 
objects for accessing the target services.

  

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257307
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to