Chapter 11. Sharing Providers through JNDI

Table of Contents

Jakarta Tomcat Configuration
JNDIProviderFactory Configuration
Using the JNDIProviderFactory
Additional Information


JNDI offers the possibility to share resources between different (web- /j2ee-)applications. This chapter describes how to share a TopicMapProvider through a JNDI context. This can be helpful when you have two or more different applications needing access to exactly the same TopicMap(s).

This implementation uses a JNDI Service Provider implementation org.tm4j.jndi.spi.ProviderFactory to create an instance of a TopicMapProvider and export it through JNDI. A special implementation of org.tm4j.topicmap.TopicMapProviderFactory can be used to transparently retrieve the provider from JNDI again.

The org.tm4j.jndi.provider.JNDIProviderFactory is used like a normal TopicMapProviderFactory, but rather than creating a new TopicMapProvider it retrieves a shared one from JNDI.