[jboss-user] [JNDI/Naming/Network] - Custom resource factory accessible through JNDI

jkostelansky@hotmail.com do-not-reply at jboss.com
Thu Oct 18 16:22:33 EDT 2007


I have developed resource factory which produces desired objects and is accessible through JNDI context implementing javax.naming.spi.ObjectFactory. It is possible to register such a factory in tomcat's server.xml. However our new customer requires Jboss 4.0.x.
I have found a lot of information regarding jboss-web.xml file, but noting how to actually register factory in jboss JNDI.

So far I know Jboss offers 3 of box (JNDIBindingServiceMgr, NamingAlias and ExternalContext) context, but non of them fill fill my needs.

I could have managed to successfully create JNDI reference through org.jboss.naming.JNDIBindingServiceMgr but this is limited to Java Beans or text values. What I need is to hook implementation javax.naming.spi.ObjectFactory interface to jboss JNDI.

web.xml
<web-app version="2.4">
  | 	<description>test web application which tests custom jndi context</description>
  | <resource-env-ref>
  |   <description>
  |     Object factory for test resource manager.
  |   </description>
  |   <resource-env-ref-name>
  |     res/TestresourceManager
  |   </resource-env-ref-name>
  |   <resource-env-ref-type>
  |     java.lang.String
  |   </resource-env-ref-type>
  | </resource-env-ref>
  | </web-app>
jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
  | <jboss-web>
  | <resource-env-ref-name>res/TestresourceManager</resource-env-ref-name>
  | 	<jndi-name>res/TestresourceManager</jndi-name>
  | </jboss-web>

Thank you in advance, Jan

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4096729



More information about the jboss-user mailing list