Class TomcatJndiProxy<C>

java.lang.Object
org.frankframework.jndi.JndiBase
org.frankframework.jndi.TomcatJndiProxy<C>
Type Parameters:
C - the type of class that is looked up
All Implemented Interfaces:
ObjectFactory, IConfigurable, IConfigurationAware, INamedObject, IScopeProvider, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class TomcatJndiProxy<C> extends JndiBase implements ObjectFactory
Tomcat Resource Factory that looks up objects in a delegate JNDI. Configure resource in Tomcat context.xml like:
        <Resource
                name="jms/qcf_tibco_esb_ff"
                factory="org.frankframework.jndi.TomcatJndiProxy"

                delegate_name="SLXHP_Queue_ConnectionFactory"
                delegate_jndiProperties="TibcoJndi.properties"
                delegate_providerURL="tibjmsnaming://DEVESBLARGEDC1:37243,tibjmsnaming://DEVESBLARGEDC2:37243"

                userName="IBIS_AWS_POC_USER"
                userPassword="xxxxxxx"
                SSLVendor="j2se"
                SSLEnableVerifyHost="false"
                SSLEnableVerifyHostName="false"
                SSLTrace="false"
                SSLDebugTrace="false"
        />
   
All attributes starting with the prefix 'delegate_' are used to configure the TomcatJndiProxy by calling setters with corresponding names (without the prefix).
The remaining attributes (except 'name' and 'factory') are used to configure the resulting object by calling corresponding setters.
In the exampe the username and password are set, to be used when the application uses the resulting connectionFactory to create a connection.

TibcoJndi.properties is a classpath resource, containing for instance:
 java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
 com.tibco.tibjms.naming.security_protocol=ssl
 com.tibco.tibjms.naming.ssl_enable_verify_host=false
 
Setting 'java.naming.factory.initial' here causes the TomcatJndiProxy to query the Tibco JNDI at (delegate_)providerURL.
Author:
Gerrit van Brakel
See Also:
  • "https://tomcat.apache.org/tomcat-8.0-doc/jndi-resources-howto.html#Adding_Custom_Resource_Factories"