Package org.frankframework.jndi
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
Tomcat Resource Factory that looks up objects in a delegate JNDI.
Configure resource in Tomcat context.xml like:
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:
<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=falseSetting '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"
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class org.frankframework.jndi.JndiBase
configure, getApplicationContext, getAuthentication, getConfigurationClassLoader, getContext, getCredentials, getInitialContextFactoryName, getJmsRealmName, getJndiAuthAlias, getJndiContextPrefix, getJndiEnv, getJndiProperties, getName, getPrincipal, getProviderURL, getSecurityProtocol, getUrlPkgPrefixes, setApplicationContext, setAuthentication, setCredentials, setInitialContextFactoryName, setJmsRealm, setJndiAuthAlias, setJndiContextPrefix, setJndiProperties, setName, setPrincipal, setProviderURL, setSecurityProtocol, setUrlPkgPrefixes, stop, toString
-
Field Details
-
log
protected org.apache.logging.log4j.Logger log -
DELEGATE_PREFIX
- See Also:
-
-
Constructor Details
-
TomcatJndiProxy
public TomcatJndiProxy()
-
-
Method Details
-
getObjectInstance
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception- Specified by:
getObjectInstance
in interfaceObjectFactory
- Throws:
Exception
-